Dynamic media queries don't update in shadow tree stylesheets
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Nov 2017 18:10:40 +0000 (18:10 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Nov 2017 18:10:40 +0000 (18:10 +0000)
commit3448e74b46f959336dfb9bbaab417f9d58b30872
tree526a1d7bdf172eb928c4e25b01c54c17b5d7d2cd
parentec193f15de18fb9e54e39338bf9eed0b919a4f8c
Dynamic media queries don't update in shadow tree stylesheets
https://bugs.webkit.org/show_bug.cgi?id=179324

Reviewed by Ryosuke Niwa.

Source/WebCore:

Viewport and accessibility queries should work dynamically also in shadow trees.

Test: fast/shadow-dom/media-query-in-shadow-style.html

* page/LayoutContext.cpp:
(WebCore::LayoutContext::updateStyleForLayout):
* page/Page.cpp:
(WebCore::Page::accessibilitySettingsDidChange):

    Evaluate media query list (JS API) unconditionally as it is independent from style queries.
    Remove some logging.

* style/StyleScope.cpp:
(WebCore::Style::Scope::evaluateMediaQueriesForViewportChange):
(WebCore::Style::Scope::evaluateMediaQueriesForAccessibilitySettingsChange):

    Factor into functions in style scope.

(WebCore::Style::Scope::evaluateMediaQueries):

    Evaluate queries in all shadow trees too.

* style/StyleScope.h:

LayoutTests:

* fast/shadow-dom/media-query-in-shadow-style-expected.html: Added.
* fast/shadow-dom/media-query-in-shadow-style.html: Added.
* fast/shadow-dom/resources/media-query-in-shadow-style-frame.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224535 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/shadow-dom/media-query-in-shadow-style-expected.html [new file with mode: 0644]
LayoutTests/fast/shadow-dom/media-query-in-shadow-style.html [new file with mode: 0644]
LayoutTests/fast/shadow-dom/resources/media-query-in-shadow-style-frame.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/LayoutContext.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/style/StyleScope.cpp
Source/WebCore/style/StyleScope.h