Changeset 199060 in webkit


Ignore:
Timestamp:
Apr 5, 2016 9:45:51 AM (8 years ago)
Author:
Antti Koivisto
Message:

Shadow DOM: :host() From The First Shadow Context Should Not Style All Shadow Context
https://bugs.webkit.org/show_bug.cgi?id=156235
<rdar://problem/24668206>

Reviewed by Andreas Kling.

Source/WebCore:

Test: fast/shadow-dom/host-style-sharing.html

  • style/StyleSharingResolver.cpp:

(WebCore::Style::SharingResolver::resolve):
(WebCore::Style::SharingResolver::canShareStyleWithElement):

Disallow style sharing for shadow hosts affected by :host pseudo class rules.

LayoutTests:

  • fast/shadow-dom/host-style-sharing-expected.html: Added.
  • fast/shadow-dom/host-style-sharing.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r199054 r199060  
     12016-04-05  Antti Koivisto  <antti@apple.com>
     2
     3        Shadow DOM: :host() From The First Shadow Context Should Not Style All Shadow Context
     4        https://bugs.webkit.org/show_bug.cgi?id=156235
     5        <rdar://problem/24668206>
     6
     7        Reviewed by Andreas Kling.
     8
     9        * fast/shadow-dom/host-style-sharing-expected.html: Added.
     10        * fast/shadow-dom/host-style-sharing.html: Added.
     11
    1122016-04-05  Antti Koivisto  <antti@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r199059 r199060  
     12016-04-05  Antti Koivisto  <antti@apple.com>
     2
     3        Shadow DOM: :host() From The First Shadow Context Should Not Style All Shadow Context
     4        https://bugs.webkit.org/show_bug.cgi?id=156235
     5        <rdar://problem/24668206>
     6
     7        Reviewed by Andreas Kling.
     8
     9        Test: fast/shadow-dom/host-style-sharing.html
     10
     11        * style/StyleSharingResolver.cpp:
     12        (WebCore::Style::SharingResolver::resolve):
     13        (WebCore::Style::SharingResolver::canShareStyleWithElement):
     14
     15            Disallow style sharing for shadow hosts affected by :host pseudo class rules.
     16
    1172016-04-05  Alex Christensen  <achristensen@webkit.org>
    218
  • trunk/Source/WebCore/style/StyleSharingResolver.cpp

    r198943 r199060  
    3434#include "RenderStyle.h"
    3535#include "SVGElement.h"
     36#include "ShadowRoot.h"
    3637#include "StyleUpdate.h"
    3738#include "StyledElement.h"
     
    9697    if (elementHasDirectionAuto(element))
    9798        return nullptr;
     99#if ENABLE(SHADOW_DOM)
     100    if (element.shadowRoot() && !element.shadowRoot()->styleResolver().ruleSets().authorStyle()->hostPseudoClassRules().isEmpty())
     101        return nullptr;
     102#endif
    98103
    99104    Context context {
     
    278283    if (element.matchesInvalidPseudoClass() != element.matchesValidPseudoClass())
    279284        return false;
     285
     286#if ENABLE(SHADOW_DOM)
     287    if (element.shadowRoot() && !element.shadowRoot()->styleResolver().ruleSets().authorStyle()->hostPseudoClassRules().isEmpty())
     288        return nullptr;
     289#endif
    280290
    281291#if ENABLE(VIDEO_TRACK)
Note: See TracChangeset for help on using the changeset viewer.