Summary: | Cleanup HTMLFormCollection | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> | ||||
Component: | Forms | Assignee: | Ryosuke Niwa <rniwa> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | darin, kling, koivisto, menard, tkent | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 90118 | ||||||
Attachments: |
|
Description
Ryosuke Niwa
2012-06-27 16:42:55 PDT
Created attachment 149824 [details]
Cleanup
Comment on attachment 149824 [details] Cleanup View in context: https://bugs.webkit.org/attachment.cgi?id=149824&action=review > Source/WebCore/html/HTMLFormCollection.cpp:-176 > - m_cache.current = getNamedItem(idAttr, name); > - if (m_cache.current) > - return m_cache.current; > - m_cache.current = getNamedItem(nameAttr, name); > - return m_cache.current; Updating m_cache.current here made no sense. In fact, I bet you can find a test case where this introduces a bug using the Objective-C binding. e.g. collection.item(0); collection.namedItem('blah'); collection.item(0); The second call to item() returns the element with id/name 'blah'. Unfortunately, ES5 binding uses namedItems so we can't add a layout test for it. Comment on attachment 149824 [details] Cleanup View in context: https://bugs.webkit.org/attachment.cgi?id=149824&action=review > Source/WebCore/ChangeLog:8 > + Got rid of getNamedItem and enamed getNamedFormItem to firstNamedItem and got rid of duplicateNumber argument since Typo, enamed. > Source/WebCore/html/HTMLFormCollection.cpp:126 > + if (elementsArray[i]->isEnumeratable() && element->fastGetAttribute(attrName) == name) Maybe someone should rename isEnumeratable() this to isEnumerable() someday. Committed r121478: <http://trac.webkit.org/changeset/121478> (In reply to comment #4) > Committed r121478: <http://trac.webkit.org/changeset/121478> I've figured out a way to write a WebKit API test so I went ahead and landed it with it. Fixed the typo in http://trac.webkit.org/changeset/121479. |