diff options
Diffstat (limited to 'WebCore/dom/Node.h')
-rw-r--r-- | WebCore/dom/Node.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/WebCore/dom/Node.h b/WebCore/dom/Node.h index 3e5a444..17c1580 100644 --- a/WebCore/dom/Node.h +++ b/WebCore/dom/Node.h @@ -49,6 +49,7 @@ class Document; class DynamicNodeList; class Element; class Event; +class EventContext; class EventListener; class FloatPoint; class Frame; @@ -85,6 +86,11 @@ enum StyleChangeType { SyntheticStyleChange = 3 << nodeStyleChangeShift }; +enum EventDispatchBehavior { + RetargetEvent, + StayInsideShadowDOM +}; + class Node : public EventTarget, public TreeShared<ContainerNode>, public ScriptWrappable { friend class Document; public: @@ -204,16 +210,14 @@ public: Node* shadowAncestorNode(); Node* shadowTreeRootNode(); bool isInShadowTree(); - - // The node's parent for the purpose of event capture and bubbling. - virtual ContainerNode* eventParentNode(); + // Node's parent or shadow tree host. + ContainerNode* parentOrHostNode(); // Returns the enclosing event parent node (or self) that, when clicked, would trigger a navigation. Node* enclosingLinkEventParentOrSelf(); // Node ancestors when concerned about event flow. - // FIXME: Should be named getEventAncestors. - void eventAncestors(Vector<RefPtr<ContainerNode> > &ancestors); + void getEventAncestors(Vector<EventContext>& ancestors, EventTarget*, EventDispatchBehavior = RetargetEvent); bool isBlockFlow() const; bool isBlockFlowOrBlockTable() const; @@ -705,6 +709,13 @@ inline void addSubresourceURL(ListHashSet<KURL>& urls, const KURL& url) urls.add(url); } +inline ContainerNode* Node::parentOrHostNode() +{ + if (ContainerNode* parent = parentNode()) + return parent; + return shadowParentNode(); +} + } //namespace #ifndef NDEBUG |