Closed
Bug 1481024
Opened 8 years ago
Closed 8 years ago
Stop relying on lexical variables being accessible across frame scripts
Categories
(Core :: Disability Access APIs, enhancement)
Core
Disability Access APIs
Tracking
()
RESOLVED
FIXED
mozilla63
| Tracking | Status | |
|---|---|---|
| firefox63 | --- | fixed |
People
(Reporter: kmag, Assigned: kmag)
References
(Depends on 1 open bug)
Details
Attachments
(1 file)
The accessibility tests currently rely, in a lot of places, on certain lexical variables defined in global frame scripts being available to frame scripts run in unique scopes. While that is (unfortunately) the case now, it will not be after bug 1480244.
The most pervasive problem is ContentTask tasks which expect to be able to access a `document` variable, which is defined as a lexical in a global frame script. And, while the simplest way to solve this would be to use `var` rather than `let` to define these variables (which would define them as properties on the message manager rather than lexicals), storing `document`, `window`, and `navigator` references from a content window in a frame script scope is a very bad idea in general, since they remain alive even after the document navigates, after which they point to a document which is unrelated to the one currently loaded by the frameloader.
So instead, I opted to change the existing code to always access these things via `content` directly, rather than relying on the unsafe stub variables.
| Comment hidden (mozreview-request) |
Comment 2•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8997682 [details]
Bug 1481024: Stop relying on lexical variables being available across frame scripts.
https://reviewboard.mozilla.org/r/261384/#review268738
thanks
Attachment #8997682 -
Flags: review?(yzenevich) → review+
| Assignee | ||
Comment 3•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/c2e822179070687fce86468933a404f558490df7
Bug 1481024: Stop relying on lexical variables being available across frame scripts. r=yzen
Comment 4•8 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•