Closed
Bug 980204
Opened 12 years ago
Closed 9 years ago
Inspector doesn't escape entities in HTML attributes
Categories
(DevTools :: Inspector, defect, P3)
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: billm, Assigned: zer0)
Details
Attachments
(1 file)
|
70 bytes,
text/html
|
Details |
If I create a web page that contains:
<input id="foo" value=""></input>
and then I run this code:
$("#foo").val(""");
then the page will contain an input element that displays the string '"'. If I then look at that element in the inspector, it shows:
<input id="foo" value="""></input>
However, if I put *that* HTML directly in a web page, the input element will display '"'. I think instead the inspector should show this:
<input id="foo" value="&quot;"></input>
| Assignee | ||
Comment 1•10 years ago
|
||
Filter on CLIMBING SHOES
| Assignee | ||
Comment 2•10 years ago
|
||
(In reply to Bill McCloskey (:billm) from comment #0)
> However, if I put *that* HTML directly in a web page, the input element will
> display '"'. I think instead the inspector should show this:
I wasn't able to reproduce exactly the behavior described; not sure what Bill means with "if I put that HTML directly in a web page", I assumed you mean if you create the page with that HTML as source. If I do that, the input element won't display '"', but still ""e;". Maybe the behavior changed since this bug was filed. Bill, could you provide more info about it?
But, despite that, there is something odds anyway. When we have a page containing:
<input id="foo" value="""></input>
If we enter in "Edit as HTML" mode, the code showing will be:
<input id="foo" value="&quot;"></input>
Probably because it encodes the entity. However, it doesn't really matter if we leave as is or change to ""e;", the result will be the one expected.
We should probably fix that.
Flags: needinfo?(wmccloskey)
Priority: -- → P3
| Reporter | ||
Comment 3•10 years ago
|
||
When I visit this page, I see a text field containing '"'. Is that different from what you see?
Flags: needinfo?(wmccloskey) → needinfo?(zer0)
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → zer0
Flags: needinfo?(zer0)
| Assignee | ||
Comment 4•9 years ago
|
||
(In reply to Bill McCloskey (:billm) from comment #3)
> When I visit this page, I see a text field containing '"'. Is that different
> from what you see?
No, you're right. I probably did something different. However, since it seems consistent with the other browsers' devtools, I'm not sure we want to change this behavior.
| Assignee | ||
Comment 5•9 years ago
|
||
Sorry if you didn't hear from me sooner; if you have some specific use case in mind that you think makes worthy to diverge from the others devtools let me know! Otherwise I think we should resolve this bug as invalid.
Flags: needinfo?(wmccloskey)
| Reporter | ||
Comment 6•9 years ago
|
||
What other devtools is this consistent with? I just tested in Chrome and it doesn't have this bug. If I select the element and choose "Edit as HTML", it displays the attribute as "&quot;".
Flags: needinfo?(wmccloskey) → needinfo?(zer0)
| Assignee | ||
Comment 7•9 years ago
|
||
(In reply to Bill McCloskey (:billm) from comment #6)
> What other devtools is this consistent with?
Chrome and Safari is the ones I tested. I'm referring to what you said in comment 3:
>> When I visit this page, I see a text field containing '"'. Is that different from what you see?
Loading the attachment in Firefox, Safari and Chrome, I have the same result: in the viewsource I have `"e;` but both in the browser (of course) and in the inspector/markup view, I see `"`.
> I just tested in Chrome and it
> doesn't have this bug. If I select the element and choose "Edit as HTML", it
> displays the attribute as "&quot;".
If I load the attachment you added, and I inspect the element with Firefox, Safari and Chrome, and then I choose "Edit as HTML", I got the same behavior in all three browsers (All of them show me a textarea with `<input id="foo" value=""">`).
So, maybe I missed something about the STR, or I didn't catch quite the issue here, but so fare they seems consistent to me.
I tried to describe as better I could my steps to reproduce the issue, so if I missed something please let me know!
(Note: I'm on OSX, I believe you're on Linux; currently I can't test on Linux, but if the STR are the same and we got two different result, it could be platform dependent.)
Flags: needinfo?(zer0) → needinfo?(wmccloskey)
| Reporter | ||
Comment 8•9 years ago
|
||
I just tested again and it looks like this works in Firefox now.
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(wmccloskey)
Resolution: --- → WORKSFORME
Updated•8 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•