Open
Bug 1055465
Opened 10 years ago
Updated 2 years ago
No need for removeAttributeNode return value to to be nullable
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
NEW
People
(Reporter: annevk, Unassigned)
Details
Found this while trying to write the specification for this method. It either throws or returns the attribute it just removed. There's no other state.
Updated•10 years ago
|
Assignee: nobody → wknapek
Comment 2•10 years ago
|
||
It should return the same type, just not nullable (indicated by the ? after the type): http://mxr.mozilla.org/mozilla-central/source/dom/webidl/Element.webidl#149
OK do if i think correctly method return attribute just removed or nullptr. In correct state it should always return attribute? Somebody correct me if I'm wrong
Comment 5•10 years ago
|
||
The understanding is that the method will either return a non-null value or it will throw an error. In that case it will return a null value, but for the purposes of the API described in the WebIDL file, that return value is never seen by callers so it doesn't matter.
Attr? removeAttributeNode(Attr oldAttr); so i must delete "?" like this -> Attr removeAttributeNode(Attr oldAttr); in ../source/dom/webidl/Element.webidl file ?
Comment 7•10 years ago
|
||
Yes, and verify that the method is in fact throwing any time it returns null.
Comment 9•10 years ago
|
||
Uh... no, it's not. It's right there at https://dom.spec.whatwg.org/#dom-element-removeattributenode
Comment 10•10 years ago
|
||
Please have a look. I have read about it. Here, http://www.w3.org/TR/dom/#element
Comment 11•10 years ago
|
||
That's an old draft from July 2014. Before people realized it couldn't be removed because it's being used. A good rule of thumb is that by the time a draft ends up under TR/ it's out of date.
The link in comment 9 is the current draft of the spec.
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Comment 12•2 years ago
|
||
The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.
Assignee: wknapek → nobody
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•