Closed
Bug 1258205
Opened 10 years ago
Closed 10 years ago
setAttribute doesn't throw InvalidCharacterError if the attribute already exists
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla48
| Tracking | Status | |
|---|---|---|
| firefox48 | --- | fixed |
People
(Reporter: Oriol, Assigned: Oriol)
References
()
Details
(Keywords: dev-doc-needed)
Attachments
(2 files, 3 obsolete files)
|
753 bytes,
text/html
|
Details | |
|
1.59 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:48.0) Gecko/20100101 Firefox/48.0
Build ID: 20160319030558
Steps to reproduce:
Create an element with an attribute which does not match the Name production, e.g.
> <div class="test" ~="123"></div>
Use setAttribute on that element with that attribute
> el.setAttribute('~', 'bad');
Actual results:
The value of the attribute changes.
Expected results:
An InvalidCharacterError should be thrown.
(https://www.w3.org/TR/dom/#dom-element-setattribute)
Updated•10 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Assignee | ||
Comment 1•10 years ago
|
||
Updated•10 years ago
|
Attachment #8740491 -
Flags: review?(amarchesini)
| Assignee | ||
Updated•10 years ago
|
Attachment #8740491 -
Attachment description: Make setAttribute, check if attribute name is valid even if it already exists → Make setAttribute check if attribute name is valid even if it already exists
Comment 2•10 years ago
|
||
Comment on attachment 8740491 [details] [diff] [review]
Make setAttribute check if attribute name is valid even if it already exists
Review of attachment 8740491 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/base/Element.cpp
@@ +1180,5 @@
> + aError = nsContentUtils::CheckQName(aName, false);
> + if (aError.Failed()) {
> + return;
> + }
> +
remove this extra space.
Attachment #8740491 -
Flags: review?(amarchesini) → review+
Comment 3•10 years ago
|
||
NI to make sure this doesn't get lost :)
Assignee: nobody → oriol-bugzilla
Flags: needinfo?(oriol-bugzilla)
| Assignee | ||
Comment 4•10 years ago
|
||
Removing space.
Attachment #8740491 -
Attachment is obsolete: true
Flags: needinfo?(oriol-bugzilla)
| Assignee | ||
Updated•10 years ago
|
Attachment #8740910 -
Flags: review?(amarchesini)
Comment 5•10 years ago
|
||
Comment on attachment 8740910 [details] [diff] [review]
Make setAttribute check if attribute name is valid even if it already exists
Review of attachment 8740910 [details] [diff] [review]:
-----------------------------------------------------------------
Carrying forward r=baku
Attachment #8740910 -
Flags: review?(amarchesini) → review+
Updated•10 years ago
|
Keywords: checkin-needed,
dev-doc-needed
Comment 6•10 years ago
|
||
does not apply cleanly:
patching file dom/base/Element.cpp
Hunk #1 FAILED at 1171
1 out of 1 hunks FAILED -- saving rejects to file dom/base/Element.cpp.rej
patch failed, unable to continue (try -v)
patch failed, rejects left in working directory
errors during apply, please fix and qrefresh setAttribute.patch
could you take a look, thanks!
Flags: needinfo?(oriol-bugzilla)
Keywords: checkin-needed
| Assignee | ||
Comment 7•10 years ago
|
||
Sorry, my local code was reasonably recent so I didn't think it was necessary to update it. But it was, because the code just below my change was modified.
Attachment #8740910 -
Attachment is obsolete: true
Flags: needinfo?(oriol-bugzilla)
Attachment #8740990 -
Flags: review?(amarchesini)
Updated•10 years ago
|
Attachment #8740990 -
Flags: review?(amarchesini) → review+
Updated•10 years ago
|
Keywords: checkin-needed
Keywords: checkin-needed
Comment 9•10 years ago
|
||
backedout for issues in w-p-t 2 tests like https://treeherder.mozilla.org/logviewer.html#?job_id=25874835&repo=mozilla-inbound
Flags: needinfo?(oriol-bugzilla)
Comment 10•10 years ago
|
||
| Assignee | ||
Comment 11•10 years ago
|
||
If I understand correctly, the problem was that I didn't tell the test that now the expected result is pass instead of fail.
Attachment #8740990 -
Attachment is obsolete: true
Flags: needinfo?(oriol-bugzilla)
Attachment #8741843 -
Flags: review?(amarchesini)
Updated•10 years ago
|
Attachment #8741843 -
Flags: review?(amarchesini) → review+
| Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 12•10 years ago
|
||
Keywords: checkin-needed
Comment 13•10 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in
before you can comment on or make changes to this bug.
Description
•