WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
110297
Make ComposedShadowTreeWalker's traversal member functions return the node.
https://bugs.webkit.org/show_bug.cgi?id=110297
Summary
Make ComposedShadowTreeWalker's traversal member functions return the node.
Hayato Ito
Reported
2013-02-19 21:11:11 PST
The context is here:
https://lists.webkit.org/pipermail/webkit-dev/2013-February/023918.html
The same concern could be also applied to ComposedShadowTreeWalker. IMO, omitting verb from the name of member functions might be okay in this context since it's used in the 'Walker' context. That's one of the naming choices as seen in TreeWalker's firstChild(), Java's iterataor's next() and so on. The bad part is that each member function doesn't return the node. I am feeling that it is something strange and makes readers, including me, uncomfortable. I'd like to improve APIs. The current APIs (as for firstChild()): - void firstChild(); // This has a side effect. You should call walker.node() later to get the current node. - Node* node() const; The candiates I am thinking are: A) - Node* firstChild(); // This has a side effect. - Node* node() const; B) - Node* walkToFirstChild(); // This has a side effect. - Node* node() const; C) - void walkToFirstChild(); // This has a side effect. You should call walker.node() later to get the current node. - Node* node() const; Which is the best choice? Any other one? My current plan is A, which is similar to TreeWalker.
http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#TreeWalker
Attachments
Add attachment
proposed patch, testcase, etc.
Hayato Ito
Comment 1
2013-02-19 21:20:14 PST
This wiki entry is about the usage of ComposedShadowTreeWalker.
http://trac.webkit.org/wiki/TraversingShadowDOMTree
We must update that too.
Ryosuke Niwa
Comment 2
2020-08-18 10:43:22 PDT
This code is no more.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug