Closed Bug 1528146 Opened 6 years ago Closed 6 years ago

Make non-initial about:blank fire document-element-inserted notifications

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

I need this for bug 1489308 to fix how webextensions interact with about:blank.

The basic idea is to make non-initial about:blank fire
document-element-inserted notifications just like every other document. We
then ensure that there's a notification (initial-document-element-inserted)
that only gets fired once per window for documents that are in a window. This
notification is what webextensions use to inject into the document.

The old setup which injected into about:blank when its global is created gets
removed in favor of injecting the same way as into every other document.

The changes to Document.cpp are fixing a bug in the "block the parser" stuff
webextensions do. For about:blank, the blocking happens at a point when the
parser really has nothing else to parse (since it's parsing the empty string).
So the blocking is a no-op. But we do want to prevent DOMContentLoaded firing,
because otherwise the "end of document" scripts could run before we finish
doing the "beginning of document" work in webextensions. So we want to make
sure we block DOMContentLoaded, not just the load event.

Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/367ca1e16853 Fix how web extensions are injected into about:blank. r=kmag
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Depends on: 1528762
Depends on: 1528456
Status: RESOLVED → REOPENED
Flags: needinfo?(bzbarsky)
Resolution: FIXED → ---
Target Milestone: mozilla67 → ---
Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e657fe2ca2a3 Fix how web extensions are injected into about:blank. r=kmag
Flags: needinfo?(bzbarsky)
Status: REOPENED → RESOLVED
Closed: 6 years ago6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Depends on: 1530146
No longer depends on: 1530146
Depends on: 1530948
Component: DOM → DOM: Core & HTML
Regressions: 1568171
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: