Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 1899653002: Support slotchange event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 return value.lowerASCII(); 1133 return value.lowerASCII();
1134 return value; 1134 return value;
1135 } 1135 }
1136 1136
1137 void Element::attributeChanged(const QualifiedName& name, const AtomicString& ol dValue, const AtomicString& newValue, AttributeModificationReason reason) 1137 void Element::attributeChanged(const QualifiedName& name, const AtomicString& ol dValue, const AtomicString& newValue, AttributeModificationReason reason)
1138 { 1138 {
1139 if (ElementShadow* parentElementShadow = shadowWhereNodeCanBeDistributed(*th is)) { 1139 if (ElementShadow* parentElementShadow = shadowWhereNodeCanBeDistributed(*th is)) {
1140 if (shouldInvalidateDistributionWhenAttributeChanged(parentElementShadow , name, newValue)) 1140 if (shouldInvalidateDistributionWhenAttributeChanged(parentElementShadow , name, newValue))
1141 parentElementShadow->setNeedsDistributionRecalc(); 1141 parentElementShadow->setNeedsDistributionRecalc();
1142 } 1142 }
1143 if (name == HTMLNames::slotAttr && isChildOfV1ShadowHost()) 1143 if (name == HTMLNames::slotAttr && isChildOfV1ShadowHost()) {
1144 parentElementShadow()->setNeedsDistributionRecalc(); 1144 parentElementShadow()->setNeedsDistributionRecalc();
1145 document().updateAssignment();
1146 }
1145 1147
1146 parseAttribute(name, oldValue, newValue); 1148 parseAttribute(name, oldValue, newValue);
1147 1149
1148 document().incDOMTreeVersion(); 1150 document().incDOMTreeVersion();
1149 1151
1150 if (name == HTMLNames::idAttr) { 1152 if (name == HTMLNames::idAttr) {
1151 AtomicString oldId = elementData()->idForStyleResolution(); 1153 AtomicString oldId = elementData()->idForStyleResolution();
1152 AtomicString newId = makeIdForStyleResolution(newValue, document().inQui rksMode()); 1154 AtomicString newId = makeIdForStyleResolution(newValue, document().inQui rksMode());
1153 if (newId != oldId) { 1155 if (newId != oldId) {
1154 elementData()->setIdForStyleResolution(newId); 1156 elementData()->setIdForStyleResolution(newId);
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 } 2064 }
2063 2065
2064 void Element::childrenChanged(const ChildrenChange& change) 2066 void Element::childrenChanged(const ChildrenChange& change)
2065 { 2067 {
2066 ContainerNode::childrenChanged(change); 2068 ContainerNode::childrenChanged(change);
2067 2069
2068 checkForEmptyStyleChange(); 2070 checkForEmptyStyleChange();
2069 if (!change.byParser && change.isChildElementChange()) 2071 if (!change.byParser && change.isChildElementChange())
2070 checkForSiblingStyleChanges(change.type == ElementRemoved ? SiblingEleme ntRemoved : SiblingElementInserted, change.siblingBeforeChange, change.siblingAf terChange); 2072 checkForSiblingStyleChanges(change.type == ElementRemoved ? SiblingEleme ntRemoved : SiblingElementInserted, change.siblingBeforeChange, change.siblingAf terChange);
2071 2073
2072 if (ElementShadow* shadow = this->shadow()) 2074 if (ElementShadow* shadow = this->shadow()) {
2073 shadow->setNeedsDistributionRecalc(); 2075 shadow->setNeedsDistributionRecalc();
2076 if (document().shadowCascadeOrder() == ShadowCascadeOrder::ShadowCascade V1) {
2077 if ((isShadowHost(*this) && shadowRoot()->isV1()) || isHTMLSlotEleme nt(*this))
2078 document().updateAssignment();
2079 }
2080 }
2074 } 2081 }
2075 2082
2076 void Element::finishParsingChildren() 2083 void Element::finishParsingChildren()
2077 { 2084 {
2078 setIsFinishedParsingChildren(true); 2085 setIsFinishedParsingChildren(true);
2079 checkForEmptyStyleChange(); 2086 checkForEmptyStyleChange();
2080 checkForSiblingStyleChanges(FinishedParsingChildren, lastChild(), nullptr); 2087 checkForSiblingStyleChanges(FinishedParsingChildren, lastChild(), nullptr);
2081 } 2088 }
2082 2089
2083 #ifndef NDEBUG 2090 #ifndef NDEBUG
(...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after
3674 3681
3675 DEFINE_TRACE(Element) 3682 DEFINE_TRACE(Element)
3676 { 3683 {
3677 if (hasRareData()) 3684 if (hasRareData())
3678 visitor->trace(elementRareData()); 3685 visitor->trace(elementRareData());
3679 visitor->trace(m_elementData); 3686 visitor->trace(m_elementData);
3680 ContainerNode::trace(visitor); 3687 ContainerNode::trace(visitor);
3681 } 3688 }
3682 3689
3683 } // namespace blink 3690 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698