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

Side by Side Diff: sky/engine/core/dom/Element.h

Issue 942933003: Remove almost all clients of isHTMLElement (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/engine/core/dom/Document.cpp ('k') | sky/engine/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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 PassRefPtr<ClientRect> getBoundingClientRect(); 128 PassRefPtr<ClientRect> getBoundingClientRect();
129 129
130 virtual void didMoveToNewDocument(Document&) override; 130 virtual void didMoveToNewDocument(Document&) override;
131 131
132 CSSStyleDeclaration* style(); 132 CSSStyleDeclaration* style();
133 133
134 const QualifiedName& tagQName() const { return m_tagName; } 134 const QualifiedName& tagQName() const { return m_tagName; }
135 String tagName() const { return nodeName(); } 135 String tagName() const { return nodeName(); }
136 136
137 bool hasTagName(const QualifiedName& tagName) const { return m_tagName == ta gName; } 137 bool hasTagName(const QualifiedName& tagName) const { return m_tagName == ta gName; }
138 bool hasTagName(const HTMLQualifiedName& name) const { return hasLocalName(n ame.localName()); }
139 138
140 // A fast function for checking the local name against another atomic string . 139 // A fast function for checking the local name against another atomic string .
141 bool hasLocalName(const AtomicString& other) const { return m_tagName.localN ame() == other; } 140 bool hasLocalName(const AtomicString& other) const { return m_tagName.localN ame() == other; }
142 141
143 virtual const AtomicString& localName() const override final { return m_tagN ame.localName(); } 142 virtual const AtomicString& localName() const override final { return m_tagN ame.localName(); }
144 143
145 virtual String nodeName() const override; 144 virtual String nodeName() const override;
146 145
147 PassRefPtr<Element> cloneElementWithChildren(); 146 PassRefPtr<Element> cloneElementWithChildren();
148 PassRefPtr<Element> cloneElementWithoutChildren(); 147 PassRefPtr<Element> cloneElementWithoutChildren();
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 clearFlag(IsInShadowTreeFlag); 513 clearFlag(IsInShadowTreeFlag);
515 } 514 }
516 515
517 inline ShadowRoot* Node::shadowRoot() const 516 inline ShadowRoot* Node::shadowRoot() const
518 { 517 {
519 if (!isElementNode()) 518 if (!isElementNode())
520 return 0; 519 return 0;
521 return toElement(this)->shadowRoot(); 520 return toElement(this)->shadowRoot();
522 } 521 }
523 522
524 inline bool Node::hasTagName(const HTMLQualifiedName& name) const
525 {
526 return isHTMLElement() && toElement(*this).hasTagName(name);
527 }
528
529 inline void Element::invalidateStyleAttribute() 523 inline void Element::invalidateStyleAttribute()
530 { 524 {
531 ASSERT(elementData()); 525 ASSERT(elementData());
532 elementData()->m_styleAttributeIsDirty = true; 526 elementData()->m_styleAttributeIsDirty = true;
533 } 527 }
534 528
535 inline bool isShadowHost(const Node* node) 529 inline bool isShadowHost(const Node* node)
536 { 530 {
537 return node && node->isElementNode() && toElement(node)->shadow(); 531 return node && node->isElementNode() && toElement(node)->shadow();
538 } 532 }
(...skipping 25 matching lines...) Expand all
564 static PassRefPtr<T> create(const QualifiedName&, Document&) 558 static PassRefPtr<T> create(const QualifiedName&, Document&)
565 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ 559 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \
566 PassRefPtr<T> T::create(const QualifiedName& tagName, Document& document) \ 560 PassRefPtr<T> T::create(const QualifiedName& tagName, Document& document) \
567 { \ 561 { \
568 return adoptRef(new T(tagName, document)); \ 562 return adoptRef(new T(tagName, document)); \
569 } 563 }
570 564
571 } // namespace 565 } // namespace
572 566
573 #endif // SKY_ENGINE_CORE_DOM_ELEMENT_H_ 567 #endif // SKY_ENGINE_CORE_DOM_ELEMENT_H_
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Document.cpp ('k') | sky/engine/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698