| Summary: | Call faster HTMLElement::hasTagName() in HTMLCollection | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||
| Component: | DOM | Assignee: | Chris Dumez <cdumez> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | commit-queue, esprehn+autocc, gyuyoung.kim, koivisto, rniwa | ||||||||
| Priority: | P2 | ||||||||||
| Version: | 528+ (Nightly build) | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Chris Dumez
2014-11-07 17:31:29 PST
Created attachment 241230 [details]
Patch
Comment on attachment 241230 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241230&action=review > Source/WebCore/html/HTMLCollection.cpp:172 > +inline bool isMatchingHTMLElement(const HTMLCollection& htmlCollection, HTMLElement& element) I would suggest renaming the argument "collection" instead of "htmlCollection". > Source/WebCore/html/HTMLCollection.cpp:209 > return static_cast<const DocumentNameCollection&>(htmlCollection).elementMatches(element); Seems like we want checked casts for these some day. > Source/WebCore/html/HTMLCollection.cpp:221 > +inline bool isMatchingElement(const HTMLCollection& htmlCollection, Element& element) I would suggest renaming the argument "collection" instead of "htmlCollection". > Source/WebCore/html/HTMLCollection.cpp:229 > + return static_cast<const WindowNameCollection&>(htmlCollection).elementMatches(element); Seems like we want checked casts for these some day. > Source/WebCore/html/HTMLCollection.cpp:235 > + // Collection types that only deal with HTMLElements. > + return is<HTMLElement>(element) && isMatchingHTMLElement(htmlCollection, downcast<HTMLElement>(element)); Why not put this code inside the default rather than using "default: break"? Comment on attachment 241230 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241230&action=review >> Source/WebCore/html/HTMLCollection.cpp:209 >> return static_cast<const DocumentNameCollection&>(htmlCollection).elementMatches(element); > > Seems like we want checked casts for these some day. Definitely, this is already on my todo list. Created attachment 241246 [details]
Patch
Created attachment 241248 [details]
Patch
Comment on attachment 241248 [details] Patch Clearing flags on attachment: 241248 Committed r175788: <http://trac.webkit.org/changeset/175788> All reviewed patches have been landed. Closing bug. |