mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #14518 - mbrubeck:rowspan2, r=notriddle
Fix inline layout of table cells impacted by rowspan This is part of the fix for #11297. This PR fixes the inline layout of table cells impacted by row-spanning cells from previous rows. A separate PR to follow will fix the table block size calculations to account for rowspan. This PR doesn't yet include any test changes. If it doesn't cause any existing tests to pass, I will add a new test to it. r? @pcwalton <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14518) <!-- Reviewable:end -->
This commit is contained in:
commit
9d320d5a34
16 changed files with 248 additions and 822 deletions
|
@ -325,6 +325,8 @@ pub trait LayoutElementHelpers {
|
|||
#[allow(unsafe_code)]
|
||||
unsafe fn get_colspan(self) -> u32;
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn get_rowspan(self) -> u32;
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn html_element_in_html_document_for_layout(&self) -> bool;
|
||||
fn id_attribute(&self) -> *const Option<Atom>;
|
||||
fn style_attribute(&self) -> *const Option<Arc<RwLock<PropertyDeclarationBlock>>>;
|
||||
|
@ -628,6 +630,17 @@ impl LayoutElementHelpers for LayoutJS<Element> {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn get_rowspan(self) -> u32 {
|
||||
if let Some(this) = self.downcast::<HTMLTableCellElement>() {
|
||||
this.get_rowspan().unwrap_or(1)
|
||||
} else {
|
||||
// Don't panic since `display` can cause this to be called on arbitrary
|
||||
// elements.
|
||||
1
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn html_element_in_html_document_for_layout(&self) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue