Closed Bug 1646108 Opened 4 years ago Closed 4 years ago

[wpt-sync] Sync PR 24168 - Fix handling of remote frames and URLs in performance.measureMemory

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox79 fixed)

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 24168 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/24168
Details from upstream follow.

Ulan Degenbaev <ulan@chromium.org> wrote:

Fix handling of remote frames and URLs in performance.measureMemory

The existing implementation measures memory usage of the main JS agent
and reports URLs of the JS realms in the agent. The algorithm for
mapping a JS realm to its reported URL walks the frame tree upwards to
find the top-most cross-origin frame. The algorithm incorrectly assumed
that all frames the path are local frames since the realms are local.

This does not hold in the ABA case, where the main origin A embeds
an iframe from origin B that in turn embeds an iframe from origin A.
In such a case, the main JS realm and the grandchild realm are in the
same JS agent and their frames are local. However, the child frame B
is a remote frame.

This CL fixes the algorithm to work both with local and remote frames.
The URL of a remote frame can no longer be fetched from its document.
Instead, it is fetched from the src attribute of the owner iframe
element. This aligns with the upcoming spec and fixes the leak of
post-server-redirect URLs.

The CL also removes LocalFrame::FirstUrlCrossOriginToParent that is
no longer needed.

Bug: 1093880,1084999

Change-Id: I7a57a17701448d0fe210a66c7bdb8c0229fa5149

Reviewed-on: https://chromium-review.googlesource.com/2246175
WPT-Export-Revision: 6e1cc31c6eb95e020a6f19a9dd3fcd26d46845ae

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 11 tests and 1 subtests

Status Summary

Firefox

OK : 11
FAIL: 11

Chrome

OK : 11
PASS: 8
FAIL: 3

Safari

OK : 11
FAIL: 11

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/measure-memory/window-open.mix.tentative.window.html
performance.measureMemory does not leak URLs in cross-origin iframes and windows.: FAIL (Chrome: FAIL, Safari: FAIL)
/measure-memory/main-frame.tentative.window.html
Well-formed result of performance.measureMemory.: FAIL (Chrome: PASS, Safari: FAIL)
/measure-memory/redirect.client.tentative.window.html
performance.measureMemory does not leak client redirected URL.: FAIL (Chrome: PASS, Safari: FAIL)
/measure-memory/iframe.same-origin.tentative.window.html
Well-formed result of performance.measureMemory with same-origin iframes.: FAIL (Chrome: PASS, Safari: FAIL)
/measure-memory/window-open.cross-site.tentative.window.html
performance.measureMemory does not leak URL of cross-site window.open.: FAIL (Chrome: PASS, Safari: FAIL)
/measure-memory/detached.tentative.window.html
performance.measureMemory URLs within a cross-site iframe.: FAIL (Chrome: PASS, Safari: FAIL)
/measure-memory/iframe.cross-site.tentative.window.html
performance.measureMemory URLs within a cross-site iframe.: FAIL (Chrome: PASS, Safari: FAIL)
/measure-memory/redirect.server.tentative.window.html
performance.measureMemory does not leak server redirected URL.: FAIL (Chrome: FAIL, Safari: FAIL)
/measure-memory/window-open.cross-origin.tentative.window.html
performance.measureMemory does not leak URL of cross-origin window.open.: FAIL (Chrome: PASS, Safari: FAIL)
/measure-memory/iframe.cross-origin.tentative.window.html
performance.measureMemory URLs within a cross-origin iframe.: FAIL (Chrome: PASS, Safari: FAIL)
/measure-memory/window-open.same-origin.tentative.window.html
Well-formed result of performance.measureMemory with same-origin window.open.: FAIL (Chrome: FAIL, Safari: FAIL)

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/88fa5bd17cde [wpt PR 24168] - Fix handling of remote frames and URLs in performance.measureMemory, a=testonly
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.