Open
Bug 1098352
Opened 11 years ago
Updated 3 years ago
Inspector doesn't set namespaced xlink attributes correctly on SVG elements
Categories
(DevTools :: Inspector, defect, P3)
Tracking
(Not tracked)
NEW
People
(Reporter: kud, Unassigned)
Details
(Keywords: testcase)
Attachments
(4 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:35.0) Gecko/20100101 Firefox/35.0
Build ID: 20141113004001
Steps to reproduce:
- Use svg-symbols (https://github.com/Hiswe/gulp-svg-symbols) (result of svg-symbols attached in the issue)
- Add the result in the begin of the DOM (just after the body)
- Use:
```
<svg role="img" class="play">
<use xlink:href="#play"></use>
</svg>
```
- Change it (via inspector or javascript) to:
```
<svg role="img" class="stop">
<use xlink:href="#stop"></use>
</svg>
```
Actual results:
The svg will be empty/blank/transparent.
Expected results:
It should display "stop" svg.
It works correctly on chrome canary, firefox nightly. Not on dev edition.
| Reporter | ||
Comment 1•11 years ago
|
||
| Reporter | ||
Comment 2•11 years ago
|
||
| Reporter | ||
Comment 3•11 years ago
|
||
( Note to myself: first bug filed for dev edition
| Reporter | ||
Comment 4•11 years ago
|
||
(oh noes emojis don't work)
Comment 5•11 years ago
|
||
(In reply to Erwann Mest from comment #0)
> Created attachment 8522239 [details]
> svg-symbols.svg
>
> User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:35.0)
> Gecko/20100101 Firefox/35.0
> Build ID: 20141113004001
>
> Steps to reproduce:
>
> - Use svg-symbols (https://github.com/Hiswe/gulp-svg-symbols) (result of
> svg-symbols attached in the issue)
> - Add the result in the begin of the DOM (just after the body)
Which DOM? Can you attach a working testcase?
Flags: needinfo?(m+bugzilla)
| Reporter | ||
Comment 6•11 years ago
|
||
Flags: needinfo?(m+bugzilla)
| Reporter | ||
Comment 7•11 years ago
|
||
You can change it with javascript too but didn't have to make a button for it, mostly that it's the same problem if you change it via js or inspector.
Comment 8•11 years ago
|
||
(In reply to Erwann Mest from comment #7)
> You can change it with javascript too but didn't have to make a button for
> it, mostly that it's the same problem if you change it via js or inspector.
No, I'm afraid not.
This is an inspector bug. It's because initially, the attribute gets parsed as having a namespaceURI of
"http://www.w3.org/1999/xlink"
And afterwards, it has no namespace and its localName is "xlink:href", which breaks all the things.
So instead of editing in the inspector, if you execute this in the console after a reload:
document.querySelector(".play").children[0].setAttributeNS(document.querySelector(".play").children[0].attributes[0].namespaceURI, "href", "#stop")
it works fine.
This is broken on beta and 33 as well, so I'm removing the dev edition references.
CC'ing pbrosset and hsivonen because there was some recent work to improve the situation here. I don't know if/how that's related.
Status: UNCONFIRMED → NEW
Component: Untriaged → Developer Tools: Inspector
Ever confirmed: true
Keywords: testcase
OS: Mac OS X → All
Hardware: x86 → All
Summary: On firefox dev edition (only), if svg-symbols used and svg switched, it makes a blank one → Inspector doesn't set namespaced xlink attributes correctly on SVG elements
| Reporter | ||
Comment 9•11 years ago
|
||
I've exactly the same problem with react.js though. :(
Comment 10•11 years ago
|
||
Sounds awfully like bug 1008584 which would explain why trunk works.
Comment 11•11 years ago
|
||
(In reply to Robert Longson from comment #10)
> Sounds awfully like bug 1008584 which would explain why trunk works.
Hmm, yes, except trunk doesn't WFM...
Comment 12•11 years ago
|
||
(In reply to Erwann Mest from comment #9)
> I've exactly the same problem with react.js though. :(
(we discussed this out-of-band - the react.js problem was bug 886390, which is indeed fixed on trunk - but this isn't)
Updated•8 years ago
|
Product: Firefox → DevTools
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•