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

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

Issue 645443003: Move parts of core/dom to C++11 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed nit Created 6 years, 2 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
« no previous file with comments | « Source/core/dom/DocumentSupplementable.h ('k') | Source/core/dom/Element.cpp » ('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 * Copyright (C) 2003-2011, 2013, 2014 Apple Inc. All rights reserved. 6 * Copyright (C) 2003-2011, 2013, 2014 Apple Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 PassRefPtrWillBeRawPtr<Attr> getAttributeNode(const AtomicString& name); 205 PassRefPtrWillBeRawPtr<Attr> getAttributeNode(const AtomicString& name);
206 PassRefPtrWillBeRawPtr<Attr> getAttributeNodeNS(const AtomicString& namespac eURI, const AtomicString& localName); 206 PassRefPtrWillBeRawPtr<Attr> getAttributeNodeNS(const AtomicString& namespac eURI, const AtomicString& localName);
207 PassRefPtrWillBeRawPtr<Attr> setAttributeNode(Attr*, ExceptionState&); 207 PassRefPtrWillBeRawPtr<Attr> setAttributeNode(Attr*, ExceptionState&);
208 PassRefPtrWillBeRawPtr<Attr> setAttributeNodeNS(Attr*, ExceptionState&); 208 PassRefPtrWillBeRawPtr<Attr> setAttributeNodeNS(Attr*, ExceptionState&);
209 PassRefPtrWillBeRawPtr<Attr> removeAttributeNode(Attr*, ExceptionState&); 209 PassRefPtrWillBeRawPtr<Attr> removeAttributeNode(Attr*, ExceptionState&);
210 210
211 PassRefPtrWillBeRawPtr<Attr> attrIfExists(const QualifiedName&); 211 PassRefPtrWillBeRawPtr<Attr> attrIfExists(const QualifiedName&);
212 PassRefPtrWillBeRawPtr<Attr> ensureAttr(const QualifiedName&); 212 PassRefPtrWillBeRawPtr<Attr> ensureAttr(const QualifiedName&);
213 213
214 WillBeHeapVector<RefPtrWillBeMember<Attr> >* attrNodeList(); 214 WillBeHeapVector<RefPtrWillBeMember<Attr>>* attrNodeList();
215 215
216 CSSStyleDeclaration* style(); 216 CSSStyleDeclaration* style();
217 217
218 const QualifiedName& tagQName() const { return m_tagName; } 218 const QualifiedName& tagQName() const { return m_tagName; }
219 String tagName() const { return nodeName(); } 219 String tagName() const { return nodeName(); }
220 220
221 bool hasTagName(const QualifiedName& tagName) const { return m_tagName.match es(tagName); } 221 bool hasTagName(const QualifiedName& tagName) const { return m_tagName.match es(tagName); }
222 bool hasTagName(const HTMLQualifiedName& tagName) const { return ContainerNo de::hasTagName(tagName); } 222 bool hasTagName(const HTMLQualifiedName& tagName) const { return ContainerNo de::hasTagName(tagName); }
223 bool hasTagName(const SVGQualifiedName& tagName) const { return ContainerNod e::hasTagName(tagName); } 223 bool hasTagName(const SVGQualifiedName& tagName) const { return ContainerNod e::hasTagName(tagName); }
224 224
(...skipping 15 matching lines...) Expand all
240 240
241 PassRefPtrWillBeRawPtr<Element> cloneElementWithChildren(); 241 PassRefPtrWillBeRawPtr<Element> cloneElementWithChildren();
242 PassRefPtrWillBeRawPtr<Element> cloneElementWithoutChildren(); 242 PassRefPtrWillBeRawPtr<Element> cloneElementWithoutChildren();
243 243
244 void scheduleSVGFilterLayerUpdateHack(); 244 void scheduleSVGFilterLayerUpdateHack();
245 245
246 void normalizeAttributes(); 246 void normalizeAttributes();
247 247
248 void setBooleanAttribute(const QualifiedName& name, bool); 248 void setBooleanAttribute(const QualifiedName& name, bool);
249 249
250 virtual const StylePropertySet* additionalPresentationAttributeStyle() { ret urn 0; } 250 virtual const StylePropertySet* additionalPresentationAttributeStyle() { ret urn nullptr; }
251 void invalidateStyleAttribute(); 251 void invalidateStyleAttribute();
252 252
253 const StylePropertySet* inlineStyle() const { return elementData() ? element Data()->m_inlineStyle.get() : 0; } 253 const StylePropertySet* inlineStyle() const { return elementData() ? element Data()->m_inlineStyle.get() : nullptr; }
254 254
255 bool setInlineStyleProperty(CSSPropertyID, CSSValueID identifier, bool impor tant = false); 255 bool setInlineStyleProperty(CSSPropertyID, CSSValueID identifier, bool impor tant = false);
256 bool setInlineStyleProperty(CSSPropertyID, double value, CSSPrimitiveValue:: UnitType, bool important = false); 256 bool setInlineStyleProperty(CSSPropertyID, double value, CSSPrimitiveValue:: UnitType, bool important = false);
257 bool setInlineStyleProperty(CSSPropertyID, const String& value, bool importa nt = false); 257 bool setInlineStyleProperty(CSSPropertyID, const String& value, bool importa nt = false);
258 bool removeInlineStyleProperty(CSSPropertyID); 258 bool removeInlineStyleProperty(CSSPropertyID);
259 void removeAllInlineStyleProperties(); 259 void removeAllInlineStyleProperties();
260 260
261 void synchronizeStyleAttributeInternal() const; 261 void synchronizeStyleAttributeInternal() const;
262 262
263 const StylePropertySet* presentationAttributeStyle(); 263 const StylePropertySet* presentationAttributeStyle();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 void cloneDataFromElement(const Element&); 295 void cloneDataFromElement(const Element&);
296 296
297 bool hasEquivalentAttributes(const Element* other) const; 297 bool hasEquivalentAttributes(const Element* other) const;
298 298
299 virtual void copyNonAttributePropertiesFromElement(const Element&) { } 299 virtual void copyNonAttributePropertiesFromElement(const Element&) { }
300 300
301 virtual void attach(const AttachContext& = AttachContext()) override; 301 virtual void attach(const AttachContext& = AttachContext()) override;
302 virtual void detach(const AttachContext& = AttachContext()) override; 302 virtual void detach(const AttachContext& = AttachContext()) override;
303 virtual RenderObject* createRenderer(RenderStyle*); 303 virtual RenderObject* createRenderer(RenderStyle*);
304 virtual bool rendererIsNeeded(const RenderStyle&); 304 virtual bool rendererIsNeeded(const RenderStyle&);
305 void recalcStyle(StyleRecalcChange, Text* nextTextSibling = 0); 305 void recalcStyle(StyleRecalcChange, Text* nextTextSibling = nullptr);
306 void pseudoStateChanged(CSSSelector::PseudoType); 306 void pseudoStateChanged(CSSSelector::PseudoType);
307 void setAnimationStyleChange(bool); 307 void setAnimationStyleChange(bool);
308 void setNeedsAnimationStyleRecalc(); 308 void setNeedsAnimationStyleRecalc();
309 309
310 void setNeedsCompositingUpdate(); 310 void setNeedsCompositingUpdate();
311 311
312 bool supportsStyleSharing() const; 312 bool supportsStyleSharing() const;
313 313
314 ElementShadow* shadow() const; 314 ElementShadow* shadow() const;
315 ElementShadow& ensureShadow(); 315 ElementShadow& ensureShadow();
(...skipping 28 matching lines...) Expand all
344 virtual bool isURLAttribute(const Attribute&) const { return false; } 344 virtual bool isURLAttribute(const Attribute&) const { return false; }
345 virtual bool isHTMLContentAttribute(const Attribute&) const { return false; } 345 virtual bool isHTMLContentAttribute(const Attribute&) const { return false; }
346 346
347 virtual bool isLiveLink() const { return false; } 347 virtual bool isLiveLink() const { return false; }
348 KURL hrefURL() const; 348 KURL hrefURL() const;
349 349
350 KURL getURLAttribute(const QualifiedName&) const; 350 KURL getURLAttribute(const QualifiedName&) const;
351 KURL getNonEmptyURLAttribute(const QualifiedName&) const; 351 KURL getNonEmptyURLAttribute(const QualifiedName&) const;
352 352
353 virtual const AtomicString imageSourceURL() const; 353 virtual const AtomicString imageSourceURL() const;
354 virtual Image* imageContents() { return 0; } 354 virtual Image* imageContents() { return nullptr; }
355 355
356 virtual void focus(bool restorePreviousSelection = true, FocusType = FocusTy peNone); 356 virtual void focus(bool restorePreviousSelection = true, FocusType = FocusTy peNone);
357 virtual void updateFocusAppearance(bool restorePreviousSelection); 357 virtual void updateFocusAppearance(bool restorePreviousSelection);
358 virtual void blur(); 358 virtual void blur();
359 // Whether this element can receive focus at all. Most elements are not 359 // Whether this element can receive focus at all. Most elements are not
360 // focusable but some elements, such as form controls and links, are. Unlike 360 // focusable but some elements, such as form controls and links, are. Unlike
361 // rendererIsFocusable(), this method may be called when layout is not up to 361 // rendererIsFocusable(), this method may be called when layout is not up to
362 // date, so it must not use the renderer to determine focusability. 362 // date, so it must not use the renderer to determine focusability.
363 virtual bool supportsFocus() const; 363 virtual bool supportsFocus() const;
364 // Whether the node can actually be focused. 364 // Whether the node can actually be focused.
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 void updateNamedItemRegistration(const AtomicString& oldName, const AtomicSt ring& newName); 615 void updateNamedItemRegistration(const AtomicString& oldName, const AtomicSt ring& newName);
616 void updateExtraNamedItemRegistration(const AtomicString& oldName, const Ato micString& newName); 616 void updateExtraNamedItemRegistration(const AtomicString& oldName, const Ato micString& newName);
617 617
618 void createUniqueElementData(); 618 void createUniqueElementData();
619 619
620 bool shouldInvalidateDistributionWhenAttributeChanged(ElementShadow*, const QualifiedName&, const AtomicString&); 620 bool shouldInvalidateDistributionWhenAttributeChanged(ElementShadow*, const QualifiedName&, const AtomicString&);
621 621
622 ElementRareData* elementRareData() const; 622 ElementRareData* elementRareData() const;
623 ElementRareData& ensureElementRareData(); 623 ElementRareData& ensureElementRareData();
624 624
625 WillBeHeapVector<RefPtrWillBeMember<Attr> >& ensureAttrNodeList(); 625 WillBeHeapVector<RefPtrWillBeMember<Attr>>& ensureAttrNodeList();
626 void removeAttrNodeList(); 626 void removeAttrNodeList();
627 void detachAllAttrNodesFromElement(); 627 void detachAllAttrNodesFromElement();
628 void detachAttrNodeFromElementWithValue(Attr*, const AtomicString& value); 628 void detachAttrNodeFromElementWithValue(Attr*, const AtomicString& value);
629 void detachAttrNodeAtIndex(Attr*, size_t index); 629 void detachAttrNodeAtIndex(Attr*, size_t index);
630 630
631 bool isJavaScriptURLAttribute(const Attribute&) const; 631 bool isJavaScriptURLAttribute(const Attribute&) const;
632 632
633 v8::Handle<v8::Object> wrapCustomElement(v8::Handle<v8::Object> creationCont ext, v8::Isolate*); 633 v8::Handle<v8::Object> wrapCustomElement(v8::Handle<v8::Object> creationCont ext, v8::Isolate*);
634 634
635 RefPtrWillBeMember<ElementData> m_elementData; 635 RefPtrWillBeMember<ElementData> m_elementData;
(...skipping 29 matching lines...) Expand all
665 template<typename T, typename U> inline T* toElement(const RefPtr<U>& node) { re turn toElement<T>(node.get()); } 665 template<typename T, typename U> inline T* toElement(const RefPtr<U>& node) { re turn toElement<T>(node.get()); }
666 666
667 inline bool isDisabledFormControl(const Node* node) 667 inline bool isDisabledFormControl(const Node* node)
668 { 668 {
669 return node->isElementNode() && toElement(node)->isDisabledFormControl(); 669 return node->isElementNode() && toElement(node)->isDisabledFormControl();
670 } 670 }
671 671
672 inline Element* Node::parentElement() const 672 inline Element* Node::parentElement() const
673 { 673 {
674 ContainerNode* parent = parentNode(); 674 ContainerNode* parent = parentNode();
675 return parent && parent->isElementNode() ? toElement(parent) : 0; 675 return parent && parent->isElementNode() ? toElement(parent) : nullptr;
676 } 676 }
677 677
678 inline bool Element::fastHasAttribute(const QualifiedName& name) const 678 inline bool Element::fastHasAttribute(const QualifiedName& name) const
679 { 679 {
680 ASSERT(fastAttributeLookupAllowed(name)); 680 ASSERT(fastAttributeLookupAllowed(name));
681 return elementData() && elementData()->attributes().findIndex(name) != kNotF ound; 681 return elementData() && elementData()->attributes().findIndex(name) != kNotF ound;
682 } 682 }
683 683
684 inline const AtomicString& Element::fastGetAttribute(const QualifiedName& name) const 684 inline const AtomicString& Element::fastGetAttribute(const QualifiedName& name) const
685 { 685 {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 799
800 inline void Element::invalidateStyleAttribute() 800 inline void Element::invalidateStyleAttribute()
801 { 801 {
802 ASSERT(elementData()); 802 ASSERT(elementData());
803 elementData()->m_styleAttributeIsDirty = true; 803 elementData()->m_styleAttributeIsDirty = true;
804 } 804 }
805 805
806 inline const StylePropertySet* Element::presentationAttributeStyle() 806 inline const StylePropertySet* Element::presentationAttributeStyle()
807 { 807 {
808 if (!elementData()) 808 if (!elementData())
809 return 0; 809 return nullptr;
810 if (elementData()->m_presentationAttributeStyleIsDirty) 810 if (elementData()->m_presentationAttributeStyleIsDirty)
811 updatePresentationAttributeStyle(); 811 updatePresentationAttributeStyle();
812 // Need to call elementData() again since updatePresentationAttributeStyle() 812 // Need to call elementData() again since updatePresentationAttributeStyle()
813 // might swap it with a UniqueElementData. 813 // might swap it with a UniqueElementData.
814 return elementData()->presentationAttributeStyle(); 814 return elementData()->presentationAttributeStyle();
815 } 815 }
816 816
817 inline void Element::setTagNameForCreateElementNS(const QualifiedName& tagName) 817 inline void Element::setTagNameForCreateElementNS(const QualifiedName& tagName)
818 { 818 {
819 // We expect this method to be called only to reset the prefix. 819 // We expect this method to be called only to reset the prefix.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 static PassRefPtrWillBeRawPtr<T> create(const QualifiedName&, Document&) 854 static PassRefPtrWillBeRawPtr<T> create(const QualifiedName&, Document&)
855 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ 855 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \
856 PassRefPtrWillBeRawPtr<T> T::create(const QualifiedName& tagName, Document& document) \ 856 PassRefPtrWillBeRawPtr<T> T::create(const QualifiedName& tagName, Document& document) \
857 { \ 857 { \
858 return adoptRefWillBeNoop(new T(tagName, document)); \ 858 return adoptRefWillBeNoop(new T(tagName, document)); \
859 } 859 }
860 860
861 } // namespace 861 } // namespace
862 862
863 #endif // Element_h 863 #endif // Element_h
OLDNEW
« no previous file with comments | « Source/core/dom/DocumentSupplementable.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698