[Webkit-unassigned] [Bug 94107] Refactoring: move EventHandler::targetNode into HitTestResult

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 15 08:56:16 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=94107





--- Comment #3 from Adam Barth <abarth at webkit.org>  2012-08-15 08:56:48 PST ---
(From update of attachment 158566)
View in context: https://bugs.webkit.org/attachment.cgi?id=158566&action=review

> Source/WebCore/rendering/HitTestResult.cpp:808
> +    Node* node = innerNode();
> +    if (!node)
> +        return 0;
> +    if (node->inDocument())
> +        return node;
> +
> +    Element* element = node->parentElement();
> +    if (element && element->inDocument())
> +        return element;

I'm trying to understanding how this is different from innerNode.  In the context of an event, it makes sense to speak about the targetNode of an event, but outside the context of an event the word "target" doesn't mean that much.

Specifically, how can a node not be inDocument but its parentElement be inDocument?

> Source/WebCore/rendering/HitTestResult.h:180
> +    Node* targetNode() const;

I would move this function next to innerNode() so that it's clear that there is a choice between the two.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list