mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add width
and height
presentational hints for table-related elements (#33405)
We were only parsing the `width` attribute as a presentation hint for `<table>`, `<td>` and `<th>`. This patch also handles `<colgroup>` and `<col>`. Also, we weren't parsing `height` at all, now we do it for `<table>`, `<td>`, `<th>`, `<tr>`, `<tbody>`, `<thead>` and `<tfoot>`. One test is now crashing, but this was an existing issue: #33423 Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
37ab4b9825
commit
4839cdf176
16 changed files with 65 additions and 228 deletions
|
@ -850,6 +850,8 @@ impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element> {
|
|||
this.get_width()
|
||||
} else if let Some(this) = self.downcast::<HTMLTableCellElement>() {
|
||||
this.get_width()
|
||||
} else if let Some(this) = self.downcast::<HTMLTableColElement>() {
|
||||
this.get_width()
|
||||
} else if let Some(this) = self.downcast::<HTMLHRElement>() {
|
||||
// https://html.spec.whatwg.org/multipage/#the-hr-element-2:attr-hr-width
|
||||
this.get_width()
|
||||
|
@ -886,6 +888,14 @@ impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element> {
|
|||
this.get_height()
|
||||
} else if let Some(this) = self.downcast::<HTMLImageElement>() {
|
||||
this.get_height()
|
||||
} else if let Some(this) = self.downcast::<HTMLTableElement>() {
|
||||
this.get_height()
|
||||
} else if let Some(this) = self.downcast::<HTMLTableCellElement>() {
|
||||
this.get_height()
|
||||
} else if let Some(this) = self.downcast::<HTMLTableRowElement>() {
|
||||
this.get_height()
|
||||
} else if let Some(this) = self.downcast::<HTMLTableSectionElement>() {
|
||||
this.get_height()
|
||||
} else {
|
||||
LengthOrPercentageOrAuto::Auto
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue