RESOLVED FIXED 154003
Implement ComposedTreeIterator in terms of ElementAndTextDescendantIterator
https://bugs.webkit.org/show_bug.cgi?id=154003
Summary Implement ComposedTreeIterator in terms of ElementAndTextDescendantIterator
Antti Koivisto
Reported 2016-02-08 13:14:07 PST
Make it more hackable and correct.
Attachments
patch (40.39 KB, patch)
2016-02-08 13:36 PST, Antti Koivisto
no flags
patch (35.12 KB, patch)
2016-02-08 13:39 PST, Antti Koivisto
darin: review+
buildbot: commit-queue-
Archive of layout-test-results from ews112 for mac-yosemite (927.96 KB, application/zip)
2016-02-08 14:46 PST, Build Bot
no flags
Antti Koivisto
Comment 1 2016-02-08 13:36:04 PST
Antti Koivisto
Comment 2 2016-02-08 13:39:51 PST
Build Bot
Comment 3 2016-02-08 14:46:46 PST
Comment on attachment 270878 [details] patch Attachment 270878 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/801721 New failing tests: fast/shadow-dom/event-inside-slotted-node.html fast/shadow-dom/shadow-layout-after-attach-shadow.html
Build Bot
Comment 4 2016-02-08 14:46:51 PST
Created attachment 270883 [details] Archive of layout-test-results from ews112 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews112 Port: mac-yosemite Platform: Mac OS X 10.10.5
Darin Adler
Comment 5 2016-02-08 15:06:42 PST
Comment on attachment 270878 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=270878&action=review r=me assuming you find and fix the assertion failure (or maybe just a crash) that the mac-debug bot is showing. > Source/WebCore/dom/ComposedTreeIterator.h:161 > + Iterator() > + : ComposedTreeIterator() > + { } I think you can write: Iterator() = default; Which I think is better. > Source/WebCore/dom/ComposedTreeIterator.h:162 > Iterator(ContainerNode& root) explicit? > Source/WebCore/dom/ComposedTreeIterator.h:177 > + Iterator begin() { return Iterator(m_parent); } Since the constructor is not explicit, could just write: return m_parent; > Source/WebCore/dom/ComposedTreeIterator.h:178 > + Iterator end() { return Iterator(); } I slightly prefer: return { }; > Source/WebCore/dom/ElementAndTextDescendantIterator.h:36 > +class ElementAndTextDescendantIterator { This class has a lot of code. Any way for it to share more with other classes? > Source/WebCore/dom/ElementAndTextDescendantIterator.h:38 > + ElementAndTextDescendantIterator(); I prefer = default. > Source/WebCore/dom/ElementAndTextDescendantIterator.h:39 > + ElementAndTextDescendantIterator(ContainerNode& root); explicit? > Source/WebCore/dom/ElementAndTextDescendantIterator.h:52 > + bool operator!() const { return !m_current; } I normally expect an explicit operator bool any place I see an operator! > Source/WebCore/dom/ElementAndTextDescendantIterator.h:86 > + ElementAndTextDescendantIteratorAdapter(ContainerNode& root); explicit? > Source/WebCore/dom/ElementAndTextDescendantIterator.h:99 > + : m_current(nullptr) Why not initialize this in the class definition?
Antti Koivisto
Comment 6 2016-02-08 17:16:50 PST
Antti Koivisto
Comment 7 2016-02-08 17:18:19 PST
> This class has a lot of code. Any way for it to share more with other > classes? Yes, this is very similar to ElementDescendantIterator. We could probably share code by making a template class.
Note You need to log in before you can comment on or make changes to this bug.