Inconsistency between WindowGlobalParent::IsCurrentGlobal() and nsPIDOMWindowInner::IsCurrentInnerWindow()
Categories
(Core :: DOM: Content Processes, defect)
Tracking
()
People
(Reporter: mccr8, Assigned: mccr8)
References
Details
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-esr115+
|
Details | Review |
nsPIDOMWindowInner::IsCurrentInnerWindow() returns false if SHIP is enabled and the inner window has a BC that is in the BFCache. On the other hand, WindowGlobalParent::IsCurrentGlobal() doesn't consider that condition. This extra condition was added bug 1704068.
An example of where this can happen is in the test browser_contentWindow.js. This test loads one page, then uses BrowserTestUtils.loadURIString() to load a second page, then sends a message to the child actor in the first page. At that point in time, the inner window for the first page returns false for IsCurrentInnerWindow() because the BC is in the bfcache, but IsCurrentGlobal() called on the corresponding WindowGlobalParent returns true.
IsCurrentGlobal() doesn't have many callers, so I'm not sure how bad this is. Should it be changed to add the additional condition?
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
The fix is simple but I don't know if it makes sense or not to do.
Comment 3•2 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #2)
The fix is simple but I don't know if it makes sense or not to do.
:smaug, do you know?
Comment 4•2 years ago
|
||
Looks like WindowGlobalParent::IsCurrentGlobal() is used very rarely, and callers should be fine with checking bfcache - except that I don't know about the extension code.
Comment 5•2 years ago
•
|
||
zombie might know about https://searchfox.org/mozilla-central/search?q=isCurrentGlobal&path=extensions&case=false®exp=false
At least one of those already explicitly checks for bfcache.
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Comment 7•1 year ago
|
||
bugherder |
Assignee | ||
Comment 8•1 year ago
|
||
[Tracking Requested - why for this release]: needed for bug 1863852.
Assignee | ||
Comment 9•1 year ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D183311
Updated•1 year ago
|
Comment 10•1 year ago
|
||
Uplift Approval Request
- Steps to reproduce for manual QE testing: none
- Explanation of risk level: minor change to a corner case that has been on m-c since September without issue
- Code covered by automated testing: yes
- Is Android affected?: yes
- String changes made/needed: none
- Needs manual QE test: no
- Risk associated with taking this patch: low
- Fix verified in Nightly: yes
- User impact if declined: needed for bug 1863852
Comment 11•1 year ago
|
||
Comment on attachment 9366098 [details]
Bug 1842936 - Make WindowGlobalParent::IsCurrentGlobal() consistent with nsPIDOMWindowInner::IsCurrentInnerWindow().
Approved for 115.6esr.
Updated•1 year ago
|
Comment 12•1 year ago
|
||
uplift |
Updated•1 year ago
|
Description
•