From 227aecad510ac0ebc7c3f56de222e374c9b8a0d0 Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Tue, 1 Jul 2025 20:48:35 +0200 Subject: [PATCH] layout: Only include quirks-mode.css in actual quirks mode (#37814) This stylesheet was being included both in quirks mode and in limited quirks mode. It should only be the former. Testing: adding new test. Part of #37813 Signed-off-by: Oriol Brufau --- components/layout/layout_impl.rs | 2 +- tests/wpt/meta/MANIFEST.json | 7 ++ .../tentative/table-limited-quiks.html | 78 +++++++++++++++++++ 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 tests/wpt/tests/css/css-tables/tentative/table-limited-quiks.html diff --git a/components/layout/layout_impl.rs b/components/layout/layout_impl.rs index 237ca7f836a..a4db91ecf87 100644 --- a/components/layout/layout_impl.rs +++ b/components/layout/layout_impl.rs @@ -727,7 +727,7 @@ impl LayoutThread { self.load_all_web_fonts_from_stylesheet_with_guard(stylesheet, guards.ua_or_user); } - if self.stylist.quirks_mode() != QuirksMode::NoQuirks { + if self.stylist.quirks_mode() == QuirksMode::Quirks { self.stylist.append_stylesheet( ua_stylesheets.quirks_mode_stylesheet.clone(), guards.ua_or_user, diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json index 9de05cf9d35..3c079886b7c 100644 --- a/tests/wpt/meta/MANIFEST.json +++ b/tests/wpt/meta/MANIFEST.json @@ -611775,6 +611775,13 @@ {} ] ], + "table-limited-quiks.html": [ + "4deb7a93898aea084b0de1ffcee942ca889e8c9d", + [ + null, + {} + ] + ], "table-minmax.html": [ "eda9ce37fb184d26d204ac07922e21a8406ec1f3", [ diff --git a/tests/wpt/tests/css/css-tables/tentative/table-limited-quiks.html b/tests/wpt/tests/css/css-tables/tentative/table-limited-quiks.html new file mode 100644 index 00000000000..4deb7a93898 --- /dev/null +++ b/tests/wpt/tests/css/css-tables/tentative/table-limited-quiks.html @@ -0,0 +1,78 @@ + + +Table in limited-quirks mode + + + + + + + + + + + + + +

Tables in limited-quirks mode proposals

+ +

The table cell height box sizing quirk does NOT apply to limited-quirks mode

+ + + + +
100 height
+ + + + +
100 height
+ +

The table cell nowrap minimum width calculation quirk does NOT apply to limited-quirks mode

+ + + + +
nowrap nowrap nowrap nowrap
+ +

The text decoration doesn’t propagate into tables quirk does NOT apply to limited-quirks mode

+
+ + +
decoration
+
+ +

The collapsing table quirk does NOT apply to limited-quirks mode

+
+ +

The table cell width calculation quirk does NOT apply to limited-quirks mode

+ + +
+ +