Minor tweaks to HTMLCollection
Created attachment 241278 [details] Patch
Comment on attachment 241278 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241278&action=review nice, r=me > Source/WebCore/html/HTMLCollection.cpp:451 > for (unsigned i = 0; i < size; i++) { nit: ++i > Source/WebCore/html/HTMLFormControlsCollection.cpp:124 > +Element* HTMLFormControlsCollection::namedItem(const AtomicString& name) const This could probably return an HTMLElement* even. > Source/WebCore/html/HTMLFormControlsCollection.h:44 > + virtual Element* namedItem(const AtomicString& name) const override; Could likely return an HTMLElement* even. > Source/WebCore/html/HTMLSelectElement.h:90 > + Element* namedItem(const AtomicString& name); Could likely return a HTMLOptionElement* > Source/WebCore/html/HTMLSelectElement.h:91 > + Element* item(unsigned index); Ditto. > Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp:42 > + for (Element* child = parent.firstElementChild(); child; child = child->nextElementSibling()) { for (auto& child : childrenOfType<Element>(parent)) { ?
Committed r175947: <http://trac.webkit.org/changeset/175947>
Seems to have caused assertions in debug builds: https://build.webkit.org/results/Apple%20Mavericks%20Debug%20WK1%20(Tests)/r175947%20(8835)/results.html I am looking now.
Comment on attachment 241278 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241278&action=review > Source/WebCore/html/HTMLCollection.cpp:335 > + for (traversedCount = 0; element && traversedCount < count; ++traversedCount) I think the issue is that traversedCount gets incremented 1 time less than it used to be, in the case where it hits the end of the list (element is null).
Comment on attachment 241278 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241278&action=review >> Source/WebCore/html/HTMLCollection.cpp:335 >> + for (traversedCount = 0; element && traversedCount < count; ++traversedCount) > > I think the issue is that traversedCount gets incremented 1 time less than it used to be, in the case where it hits the end of the list (element is null). Sorry, I meant it gets incremented 1 time more (not less) than before when element is null.