Bug 136902 - Have LiveNodeLists / HTMLCollections's elementMatches() take a reference
Summary: Have LiveNodeLists / HTMLCollections's elementMatches() take a reference
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-17 18:00 PDT by Chris Dumez
Modified: 2014-09-18 10:19 PDT (History)
4 users (show)

See Also:


Attachments
Patch (25.85 KB, patch)
2014-09-17 18:10 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2014-09-17 18:00:33 PDT
Have LiveNodeLists / HTMLCollections's elementMatches() take a const reference instead of a pointer. The Element argument can never be null.
Comment 1 Chris Dumez 2014-09-17 18:10:07 PDT
Created attachment 238276 [details]
Patch
Comment 2 Darin Adler 2014-09-18 09:28:13 PDT
Comment on attachment 238276 [details]
Patch

Seems fine. The choice of when to use const and when not to seems a little random, but everything in the patch seems to make things better, not worse.
Comment 3 WebKit Commit Bot 2014-09-18 09:32:50 PDT
Comment on attachment 238276 [details]
Patch

Clearing flags on attachment: 238276

Committed r173723: <http://trac.webkit.org/changeset/173723>
Comment 4 WebKit Commit Bot 2014-09-18 09:32:54 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Chris Dumez 2014-09-18 10:19:33 PDT
(In reply to comment #2)
> (From update of attachment 238276 [details])
> Seems fine. The choice of when to use const and when not to seems a little random, but everything in the patch seems to make things better, not worse.

I made the argument const when possible, that is, everywhere except for the virtual elementMatches() because some of the implementation calls non-const getters on the Element.