WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
23106
HTMLFormCollection::namedItem ignores caseSensitive argument
https://bugs.webkit.org/show_bug.cgi?id=23106
Summary
HTMLFormCollection::namedItem ignores caseSensitive argument
Darin Adler
Reported
2009-01-04 10:29:08 PST
I noticed this while looking at unused variable warnings.
Attachments
patch
(24.56 KB, patch)
2009-01-05 00:12 PST
,
Darin Adler
andersca
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Darin Adler
Comment 1
2009-01-04 23:36:33 PST
It turns out this has no effect because the only collection that ever gets passed false for caseSensitive is the anchors collection. A much better way to do that would be to add a findAnchor function to Document for the two call sites that need it.
Darin Adler
Comment 2
2009-01-05 00:12:39 PST
Created
attachment 26426
[details]
patch
Anders Carlsson
Comment 3
2009-01-05 09:14:00 PST
Comment on
attachment 26426
[details]
patch r=me!
Darin Adler
Comment 4
2009-01-05 09:32:25 PST
http://trac.webkit.org/changeset/39603
Adam Roben (:aroben)
Comment 5
2009-01-05 09:39:14 PST
Comment on
attachment 26426
[details]
patch
> +Element* Document::findAnchor(const String& name) > +{ > + if (name.isEmpty()) > + return 0; > + if (Element* element = getElementById(name)) > + return element;
Couldn't this return something other than an anchor element?
Darin Adler
Comment 6
2009-01-05 09:41:41 PST
(In reply to
comment #5
)
> Couldn't this return something other than an anchor element?
Yes. This function finds an "anchor", which is the site that a "#xxx" fragment navigates to; nowadays that can be any element with an ID although historically it could only be an anchor element. If this function returned only anchor elements, I would have made its return type be HTMLAnchorElement instead of Element.
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