From da364f7a614d687dd1b2311b380055accbf03fbe Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Wed, 2 Jul 2025 14:16:28 +0200 Subject: [PATCH] script: Remove the quirk of flooring rowSpan by 1 (#37831) Only Firefox has this quirk, Chrome and Safari don't. So it's simpler to just remove it. Testing: tested by WPT Signed-off-by: Oriol Brufau --- components/script/dom/htmltablecellelement.rs | 10 ++-------- tests/wpt/meta/MANIFEST.json | 2 +- .../tests/css/css-tables/tentative/table-quirks.html | 10 +++++----- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/components/script/dom/htmltablecellelement.rs b/components/script/dom/htmltablecellelement.rs index 4dbfc97e588..89bbf1e205a 100644 --- a/components/script/dom/htmltablecellelement.rs +++ b/components/script/dom/htmltablecellelement.rs @@ -7,7 +7,6 @@ use html5ever::{LocalName, Prefix, local_name, ns}; use js::rust::HandleObject; use style::attr::{AttrValue, LengthOrPercentageOrAuto}; use style::color::AbsoluteColor; -use style::context::QuirksMode; use super::attr::Attr; use super::element::AttributeMutation; @@ -208,13 +207,8 @@ impl VirtualMethods for HTMLTableCellElement { // From : // > The rowSpan IDL attribute must reflect the rowspan content attribute. It is clamped to // > the range [0, 65534], and its default value is 1. - // Note that rowspan = 0 is not supported in quirks mode. - let document = self.upcast::().owner_doc(); - if document.quirks_mode() == QuirksMode::Quirks { - *value = (*value).clamp(1, 65534); - } else { - *value = (*value).clamp(0, 65534); - } + // Note Firefox floors by 1 in quirks mode, but like Chrome and Safari we don't do that. + *value = (*value).clamp(0, 65534); } attr }, diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json index 39a9e8468c0..e1f647c44b8 100644 --- a/tests/wpt/meta/MANIFEST.json +++ b/tests/wpt/meta/MANIFEST.json @@ -611790,7 +611790,7 @@ ] ], "table-quirks.html": [ - "dcf6c084eda46d58b065f54cc05dde59682abbee", + "cdebe8768dda04efc62636cf8a18c5bf89f5a086", [ null, {} diff --git a/tests/wpt/tests/css/css-tables/tentative/table-quirks.html b/tests/wpt/tests/css/css-tables/tentative/table-quirks.html index dcf6c084eda..cdebe8768dd 100644 --- a/tests/wpt/tests/css/css-tables/tentative/table-quirks.html +++ b/tests/wpt/tests/css/css-tables/tentative/table-quirks.html @@ -55,7 +55,7 @@

The collapsing table quirk

-

Chrome Legacy/Edge/Safari ignore the quirk, FF does not. Proposal: depreciate the quirk

+

Chrome Legacy/Edge/Safari ignore the quirk, FF does not. Proposal: deprecate the quirk

The table cell width calculation quirk

@@ -64,10 +64,10 @@

The "let cell grows downward be false" quirk

-

Chrome LayoutNG and Safari ignore the quirk, FF does not.

+

Chrome LayoutNG and Safari ignore the quirk, FF does not. Proposal: deprecate the quirk

- +
100 height208 height
@@ -82,7 +82,7 @@ assert_equals(window.getComputedStyle(document.querySelector("#notitalic")).fontStyle, "normal"); }, "decoration does not propagate into table"); test(_ => { - assert_equals(document.querySelector("#rowspan").rowSpan, 1); - }, "rowspan can't be zero"); + assert_equals(document.querySelector("#rowspan").rowSpan, 0); + }, "rowspan can be zero"); document.fonts.ready.then(() => checkLayout("table"));