Index: Source/core/dom/TreeScope.h |
diff --git a/Source/core/dom/TreeScope.h b/Source/core/dom/TreeScope.h |
index fa7428aa8b56bf0e34d97536b3206a90cb56cb89..9e60a47973fffbd82cc8091f2244f775a32a4ce4 100644 |
--- a/Source/core/dom/TreeScope.h |
+++ b/Source/core/dom/TreeScope.h |
@@ -56,10 +56,17 @@ public: |
Element* adjustedFocusedElement(); |
Element* getElementById(const AtomicString&) const; |
- bool hasElementWithId(StringImpl* id) const; |
- bool containsMultipleElementsWithId(const AtomicString& id) const; |
- void addElementById(const AtomicString& elementId, Element*); |
- void removeElementById(const AtomicString& elementId, Element*); |
+ const Vector<Element*>* getAllElementsById(const AtomicString&) const; |
+ bool hasElementWithId(StringImpl*) const; // FIXME: The argument should have type "const AtomicString&"" rather than "StringImpl*". |
+ bool containsMultipleElementsWithId(const AtomicString&) const; |
+ void addElementById(const AtomicString&, Element*); |
+ void removeElementById(const AtomicString&, Element*); |
+ |
+ Element* getElementByName(const AtomicString&) const; |
+ bool hasElementWithName(const AtomicString&) const; |
+ bool containsMultipleElementsWithName(const AtomicString&) const; |
+ void addElementByName(const AtomicString&, Element*); |
+ void removeElementByName(const AtomicString&, Element*); |
Document* documentScope() const { return m_documentScope; } |
@@ -168,6 +175,7 @@ private: |
int m_guardRefCount; |
OwnPtr<DocumentOrderedMap> m_elementsById; |
+ OwnPtr<DocumentOrderedMap> m_elementsByName; |
OwnPtr<DocumentOrderedMap> m_imageMapsByName; |
OwnPtr<DocumentOrderedMap> m_labelsByForAttribute; |
@@ -187,6 +195,18 @@ inline bool TreeScope::containsMultipleElementsWithId(const AtomicString& id) co |
return m_elementsById && m_elementsById->containsMultiple(id.impl()); |
} |
+inline bool TreeScope::hasElementWithName(const AtomicString& id) const |
+{ |
+ ASSERT(id.impl()); |
+ return m_elementsByName && m_elementsByName->contains(id.impl()); |
+} |
+ |
+inline bool TreeScope::containsMultipleElementsWithName(const AtomicString& name) const |
+{ |
+ ASSERT(name.impl()); |
+ return m_elementsByName && m_elementsByName->containsMultiple(name.impl()); |
+} |
+ |
Node* nodeFromPoint(Document*, int x, int y, LayoutPoint* localPoint = 0); |
TreeScope* commonTreeScope(Node*, Node*); |