#include "platform/heap/Handle.h"
#include "wtf/text/AtomicString.h"
-namespace WebCore {
+namespace blink {
class ContainerNode;
class DOMSelection;
class HTMLLabelElement;
class HTMLMapElement;
class HitTestResult;
-class LayoutPoint;
class IdTargetObserverRegistry;
+class ScopedStyleResolver;
class Node;
-class RenderObject;
// A class which inherits both Node and TreeScope must call clearRareData() in its destructor
// so that the Node destructor no longer does problematic NodeList cache manipulation in
Element* adjustedFocusedElement() const;
Element* getElementById(const AtomicString&) const;
- const Vector<Element*>& getAllElementsById(const AtomicString&) const;
- bool hasElementWithId(StringImpl* id) const;
+ const WillBeHeapVector<RawPtrWillBeMember<Element> >& getAllElementsById(const AtomicString&) const;
+ bool hasElementWithId(const AtomicString& id) const;
bool containsMultipleElementsWithId(const AtomicString& id) const;
void addElementById(const AtomicString& elementId, Element*);
void removeElementById(const AtomicString& elementId, Element*);
// Used by the basic DOM mutation methods (e.g., appendChild()).
void adoptIfNeeded(Node&);
- Node& rootNode() const { return *m_rootNode; }
+ ContainerNode& rootNode() const { return *m_rootNode; }
IdTargetObserverRegistry& idTargetObserverRegistry() const { return *m_idTargetObserverRegistry.get(); }
virtual void trace(Visitor*);
+ ScopedStyleResolver* scopedStyleResolver() const { return m_scopedStyleResolver.get(); }
+ ScopedStyleResolver& ensureScopedStyleResolver();
+ void clearScopedStyleResolver();
+
protected:
TreeScope(ContainerNode&, Document&);
TreeScope(Document&);
#if !ENABLE(OILPAN)
int refCount() const;
-#if SECURITY_ASSERT_ENABLED
+#if ENABLE(SECURITY_ASSERT)
bool deletionHasBegun();
void beginDeletion();
#else
bool rootNodeHasTreeSharedParent() const;
- RawPtrWillBeMember<Node> m_rootNode;
+ RawPtrWillBeMember<ContainerNode> m_rootNode;
RawPtrWillBeMember<Document> m_document;
RawPtrWillBeMember<TreeScope> m_parentTreeScope;
int m_guardRefCount;
#endif
- OwnPtr<DocumentOrderedMap> m_elementsById;
- OwnPtr<DocumentOrderedMap> m_imageMapsByName;
- OwnPtr<DocumentOrderedMap> m_labelsByForAttribute;
+ OwnPtrWillBeMember<DocumentOrderedMap> m_elementsById;
+ OwnPtrWillBeMember<DocumentOrderedMap> m_imageMapsByName;
+ OwnPtrWillBeMember<DocumentOrderedMap> m_labelsByForAttribute;
OwnPtrWillBeMember<IdTargetObserverRegistry> m_idTargetObserverRegistry;
+ OwnPtrWillBeMember<ScopedStyleResolver> m_scopedStyleResolver;
+
mutable RefPtrWillBeMember<DOMSelection> m_selection;
};
-inline bool TreeScope::hasElementWithId(StringImpl* id) const
+inline bool TreeScope::hasElementWithId(const AtomicString& id) const
{
- ASSERT(id);
+ ASSERT(!id.isNull());
return m_elementsById && m_elementsById->contains(id);
}
inline bool TreeScope::containsMultipleElementsWithId(const AtomicString& id) const
{
- return m_elementsById && m_elementsById->containsMultiple(id.impl());
+ return m_elementsById && m_elementsById->containsMultiple(id);
}
-inline bool operator==(const TreeScope& a, const TreeScope& b) { return &a == &b; }
-inline bool operator==(const TreeScope& a, const TreeScope* b) { return &a == b; }
-inline bool operator==(const TreeScope* a, const TreeScope& b) { return a == &b; }
-inline bool operator!=(const TreeScope& a, const TreeScope& b) { return !(a == b); }
-inline bool operator!=(const TreeScope& a, const TreeScope* b) { return !(a == b); }
-inline bool operator!=(const TreeScope* a, const TreeScope& b) { return !(a == b); }
+DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope)
HitTestResult hitTestInDocument(const Document*, int x, int y);
TreeScope* commonTreeScope(Node*, Node*);
-} // namespace WebCore
+} // namespace blink
#endif // TreeScope_h