[Webkit-unassigned] [Bug 104685] Add Element-specific traversal functions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 11 15:00:13 PST 2012


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


Ryosuke Niwa <rniwa at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #178882|review?                     |review+
               Flag|                            |




--- Comment #2 from Ryosuke Niwa <rniwa at webkit.org>  2012-12-11 15:02:32 PST ---
(From update of attachment 178882)
View in context: https://bugs.webkit.org/attachment.cgi?id=178882&action=review

> Source/WebCore/ChangeLog:1529
> +        Another build fix.
> +
> +        * html/HTMLPropertiesCollection.cpp:
> +        (WebCore::nextNodeWithProperty):

Please revert these changes.

> Source/WebCore/dom/ContainerNodeAlgorithms.h:319
> +    Element* element = (shouldIncludeRoot == IncludeRoot && root->isElementNode()) ? static_cast<Element*>(root) : ElementTraversal::firstWithin(root);

I don't have toElement?

> Source/WebCore/dom/NodeTraversal.h:102
> +template <class NodeType>
> +inline Element* traverseNextElementTemplate(NodeType* current, const Node* stayWithin)
> +{
> +    Node* node = NodeTraversal::next(current, stayWithin);
> +    while (node && !node->isElementNode())
> +        node = NodeTraversal::nextSkippingChildren(node, stayWithin);
> +    return static_cast<Element*>(node);
> +}

I'm sad that we have to duplicate the template like this. Can we had a boolean template argument and share the code between two?

> Source/WebCore/dom/NodeTraversal.h:126
> +template <class NodeType>
> +inline Element* traverseNextElementSkippingChildrenTemplate(NodeType* current, const Node* stayWithin)
> +{
> +    Node* node = NodeTraversal::nextSkippingChildren(current, stayWithin);
> +    while (node && !node->isElementNode())
> +        node = NodeTraversal::nextSkippingChildren(node, stayWithin);
> +    return static_cast<Element*>(node);
> +}

Ditto.

-- 
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