WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
160060
Make parameters to Element.getElementsBy*() operations mandatory
https://bugs.webkit.org/show_bug.cgi?id=160060
Summary
Make parameters to Element.getElementsBy*() operations mandatory
Chris Dumez
Reported
2016-07-21 16:20:22 PDT
Make parameters to Element.getElementsBy*() operations mandatory to match the specification: -
https://dom.spec.whatwg.org/#interface-element
Firefox and Chrome agree with the specification so the compatibility risk should be low. It makes very little sense to call these operations without parameter, especially considering WebKit uses the string "undefined" if the parameter is omitted.
Attachments
Patch
(13.93 KB, patch)
2016-07-21 16:37 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(12.06 KB, patch)
2016-07-21 18:10 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2016-07-21 16:37:22 PDT
Created
attachment 284281
[details]
Patch
Ryosuke Niwa
Comment 2
2016-07-21 17:08:38 PDT
Comment on
attachment 284281
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=284281&action=review
> Source/WebCore/dom/Element.idl:48 > - [ImplementedAs=getElementsByTagNameForObjC] NodeList getElementsByTagName(optional DOMString name); > + [ImplementedAs=getElementsByTagNameForObjC] NodeList getElementsByTagName(DOMString name);
Why are changing Objective-C version? I don't think we want to change the behavior of Objective-C API or do they behave identically in Objective-C?
> Source/WebCore/dom/Element.idl:72 > - [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS(optional DOMString namespaceURI, optional DOMString localName); > + [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
Ditto.
> Source/WebCore/dom/Element.idl:135 > - [ImplementedAs=getElementsByClassNameForObjC] NodeList getElementsByClassName(optional DOMString name); > + [ImplementedAs=getElementsByClassNameForObjC] NodeList getElementsByClassName(DOMString name);
Ditto.
Chris Dumez
Comment 3
2016-07-21 18:06:55 PDT
(In reply to
comment #2
)
> Comment on
attachment 284281
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=284281&action=review
> > > Source/WebCore/dom/Element.idl:48 > > - [ImplementedAs=getElementsByTagNameForObjC] NodeList getElementsByTagName(optional DOMString name); > > + [ImplementedAs=getElementsByTagNameForObjC] NodeList getElementsByTagName(DOMString name); > > Why are changing Objective-C version? I don't think we want to change the > behavior of Objective-C API or do they behave identically in Objective-C? > > > Source/WebCore/dom/Element.idl:72 > > - [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS(optional DOMString namespaceURI, optional DOMString localName); > > + [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName); > > Ditto. > > > Source/WebCore/dom/Element.idl:135 > > - [ImplementedAs=getElementsByClassNameForObjC] NodeList getElementsByClassName(optional DOMString name); > > + [ImplementedAs=getElementsByClassNameForObjC] NodeList getElementsByClassName(DOMString name); > > Ditto.
"optional" has no impact on ObjC bindings. Therefore, I decided to harmonize the ObjC and the JS versions.
Chris Dumez
Comment 4
2016-07-21 18:10:10 PDT
Created
attachment 284294
[details]
Patch
Chris Dumez
Comment 5
2016-07-21 19:43:30 PDT
Comment on
attachment 284294
[details]
Patch Clearing flags on attachment: 284294 Committed
r203547
: <
http://trac.webkit.org/changeset/203547
>
Chris Dumez
Comment 6
2016-07-21 19:43:36 PDT
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