Chromium Code Reviews| OLD | NEW |
|---|---|
| 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, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Appl e Inc. All rights reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Appl e 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 PassRefPtr<Attr> ensureAttr(const QualifiedName&); | 215 PassRefPtr<Attr> ensureAttr(const QualifiedName&); |
| 216 | 216 |
| 217 const Vector<RefPtr<Attr> >& attrNodeList(); | 217 const Vector<RefPtr<Attr> >& attrNodeList(); |
| 218 | 218 |
| 219 CSSStyleDeclaration* style(); | 219 CSSStyleDeclaration* style(); |
| 220 | 220 |
| 221 const QualifiedName& tagQName() const { return m_tagName; } | 221 const QualifiedName& tagQName() const { return m_tagName; } |
| 222 String tagName() const { return nodeName(); } | 222 String tagName() const { return nodeName(); } |
| 223 bool hasTagName(const QualifiedName& tagName) const { return m_tagName.match es(tagName); } | 223 bool hasTagName(const QualifiedName& tagName) const { return m_tagName.match es(tagName); } |
| 224 | 224 |
| 225 // Should be called only by Document::createElementNS to fix up m_tagName im mediately after construction. | |
| 226 void setTagNameForCreateElementNS(const QualifiedName&); | |
| 227 | |
| 225 // A fast function for checking the local name against another atomic string . | 228 // A fast function for checking the local name against another atomic string . |
| 226 bool hasLocalName(const AtomicString& other) const { return m_tagName.localN ame() == other; } | 229 bool hasLocalName(const AtomicString& other) const { return m_tagName.localN ame() == other; } |
| 227 bool hasLocalName(const QualifiedName& other) const { return m_tagName.local Name() == other.localName(); } | 230 bool hasLocalName(const QualifiedName& other) const { return m_tagName.local Name() == other.localName(); } |
| 228 | 231 |
| 229 virtual const AtomicString& localName() const OVERRIDE { return m_tagName.lo calName(); } | 232 virtual const AtomicString& localName() const OVERRIDE { return m_tagName.lo calName(); } |
| 230 virtual const AtomicString& prefix() const OVERRIDE { return m_tagName.prefi x(); } | 233 virtual const AtomicString& prefix() const OVERRIDE { return m_tagName.prefi x(); } |
| 231 virtual const AtomicString& namespaceURI() const OVERRIDE { return m_tagName .namespaceURI(); } | 234 virtual const AtomicString& namespaceURI() const OVERRIDE { return m_tagName .namespaceURI(); } |
| 232 | 235 |
| 233 virtual KURL baseURI() const OVERRIDE FINAL; | 236 virtual KURL baseURI() const OVERRIDE FINAL; |
| 234 | 237 |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 854 { | 857 { |
| 855 if (!elementData()) | 858 if (!elementData()) |
| 856 return 0; | 859 return 0; |
| 857 if (elementData()->m_presentationAttributeStyleIsDirty) | 860 if (elementData()->m_presentationAttributeStyleIsDirty) |
| 858 updatePresentationAttributeStyle(); | 861 updatePresentationAttributeStyle(); |
| 859 // Need to call elementData() again since updatePresentationAttributeStyle() | 862 // Need to call elementData() again since updatePresentationAttributeStyle() |
| 860 // might swap it with a UniqueElementData. | 863 // might swap it with a UniqueElementData. |
| 861 return elementData()->presentationAttributeStyle(); | 864 return elementData()->presentationAttributeStyle(); |
| 862 } | 865 } |
| 863 | 866 |
| 867 inline void Element::setTagNameForCreateElementNS(const QualifiedName& tagName) | |
|
eseidel
2013/11/11 23:31:04
We could also just call this setPrefix... :)
adamk
2013/11/11 23:33:04
I agree that the name could use improvement...but
| |
| 868 { | |
| 869 // We expect this method to be called only to reset the prefix. | |
| 870 ASSERT(tagName.localName() == m_tagName.localName()); | |
| 871 ASSERT(tagName.namespaceURI() == m_tagName.namespaceURI()); | |
| 872 m_tagName = tagName; | |
| 873 } | |
| 874 | |
| 864 inline bool isShadowHost(const Node* node) | 875 inline bool isShadowHost(const Node* node) |
| 865 { | 876 { |
| 866 return node && node->isElementNode() && toElement(node)->shadow(); | 877 return node && node->isElementNode() && toElement(node)->shadow(); |
| 867 } | 878 } |
| 868 | 879 |
| 869 inline bool isShadowHost(const Element* element) | 880 inline bool isShadowHost(const Element* element) |
| 870 { | 881 { |
| 871 return element && element->shadow(); | 882 return element && element->shadow(); |
| 872 } | 883 } |
| 873 | 884 |
| 874 } // namespace | 885 } // namespace |
| 875 | 886 |
| 876 #endif | 887 #endif |
| OLD | NEW |