[Webkit-unassigned] [Bug 85844] Inline Node::traverseNextNode

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 7 17:06:57 PDT 2012


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





--- Comment #6 from Ryosuke Niwa <rniwa at webkit.org>  2012-05-07 17:06:57 PST ---
(In reply to comment #5)
> (In reply to comment #2)
> 
> > > Source/WebCore/dom/Node.h:869
> > > +inline Node* Node::traverseNextNode(const Node* stayWithin) const
> > 
> > Should we use template to share the code?
> 
> I wrote a template version and it was uglier and more confusing. As I mention in the changelog the function is simple.

Okay.

> > > Source/WebCore/dom/Node.h:878
> > > +    while (n && !n->nextSibling() && (!stayWithin || n->parentNodeAsNode() != stayWithin))
> > 
> > It appears to me that we should call traverseNextNode() when stayWithin is 0.
> 
> Yeah but that is an interface change and better done separately. We don't know what relies on ability to pass null. We should ASSERT(stayWithin).

What I meant is that you could just call traverseNextNode() in that case. Oh well, I guess compilers are smart enough to move the condition out of the loop?

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