Media query with :host inside a custom elements doesn't get updated on window resize
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Nov 2017 01:15:21 +0000 (01:15 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Nov 2017 01:15:21 +0000 (01:15 +0000)
commit70dcf2be34810db76002da98212bbf38aec84dd9
treee22f434837ae22482260129c1069f271a6e6f31c
parentae1596c34252c91d2afed5ac850130182163a631
Media query with :host inside a custom elements doesn't get updated on window resize
https://bugs.webkit.org/show_bug.cgi?id=176101
<rdar://problem/34163850>

Reviewed by Simon Fraser.

Source/WebCore:

If a media query containing :host or ::slotted stops applying we fail to update the style.

* style/StyleScope.cpp:
(WebCore::Style::invalidateHostAndSlottedStyleIfNeeded):

    Factor into function.

(WebCore::Style::Scope::updateActiveStyleSheets):
(WebCore::Style::Scope::scheduleUpdate):

    Invalidate elements that may match :host and ::slotted before clearing style resolver for full update.

LayoutTests:

Expand the existing test case to cover :host and ::slotted.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/shadow-dom/media-query-in-shadow-style-expected.html
LayoutTests/fast/shadow-dom/resources/media-query-in-shadow-style-frame.html
Source/WebCore/ChangeLog
Source/WebCore/style/StyleScope.cpp