| Summary: | Minor tweaks to HTMLCollection | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Darin Adler <darin> | ||||
| Component: | DOM | Assignee: | Darin Adler <darin> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | cdumez, rniwa | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Bug Depends on: | 138620 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
|
Description
Darin Adler
2014-11-09 22:07:57 PST
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. |