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

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

Issue 1914923002: Rename all existing custom element classes as V0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CustomElementV0 -> V0CustomElement Created 4 years, 7 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 #include "core/dom/NamedNodeMap.h" 66 #include "core/dom/NamedNodeMap.h"
67 #include "core/dom/NodeComputedStyle.h" 67 #include "core/dom/NodeComputedStyle.h"
68 #include "core/dom/NodeIntersectionObserverData.h" 68 #include "core/dom/NodeIntersectionObserverData.h"
69 #include "core/dom/PresentationAttributeStyle.h" 69 #include "core/dom/PresentationAttributeStyle.h"
70 #include "core/dom/PseudoElement.h" 70 #include "core/dom/PseudoElement.h"
71 #include "core/dom/ScriptableDocumentParser.h" 71 #include "core/dom/ScriptableDocumentParser.h"
72 #include "core/dom/SelectorQuery.h" 72 #include "core/dom/SelectorQuery.h"
73 #include "core/dom/StyleChangeReason.h" 73 #include "core/dom/StyleChangeReason.h"
74 #include "core/dom/StyleEngine.h" 74 #include "core/dom/StyleEngine.h"
75 #include "core/dom/Text.h" 75 #include "core/dom/Text.h"
76 #include "core/dom/custom/CustomElement.h" 76 #include "core/dom/custom/V0CustomElement.h"
77 #include "core/dom/custom/CustomElementRegistrationContext.h" 77 #include "core/dom/custom/V0CustomElementRegistrationContext.h"
78 #include "core/dom/shadow/InsertionPoint.h" 78 #include "core/dom/shadow/InsertionPoint.h"
79 #include "core/dom/shadow/ShadowRoot.h" 79 #include "core/dom/shadow/ShadowRoot.h"
80 #include "core/dom/shadow/ShadowRootInit.h" 80 #include "core/dom/shadow/ShadowRootInit.h"
81 #include "core/editing/EditingUtilities.h" 81 #include "core/editing/EditingUtilities.h"
82 #include "core/editing/FrameSelection.h" 82 #include "core/editing/FrameSelection.h"
83 #include "core/editing/iterators/TextIterator.h" 83 #include "core/editing/iterators/TextIterator.h"
84 #include "core/editing/serializers/Serialization.h" 84 #include "core/editing/serializers/Serialization.h"
85 #include "core/events/EventDispatcher.h" 85 #include "core/events/EventDispatcher.h"
86 #include "core/events/FocusEvent.h" 86 #include "core/events/FocusEvent.h"
87 #include "core/frame/FrameHost.h" 87 #include "core/frame/FrameHost.h"
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 } 1185 }
1186 1186
1187 const QualifiedName& Element::subResourceAttributeName() const 1187 const QualifiedName& Element::subResourceAttributeName() const
1188 { 1188 {
1189 return QualifiedName::null(); 1189 return QualifiedName::null();
1190 } 1190 }
1191 1191
1192 inline void Element::attributeChangedFromParserOrByCloning(const QualifiedName& name, const AtomicString& newValue, AttributeModificationReason reason) 1192 inline void Element::attributeChangedFromParserOrByCloning(const QualifiedName& name, const AtomicString& newValue, AttributeModificationReason reason)
1193 { 1193 {
1194 if (name == isAttr) 1194 if (name == isAttr)
1195 CustomElementRegistrationContext::setTypeExtension(this, newValue); 1195 V0CustomElementRegistrationContext::setTypeExtension(this, newValue);
1196 attributeChanged(name, nullAtom, newValue, reason); 1196 attributeChanged(name, nullAtom, newValue, reason);
1197 } 1197 }
1198 1198
1199 template <typename CharacterType> 1199 template <typename CharacterType>
1200 static inline ClassStringContent classStringHasClassName(const CharacterType* ch aracters, unsigned length) 1200 static inline ClassStringContent classStringHasClassName(const CharacterType* ch aracters, unsigned length)
1201 { 1201 {
1202 DCHECK_GT(length, 0u); 1202 DCHECK_GT(length, 0u);
1203 1203
1204 unsigned i = 0; 1204 unsigned i = 0;
1205 do { 1205 do {
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 return InsertionDone; 1407 return InsertionDone;
1408 1408
1409 if (hasRareData()) { 1409 if (hasRareData()) {
1410 ElementRareData* rareData = elementRareData(); 1410 ElementRareData* rareData = elementRareData();
1411 rareData->clearClassListValueForQuirksMode(); 1411 rareData->clearClassListValueForQuirksMode();
1412 if (rareData->intersectionObserverData()) 1412 if (rareData->intersectionObserverData())
1413 rareData->intersectionObserverData()->activateValidIntersectionObser vers(*this); 1413 rareData->intersectionObserverData()->activateValidIntersectionObser vers(*this);
1414 } 1414 }
1415 1415
1416 if (isUpgradedCustomElement() && inShadowIncludingDocument()) 1416 if (isUpgradedCustomElement() && inShadowIncludingDocument())
1417 CustomElement::didAttach(this, document()); 1417 V0CustomElement::didAttach(this, document());
1418 1418
1419 TreeScope& scope = insertionPoint->treeScope(); 1419 TreeScope& scope = insertionPoint->treeScope();
1420 if (scope != treeScope()) 1420 if (scope != treeScope())
1421 return InsertionDone; 1421 return InsertionDone;
1422 1422
1423 const AtomicString& idValue = getIdAttribute(); 1423 const AtomicString& idValue = getIdAttribute();
1424 if (!idValue.isNull()) 1424 if (!idValue.isNull())
1425 updateId(scope, nullAtom, idValue); 1425 updateId(scope, nullAtom, idValue);
1426 1426
1427 const AtomicString& nameValue = getNameAttribute(); 1427 const AtomicString& nameValue = getNameAttribute();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 1468
1469 ContainerNode::removedFrom(insertionPoint); 1469 ContainerNode::removedFrom(insertionPoint);
1470 if (wasInDocument) { 1470 if (wasInDocument) {
1471 if (this == document().cssTarget()) 1471 if (this == document().cssTarget())
1472 document().setCSSTarget(nullptr); 1472 document().setCSSTarget(nullptr);
1473 1473
1474 if (hasPendingResources()) 1474 if (hasPendingResources())
1475 document().accessSVGExtensions().removeElementFromPendingResources(t his); 1475 document().accessSVGExtensions().removeElementFromPendingResources(t his);
1476 1476
1477 if (isUpgradedCustomElement()) 1477 if (isUpgradedCustomElement())
1478 CustomElement::didDetach(this, insertionPoint->document()); 1478 V0CustomElement::didDetach(this, insertionPoint->document());
1479 1479
1480 if (needsStyleInvalidation()) 1480 if (needsStyleInvalidation())
1481 document().styleEngine().styleInvalidator().clearInvalidation(*this) ; 1481 document().styleEngine().styleInvalidator().clearInvalidation(*this) ;
1482 } 1482 }
1483 1483
1484 document().removeFromTopLayer(this); 1484 document().removeFromTopLayer(this);
1485 1485
1486 clearElementFlag(IsInCanvasSubtree); 1486 clearElementFlag(IsInCanvasSubtree);
1487 1487
1488 if (hasRareData()) { 1488 if (hasRareData()) {
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1867 if (!layoutObject) 1867 if (!layoutObject)
1868 return; 1868 return;
1869 if (!layoutObject->hasLayer()) 1869 if (!layoutObject->hasLayer())
1870 return; 1870 return;
1871 layoutObject->layer()->setNeedsCompositingInputsUpdate(); 1871 layoutObject->layer()->setNeedsCompositingInputsUpdate();
1872 // Changes in the return value of requiresAcceleratedCompositing change if 1872 // Changes in the return value of requiresAcceleratedCompositing change if
1873 // the PaintLayer is self-painting. 1873 // the PaintLayer is self-painting.
1874 layoutObject->layer()->updateSelfPaintingLayer(); 1874 layoutObject->layer()->updateSelfPaintingLayer();
1875 } 1875 }
1876 1876
1877 void Element::setCustomElementDefinition(CustomElementDefinition* definition) 1877 void Element::setCustomElementDefinition(V0CustomElementDefinition* definition)
1878 { 1878 {
1879 if (!hasRareData() && !definition) 1879 if (!hasRareData() && !definition)
1880 return; 1880 return;
1881 DCHECK(!customElementDefinition()); 1881 DCHECK(!customElementDefinition());
1882 ensureElementRareData().setCustomElementDefinition(definition); 1882 ensureElementRareData().setCustomElementDefinition(definition);
1883 } 1883 }
1884 1884
1885 CustomElementDefinition* Element::customElementDefinition() const 1885 V0CustomElementDefinition* Element::customElementDefinition() const
1886 { 1886 {
1887 if (hasRareData()) 1887 if (hasRareData())
1888 return elementRareData()->customElementDefinition(); 1888 return elementRareData()->customElementDefinition();
1889 return nullptr; 1889 return nullptr;
1890 } 1890 }
1891 1891
1892 ShadowRoot* Element::createShadowRoot(const ScriptState* scriptState, ExceptionS tate& exceptionState) 1892 ShadowRoot* Element::createShadowRoot(const ScriptState* scriptState, ExceptionS tate& exceptionState)
1893 { 1893 {
1894 OriginsUsingFeatures::countMainWorldOnly(scriptState, document(), OriginsUsi ngFeatures::Feature::ElementCreateShadowRoot); 1894 OriginsUsingFeatures::countMainWorldOnly(scriptState, document(), OriginsUsi ngFeatures::Feature::ElementCreateShadowRoot);
1895 if (ShadowRoot* root = shadowRoot()) { 1895 if (ShadowRoot* root = shadowRoot()) {
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
3153 3153
3154 void Element::willModifyAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& newValue) 3154 void Element::willModifyAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& newValue)
3155 { 3155 {
3156 if (name == HTMLNames::nameAttr) { 3156 if (name == HTMLNames::nameAttr) {
3157 updateName(oldValue, newValue); 3157 updateName(oldValue, newValue);
3158 } 3158 }
3159 3159
3160 if (oldValue != newValue) { 3160 if (oldValue != newValue) {
3161 document().styleEngine().attributeChangedForElement(name, *this); 3161 document().styleEngine().attributeChangedForElement(name, *this);
3162 if (isUpgradedCustomElement()) 3162 if (isUpgradedCustomElement())
3163 CustomElement::attributeDidChange(this, name.localName(), oldValue, newValue); 3163 V0CustomElement::attributeDidChange(this, name.localName(), oldValue , newValue);
3164 } 3164 }
3165 3165
3166 if (MutationObserverInterestGroup* recipients = MutationObserverInterestGrou p::createForAttributesMutation(*this, name)) 3166 if (MutationObserverInterestGroup* recipients = MutationObserverInterestGrou p::createForAttributesMutation(*this, name))
3167 recipients->enqueueMutationRecord(MutationRecord::createAttributes(this, name, oldValue)); 3167 recipients->enqueueMutationRecord(MutationRecord::createAttributes(this, name, oldValue));
3168 3168
3169 InspectorInstrumentation::willModifyDOMAttr(this, oldValue, newValue); 3169 InspectorInstrumentation::willModifyDOMAttr(this, oldValue, newValue);
3170 } 3170 }
3171 3171
3172 void Element::didAddAttribute(const QualifiedName& name, const AtomicString& val ue) 3172 void Element::didAddAttribute(const QualifiedName& name, const AtomicString& val ue)
3173 { 3173 {
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
3679 3679
3680 DEFINE_TRACE(Element) 3680 DEFINE_TRACE(Element)
3681 { 3681 {
3682 if (hasRareData()) 3682 if (hasRareData())
3683 visitor->trace(elementRareData()); 3683 visitor->trace(elementRareData());
3684 visitor->trace(m_elementData); 3684 visitor->trace(m_elementData);
3685 ContainerNode::trace(visitor); 3685 ContainerNode::trace(visitor);
3686 } 3686 }
3687 3687
3688 } // namespace blink 3688 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/ElementRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698