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

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

Issue 14846002: Implement the Custom Elements :unresolved pseudoclass (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adds a test and fixes style sharing. Created 7 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 | Annotate | Revision Log
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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 206 }
207 #endif 207 #endif
208 208
209 if (hasRareData()) { 209 if (hasRareData()) {
210 ElementRareData* data = elementRareData(); 210 ElementRareData* data = elementRareData();
211 data->setPseudoElement(BEFORE, 0); 211 data->setPseudoElement(BEFORE, 0);
212 data->setPseudoElement(AFTER, 0); 212 data->setPseudoElement(AFTER, 0);
213 data->clearShadow(); 213 data->clearShadow();
214 } 214 }
215 215
216 if (isCustomElement() && document() && document()->registry()) {
217 document()->registry()->customElementWasDestroyed(this);
218 }
219
216 if (hasSyntheticAttrChildNodes()) 220 if (hasSyntheticAttrChildNodes())
217 detachAllAttrNodesFromElement(); 221 detachAllAttrNodesFromElement();
218 222
219 #if ENABLE(SVG) 223 #if ENABLE(SVG)
220 if (hasPendingResources()) { 224 if (hasPendingResources()) {
221 document()->accessSVGExtensions()->removeElementFromPendingResources(thi s); 225 document()->accessSVGExtensions()->removeElementFromPendingResources(thi s);
222 ASSERT(!hasPendingResources()); 226 ASSERT(!hasPendingResources());
223 } 227 }
224 #endif 228 #endif
225 } 229 }
(...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after
2195 void Element::setIsInCanvasSubtree(bool isInCanvasSubtree) 2199 void Element::setIsInCanvasSubtree(bool isInCanvasSubtree)
2196 { 2200 {
2197 ensureElementRareData()->setIsInCanvasSubtree(isInCanvasSubtree); 2201 ensureElementRareData()->setIsInCanvasSubtree(isInCanvasSubtree);
2198 } 2202 }
2199 2203
2200 bool Element::isInCanvasSubtree() const 2204 bool Element::isInCanvasSubtree() const
2201 { 2205 {
2202 return hasRareData() && elementRareData()->isInCanvasSubtree(); 2206 return hasRareData() && elementRareData()->isInCanvasSubtree();
2203 } 2207 }
2204 2208
2209 bool Element::isUnresolvedCustomElement()
2210 {
2211 return isCustomElement() && document()->registry()->isUnresolved(this);
2212 }
2213
2205 AtomicString Element::computeInheritedLanguage() const 2214 AtomicString Element::computeInheritedLanguage() const
2206 { 2215 {
2207 const Node* n = this; 2216 const Node* n = this;
2208 AtomicString value; 2217 AtomicString value;
2209 // The language property is inherited, so we iterate over the parents to fin d the first language. 2218 // The language property is inherited, so we iterate over the parents to fin d the first language.
2210 do { 2219 do {
2211 if (n->isElementNode()) { 2220 if (n->isElementNode()) {
2212 if (const ElementData* elementData = toElement(n)->elementData()) { 2221 if (const ElementData* elementData = toElement(n)->elementData()) {
2213 // Spec: xml:lang takes precedence -- http://www.w3.org/TR/xhtml 1/#C_7 2222 // Spec: xml:lang takes precedence -- http://www.w3.org/TR/xhtml 1/#C_7
2214 if (const Attribute* attribute = elementData->getAttributeItem(X MLNames::langAttr)) 2223 if (const Attribute* attribute = elementData->getAttributeItem(X MLNames::langAttr))
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
3113 return 0; 3122 return 0;
3114 } 3123 }
3115 3124
3116 Attribute* UniqueElementData::attributeItem(unsigned index) 3125 Attribute* UniqueElementData::attributeItem(unsigned index)
3117 { 3126 {
3118 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3127 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3119 return &m_attributeVector.at(index); 3128 return &m_attributeVector.at(index);
3120 } 3129 }
3121 3130
3122 } // namespace WebCore 3131 } // namespace WebCore
OLDNEW
« Source/core/dom/CustomElementRegistry.h ('K') | « Source/core/dom/Element.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698