Closed Bug 1662839 Opened 4 years ago Closed 3 years ago

Move AuthorStyleDisabled/HintCharset/HintCharsetSource to WindowContext or BrowsingContext

Categories

(Core :: Layout, defect)

defect

Tracking

()

RESOLVED FIXED
Fission Milestone M7

People

(Reporter: kmag, Assigned: heycam)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The functions which set these flags currently try to propagate them to descendants using nsDocumentViewer::CallChildren, which only handle in-process children. We want to handle out-of-process children too, which means we need to use store them on WindowContext or BrowsingContext instead, and propagate them using something like BrowsingContext::PreOrderWalk.

Note that this involves adding DidSet* hooks to BrowsingContext or WindowContext for each of these flags to update the layout state of the child process they live in when the flags change.

Severity: -- → S3

We'll need AuthorStyleDisabled mainly for devtools.

Fission Milestone: --- → M7

Is AuthorStyleDisabled also used for the View > Page Style > No Page Style menu?

(In reply to Cameron McCormack (:heycam) from comment #3)

Is AuthorStyleDisabled also used for the View > Page Style > No Page Style menu?

It is, but looks like PageStyleChild.jsm handles this in all frames.

Henri, do you know if the lack of support for OOP iframes in nsDocumentViewer::SetHintCharset and SetHintCharacterSetSource is a problem? Can you suggest a way to construct a document that would end up using the wrong encoding in a child iframe if these aren't fixed?

Flags: needinfo?(hsivonen)
Assignee: nobody → cam
Status: NEW → ASSIGNED
Keywords: leave-open
Pushed by cmccormack@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1bfa83880712
Set author style disabled state correctly on newly created iframes. r=mattwoodrow

Backed out changeset 1bfa83880712 (bug 1662839) for browser_disable_author_style_oop.js failures.

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&fromchange=9bc4c7e79cd6298e53941a1f0c03c84d111075f6&searchStr=mochitest-browser-chrome&tochange=be95f3d07de37271de47f5cab75698547c141cd0&selectedTaskRun=A2hyGe3HT_aKcAU7MByzwA.0

Backout link: https://hg.mozilla.org/integration/autoland/rev/be95f3d07de37271de47f5cab75698547c141cd0

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=316552574&repo=autoland&lineNumber=2032

[task 2020-09-24T02:26:42.905Z] 02:26:42     INFO - TEST-START | browser/base/content/test/pageStyle/browser_disable_author_style_oop.js
[task 2020-09-24T02:26:43.343Z] 02:26:43     INFO - TEST-INFO | started process screencapture
[task 2020-09-24T02:26:43.526Z] 02:26:43     INFO - TEST-INFO | screencapture: exit 0
[task 2020-09-24T02:26:43.526Z] 02:26:43     INFO - Buffered messages logged at 02:26:42
[task 2020-09-24T02:26:43.526Z] 02:26:43     INFO - Entering test bound test_disable_style
[task 2020-09-24T02:26:43.527Z] 02:26:43     INFO - Console message: [JavaScript Error: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol." {file: "http://example.com/browser/browser/base/content/test/pageStyle/page_style.html" line: 0}]
[task 2020-09-24T02:26:43.527Z] 02:26:43     INFO - Buffered messages logged at 02:26:43
[task 2020-09-24T02:26:43.527Z] 02:26:43     INFO - Console message: [JavaScript Error: "Unknown Collection "main/partitioning-exempt-urls"" {file: "resource://services-settings/RemoteSettingsClient.jsm" line: 160}]
[task 2020-09-24T02:26:43.527Z] 02:26:43     INFO - UnknownCollectionError@resource://services-settings/RemoteSettingsClient.jsm:160:5
[task 2020-09-24T02:26:43.527Z] 02:26:43     INFO - sync@resource://services-settings/RemoteSettingsClient.jsm:470:13
[task 2020-09-24T02:26:43.527Z] 02:26:43     INFO - 
[task 2020-09-24T02:26:43.527Z] 02:26:43     INFO - TEST-PASS | browser/base/content/test/pageStyle/browser_disable_author_style_oop.js | parent color before disabling style - 
[task 2020-09-24T02:26:43.527Z] 02:26:43     INFO - TEST-PASS | browser/base/content/test/pageStyle/browser_disable_author_style_oop.js | first child color before disabling style - 
[task 2020-09-24T02:26:43.527Z] 02:26:43     INFO - TEST-PASS | browser/base/content/test/pageStyle/browser_disable_author_style_oop.js | parent color after disabling style - 
[task 2020-09-24T02:26:43.528Z] 02:26:43     INFO - TEST-PASS | browser/base/content/test/pageStyle/browser_disable_author_style_oop.js | first child color after disabling style - 
[task 2020-09-24T02:26:43.528Z] 02:26:43     INFO - Buffered messages finished
[task 2020-09-24T02:26:43.528Z] 02:26:43     INFO - TEST-UNEXPECTED-FAIL | browser/base/content/test/pageStyle/browser_disable_author_style_oop.js | second child color after disabling style - Got "rgb(0, 0, 255)", expected "rgb(0, 0, 0)"
[task 2020-09-24T02:26:43.528Z] 02:26:43     INFO - Stack trace:
[task 2020-09-24T02:26:43.528Z] 02:26:43     INFO - chrome://mochikit/content/browser-test.js:test_is:1332
[task 2020-09-24T02:26:43.528Z] 02:26:43     INFO - chrome://mochitests/content/browser/browser/base/content/test/pageStyle/browser_disable_author_style_oop.js:test_disable_style:58
[task 2020-09-24T02:26:43.528Z] 02:26:43     INFO - Leaving test bound test_disable_style
[task 2020-09-24T02:26:43.528Z] 02:26:43     INFO - GECKO(1622) | MEMORY STAT vsizeMaxContiguous not supported in this build configuration.
[task 2020-09-24T02:26:43.528Z] 02:26:43     INFO - GECKO(1622) | MEMORY STAT | vsize 6778MB | residentFast 274MB | heapAllocated 116MB
[task 2020-09-24T02:26:43.528Z] 02:26:43     INFO - TEST-OK | browser/base/content/test/pageStyle/browser_disable_author_style_oop.js | took 520ms
Flags: needinfo?(cam)

(In reply to Cameron McCormack (:heycam) from comment #5)

Henri, do you know if the lack of support for OOP iframes in nsDocumentViewer::SetHintCharset and SetHintCharacterSetSource is a problem? Can you suggest a way to construct a document that would end up using the wrong encoding in a child iframe if these aren't fixed?

It shouldn't be a problem, because the encoding is not supposed to inherit across sites anyway.

Flags: needinfo?(hsivonen)
Pushed by cmccormack@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8ae706cfee33
Set author style disabled state correctly on newly created iframes. r=mattwoodrow

Per comment 10, we shouldn't need to do anything for SetHintCharHint and SetHintCharacterSetSource, so this bug should be done.

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(cam)
Resolution: --- → FIXED
Keywords: leave-open
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: