Changeset 217708 in webkit


Ignore:
Timestamp:
Jun 2, 2017 3:18:54 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Invalidate the shadow subtree style when slotted pseudo rules are present.
https://bugs.webkit.org/show_bug.cgi?id=172822

Patch by Emilio Cobos Álvarez <ecobos@igalia.com> on 2017-06-02
Reviewed by Antti Koivisto.

No new tests, this is tested by
fast/shadow-dom/css-scoping-slot-with-id.html, once we don't force an
Inherit style change for slots. I could add some more tests for stuff
with descendant combinators and similar I guess, though.

  • style/AttributeChangeInvalidation.cpp:

(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):

  • style/ClassChangeInvalidation.cpp:

(WebCore::Style::ClassChangeInvalidation::invalidateStyle):

  • style/IdChangeInvalidation.cpp:

(WebCore::Style::IdChangeInvalidation::invalidateStyle):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r217706 r217708  
     12017-06-02  Emilio Cobos Álvarez  <ecobos@igalia.com>
     2
     3        Invalidate the shadow subtree style when slotted pseudo rules are present.
     4        https://bugs.webkit.org/show_bug.cgi?id=172822
     5
     6        Reviewed by Antti Koivisto.
     7
     8        No new tests, this is tested by
     9        fast/shadow-dom/css-scoping-slot-with-id.html, once we don't force an
     10        Inherit style change for slots. I could add some more tests for stuff
     11        with descendant combinators and similar I guess, though.
     12
     13        * style/AttributeChangeInvalidation.cpp:
     14        (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
     15        * style/ClassChangeInvalidation.cpp:
     16        (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
     17        * style/IdChangeInvalidation.cpp:
     18        (WebCore::Style::IdChangeInvalidation::invalidateStyle):
     19
    1202017-06-02  Miguel Gomez  <magomez@igalia.com>
    221
  • trunk/Source/WebCore/style/AttributeChangeInvalidation.cpp

    r216761 r217708  
    2929#include "DocumentRuleSets.h"
    3030#include "ElementIterator.h"
     31#include "HTMLSlotElement.h"
    3132#include "ShadowRoot.h"
    3233#include "StyleInvalidator.h"
     
    9899        mayAffectShadowTree = true;
    99100
     101    if (is<HTMLSlotElement>(m_element) && !ruleSets.authorStyle().slottedPseudoElementRules().isEmpty())
     102        mayAffectShadowTree = true;
     103
    100104    if (mayAffectShadowTree) {
    101105        m_element.invalidateStyleForSubtree();
  • trunk/Source/WebCore/style/ClassChangeInvalidation.cpp

    r216761 r217708  
    2929#include "DocumentRuleSets.h"
    3030#include "ElementChildIterator.h"
     31#include "HTMLSlotElement.h"
    3132#include "ShadowRoot.h"
    3233#include "SpaceSplitString.h"
     
    141142        mayAffectShadowTree = true;
    142143
     144    if (is<HTMLSlotElement>(m_element) && !ruleSets.authorStyle().slottedPseudoElementRules().isEmpty())
     145        mayAffectShadowTree = true;
     146
    143147    if (mayAffectShadowTree) {
    144148        // FIXME: We should do fine-grained invalidation for shadow tree.
  • trunk/Source/WebCore/style/IdChangeInvalidation.cpp

    r216761 r217708  
    2929#include "DocumentRuleSets.h"
    3030#include "ElementChildIterator.h"
     31#include "HTMLSlotElement.h"
    3132#include "ShadowRoot.h"
    3233#include "StyleResolver.h"
     
    8485        mayAffectShadowTree = true;
    8586
     87    if (is<HTMLSlotElement>(m_element) && !ruleSets.authorStyle().slottedPseudoElementRules().isEmpty())
     88        mayAffectShadowTree = true;
     89
    8690    if (mayAffectShadowTree) {
    8791        m_element.invalidateStyleForSubtree();
Note: See TracChangeset for help on using the changeset viewer.