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 <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-07-02 14:16:28 +02:00 committed by GitHub
parent 94f35ba998
commit da364f7a61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 14 deletions

View file

@ -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 <https://html.spec.whatwg.org/multipage/#dom-tdth-rowspan>:
// > 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::<Node>().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
},