Open Bug 1501612 Opened 6 years ago Updated 2 years ago

Inspector converts HTML escape codes to their renderable counterparts

Categories

(DevTools :: Inspector, defect, P3)

62 Branch
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: mgridinas, Unassigned)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:62.0) Gecko/20100101 Firefox/62.0 Steps to reproduce: I returned an escaped HTML string from my PHP Laravel backend via XmlHttpRequest interface and added it to DOM via `div.innerHTML` call. Actual results: HTML inspector converts `<`and every other escaped string to their renderable counterparts. The actual result is still available via `innerHTML` call from javascript console. Expected results: HTML inspector must have kept `<` and every other escape sequence as is.
Attachment #9019621 - Attachment mime type: text/plain → image/png
Attachment #9019621 - Attachment mime type: image/png → text/plain
The escape sequences are decoded while parsing and stored in the DOM unescaped. That's normal. Displaying unescaped content between items that look like tags is a potential UI issue in the dev tools but the display is ultimately a UI design decision.
Component: HTML: Parser → DOM
Product: Core → DevTools
It's misleading. How is it an UI design decision to mislead developers on purpose and have them to go through hoops to check what is exactly going on?

This looks like the Inspector panel related bug.

Honza

Component: DOM → Inspector

I am attempting to reproduce. It would be very helpful if you could provide a testcase -- ideally one that doesn't require a PHP backend.

Flags: needinfo?(mgridinas)

Certainly. I've reproduced the issue with the following snippet

<html>
<body>
&lt;script&gt;console.log(24)&lt;/script&gt;
</body>
<html>

Currently running 66.0.5 on Windows 10 Home.

Flags: needinfo?(mgridinas)
Priority: -- → P3
Whiteboard: [devtools-triage]

We should file an enhancement to surface HTML parsing errors (based on what is provided in the view source UI).

Flags: needinfo?(jdescottes)
Whiteboard: [devtools-triage]
See Also: → 1195456, 1493964
See Also: → 1768019
Flags: needinfo?(jdescottes)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: