Closed
Bug 899375
Opened 12 years ago
Closed 12 years ago
Inspector attributes get removed if the name contains a colon
Categories
(DevTools :: Inspector, defect)
DevTools
Inspector
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 26
People
(Reporter: bgrins, Assigned: bgrins)
References
Details
Attachments
(1 file, 1 obsolete file)
14.19 KB,
patch
|
miker
:
review+
|
Details | Diff | Splinter Review |
Open this page: https://hg.mozilla.org/mozilla-central/rev/eaeff37cbffc. Inspect element. Double click on the html element's attribute xml:lang="en-US". Click out. Attribute disappears.
Also fails in a basic case like so:
<html>
<body one:two="3">
</body>
</html>
Assignee | ||
Comment 1•12 years ago
|
||
Also happens on the src attribute with this markup:
<img alt="Red dot" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="></img>
Assignee | ||
Comment 2•12 years ago
|
||
Blocks: 893677
Comment 3•12 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #2)
> Blocks: 893677
If you typed bug 893677 it would be linked. Anyhow, you should type blocked bug numbers in the "Blocks" field above.
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → bgrinstead
Assignee | ||
Comment 4•12 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #1)
> Also happens on the src attribute with this markup:
>
> <img alt="Red dot"
> src="data:image/png;base64,
> iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/
> w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="></img>
This is actually due to the value ending in an = sign. The parser in escapeAttributeValues is matching on =". I'm wondering if it would make sense to parse the attributes out a little differently using the DOM or something like: https://developer.mozilla.org/en-US/docs/Code_snippets/HTML_to_DOM. Maybe something like this:
+function escapeAttributeValues(attr, aAttrNode) {
+
+ let div = aAttrNode.ownerDocument.createElement("div");
+ div.innerHTML = "<div " + attr + "></div>";
+
+ var attributes=[];
+ var el = div.childNodes[0];
+ for (var i=0, l=el.attributes.length; i<l; i++){
+ let attr = el.attributes.item(i)
+ attributes.push({name:attr.nodeName, value: attr.nodeValue});
+ }
+
+ return attributes;
+}
It is possible that this could change the behavior when someone actually types one of the reserved characters into the attribute (< > ")
Assignee | ||
Comment 5•12 years ago
|
||
Attachment #787132 -
Flags: review?(mratcliffe)
Assignee | ||
Comment 7•12 years ago
|
||
Please review this one, instead
Attachment #787132 -
Attachment is obsolete: true
Attachment #787132 -
Flags: review?(mratcliffe)
Attachment #787499 -
Flags: review?(mratcliffe)
Assignee | ||
Comment 8•12 years ago
|
||
Pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=60bce2066970
Updated•12 years ago
|
Attachment #787499 -
Flags: review?(mratcliffe) → review+
Assignee | ||
Updated•12 years ago
|
Whiteboard: [land-in-fx-team]
Comment 10•12 years ago
|
||
Whiteboard: [land-in-fx-team] → [fixed-in-fx-team]
Updated•12 years ago
|
Flags: needinfo?(jwalker)
Assignee | ||
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 11•12 years ago
|
||
Whiteboard: [fixed-in-fx-team]
Updated•12 years ago
|
Target Milestone: --- → Firefox 26
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•