Skip to content
Permalink
Browse files
[CSS Container Queries] rem units don't work in queries
https://bugs.webkit.org/show_bug.cgi?id=241852

Reviewed by Antoine Quint.

* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-units-dynamic-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-units-expected.txt:
* Source/WebCore/style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::selectContainer const):

Correctly pass the document element style instead of the view style.

Canonical link: https://commits.webkit.org/251734@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
anttijk committed Jun 22, 2022
1 parent 9a20062 commit 035e7bfda01918a7dc54e1186646bc326fa3f963
Showing 3 changed files with 3 additions and 4 deletions.
@@ -4,7 +4,7 @@ PASS rem relative before change
PASS ex relative before change
PASS ch relative before change
PASS em relative after change
FAIL rem relative after change assert_equals: expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
PASS rem relative after change
PASS ex relative after change
PASS ch relative after change

@@ -1,6 +1,6 @@

PASS em relative inline-size
FAIL rem relative inline-size assert_equals: expected "rgb(0, 128, 0)" but got "rgb(0, 0, 0)"
PASS rem relative inline-size
PASS ex relative inline-size
PASS ch relative inline-size

@@ -73,10 +73,9 @@ auto ContainerQueryEvaluator::selectContainer(const FilteredContainerQuery& filt
auto* renderer = dynamicDowncast<RenderBox>(element.renderer());
if (!renderer)
return { };
auto& view = renderer->view();
return {
renderer,
CSSToLengthConversionData { renderer->style(), &view.style(), nullptr, &view }
CSSToLengthConversionData { renderer->style(), element.document().documentElement()->renderStyle(), nullptr, &renderer->view() }
};
};

0 comments on commit 035e7bf

Please sign in to comment.