Switch JSON Viewer back to standards mode

RESOLVED FIXED in Firefox 55

Status

defect
P3
normal
RESOLVED FIXED
2 years ago
11 months ago

People

(Reporter: Oriol, Assigned: Oriol)

Tracking

unspecified
Firefox 55
Dependency tree / graph

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

2 years ago
Bug 1367894 fixed various things but switched JSON Viewer to quirks mode and loaded the stylesheets at the end. This patch addresses these problems.

Now it works like this:
 1. The content type is set to text/html
 2. A doctype, the stylesheet and the script are sent at the very beginning
 3. A <plaintext> start tag switches the tokenizer to plaintext state
 4. The chunks of JSON are then directly sent unaltered to the page when they are received

To keep the HTML simple, I only linked the main stylesheet and made it import the other ones. reps.css is already imported by tree-view.css, so no need to import it from main.css

To avoid problems like bug 1260189, I moved all the initialization code to onStartRequest (previously some work was done in onStopRequest), and deferred the script.

Then onStartRequest became too cluttered so I moved code to helper functions.
Attachment #8872860 - Flags: review?(odvarko)
Comment on attachment 8872860 [details] [diff] [review]
json-stream-v2.patch

Review of attachment 8872860 [details] [diff] [review]:
-----------------------------------------------------------------

Looks reasonable.

R+ assuming Try is green.

Thanks for working on this!

Honza
Attachment #8872860 - Flags: review?(odvarko) → review+
Assignee

Comment 2

2 years ago
Can you post the Try link to see if it's green?
Assignee

Updated

2 years ago
Keywords: checkin-needed

Comment 4

2 years ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1d284663f05d
Refactor the JSON Viewer stream converter to avoid quirks mode. r=Honza
Keywords: checkin-needed

Comment 5

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/1d284663f05d
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55

Updated

2 years ago
Depends on: 1395313

Updated

11 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.