WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
138529
Call faster HTMLElement::hasTagName() in HTMLCollection
https://bugs.webkit.org/show_bug.cgi?id=138529
Summary
Call faster HTMLElement::hasTagName() in HTMLCollection
Chris Dumez
Reported
2014-11-07 17:31:29 PST
Call faster HTMLElement::hasTagName() in HTMLCollection instead of slower Node::hasTagName().
Attachments
Patch
(3.52 KB, patch)
2014-11-08 10:05 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(3.39 KB, patch)
2014-11-08 20:52 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(3.54 KB, patch)
2014-11-08 21:13 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2014-11-08 10:05:51 PST
Created
attachment 241230
[details]
Patch
Darin Adler
Comment 2
2014-11-08 13:49:18 PST
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"?
Chris Dumez
Comment 3
2014-11-08 17:19:06 PST
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.
Chris Dumez
Comment 4
2014-11-08 20:52:28 PST
Created
attachment 241246
[details]
Patch
Chris Dumez
Comment 5
2014-11-08 21:13:25 PST
Created
attachment 241248
[details]
Patch
WebKit Commit Bot
Comment 6
2014-11-08 21:59:55 PST
Comment on
attachment 241248
[details]
Patch Clearing flags on attachment: 241248 Committed
r175788
: <
http://trac.webkit.org/changeset/175788
>
WebKit Commit Bot
Comment 7
2014-11-08 21:59:59 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug