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 2323953003: Clarify a role of Shadow DOM related functions (Closed)
Patch Set: rebased Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/shadow/ElementShadow.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 1166
1167 static inline AtomicString makeIdForStyleResolution(const AtomicString& value, b ool inQuirksMode) 1167 static inline AtomicString makeIdForStyleResolution(const AtomicString& value, b ool inQuirksMode)
1168 { 1168 {
1169 if (inQuirksMode) 1169 if (inQuirksMode)
1170 return value.lowerASCII(); 1170 return value.lowerASCII();
1171 return value; 1171 return value;
1172 } 1172 }
1173 1173
1174 void Element::attributeChanged(const QualifiedName& name, const AtomicString& ol dValue, const AtomicString& newValue, AttributeModificationReason reason) 1174 void Element::attributeChanged(const QualifiedName& name, const AtomicString& ol dValue, const AtomicString& newValue, AttributeModificationReason reason)
1175 { 1175 {
1176 if (ElementShadow* parentElementShadow = shadowWhereNodeCanBeDistributed(*th is)) { 1176 if (ElementShadow* parentElementShadow = shadowWhereNodeCanBeDistributedForV 0(*this)) {
1177 if (shouldInvalidateDistributionWhenAttributeChanged(parentElementShadow , name, newValue)) 1177 if (shouldInvalidateDistributionWhenAttributeChanged(parentElementShadow , name, newValue))
1178 parentElementShadow->setNeedsDistributionRecalc(); 1178 parentElementShadow->setNeedsDistributionRecalc();
1179 } 1179 }
1180 if (name == HTMLNames::slotAttr && oldValue != newValue) { 1180 if (name == HTMLNames::slotAttr && oldValue != newValue) {
1181 if (ShadowRoot* root = v1ShadowRootOfParent()) 1181 if (ShadowRoot* root = v1ShadowRootOfParent())
1182 root->ensureSlotAssignment().hostChildSlotNameChanged(oldValue, newV alue); 1182 root->ensureSlotAssignment().hostChildSlotNameChanged(oldValue, newV alue);
1183 } 1183 }
1184 1184
1185 parseAttribute(name, oldValue, newValue); 1185 parseAttribute(name, oldValue, newValue);
1186 1186
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 elementData()->clearClass(); 1286 elementData()->clearClass();
1287 } 1287 }
1288 1288
1289 if (hasRareData()) 1289 if (hasRareData())
1290 elementRareData()->clearClassListValueForQuirksMode(); 1290 elementRareData()->clearClassListValueForQuirksMode();
1291 } 1291 }
1292 1292
1293 bool Element::shouldInvalidateDistributionWhenAttributeChanged(ElementShadow* el ementShadow, const QualifiedName& name, const AtomicString& newValue) 1293 bool Element::shouldInvalidateDistributionWhenAttributeChanged(ElementShadow* el ementShadow, const QualifiedName& name, const AtomicString& newValue)
1294 { 1294 {
1295 DCHECK(elementShadow); 1295 DCHECK(elementShadow);
1296 if (elementShadow->isV1())
1297 return false;
1296 const SelectRuleFeatureSet& featureSet = elementShadow->ensureSelectFeatureS et(); 1298 const SelectRuleFeatureSet& featureSet = elementShadow->ensureSelectFeatureS et();
1297 1299
1298 if (name == HTMLNames::idAttr) { 1300 if (name == HTMLNames::idAttr) {
1299 AtomicString oldId = elementData()->idForStyleResolution(); 1301 AtomicString oldId = elementData()->idForStyleResolution();
1300 AtomicString newId = makeIdForStyleResolution(newValue, document().inQui rksMode()); 1302 AtomicString newId = makeIdForStyleResolution(newValue, document().inQui rksMode());
1301 if (newId != oldId) { 1303 if (newId != oldId) {
1302 if (!oldId.isEmpty() && featureSet.hasSelectorForId(oldId)) 1304 if (!oldId.isEmpty() && featureSet.hasSelectorForId(oldId))
1303 return true; 1305 return true;
1304 if (!newId.isEmpty() && featureSet.hasSelectorForId(newId)) 1306 if (!newId.isEmpty() && featureSet.hasSelectorForId(newId))
1305 return true; 1307 return true;
(...skipping 2516 matching lines...) Expand 10 before | Expand all | Expand 10 after
3822 3824
3823 DEFINE_TRACE_WRAPPERS(Element) 3825 DEFINE_TRACE_WRAPPERS(Element)
3824 { 3826 {
3825 if (hasRareData()) { 3827 if (hasRareData()) {
3826 visitor->traceWrappers(elementRareData()); 3828 visitor->traceWrappers(elementRareData());
3827 } 3829 }
3828 ContainerNode::traceWrappers(visitor); 3830 ContainerNode::traceWrappers(visitor);
3829 } 3831 }
3830 3832
3831 } // namespace blink 3833 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/shadow/ElementShadow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698