Closed Bug 1368899 Opened 6 years ago Closed 6 years ago

Switch JSON Viewer back to standards mode


(DevTools :: JSON Viewer, defect, P3)



(firefox55 fixed)

Firefox 55
Tracking Status
firefox55 --- fixed


(Reporter: Oriol, Assigned: Oriol)




(1 file)

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]

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

Looks reasonable.

R+ assuming Try is green.

Thanks for working on this!

Attachment #8872860 - Flags: review?(odvarko) → review+
Can you post the Try link to see if it's green?
Keywords: checkin-needed
Pushed by
Refactor the JSON Viewer stream converter to avoid quirks mode. r=Honza
Keywords: checkin-needed
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Depends on: 1395313
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.