Closed Bug 1759919 Opened 4 years ago Closed 4 years ago

document.getWireframe doesn't return significant rects for cbc.ca

Categories

(Core :: Layout, enhancement)

enhancement

Tracking

()

VERIFIED FIXED
100 Branch
Tracking Status
firefox100 --- verified

People

(Reporter: mconley, Assigned: emilio)

Details

Attachments

(2 files)

STR:

  1. Open the Browser Toolbox
  2. Visit https://www.cbc.ca
  3. After the page finishes loading, switch to the Console tab
  4. At the right-most end of the Console input, click on the item that says "Top" to show a list of processes / contexts we can switch to. Switch to the cbc.ca one in the second block, the one that shows the PID at the start.
  5. In the console, type:
tabs[0].content.document.getWireframe(true);

ER:

The returned wireframe should contain rects for the main elements of the page, including the "main story" on the site.

AR:

The returned rects appear to be for the header and the scrollbar, but nothing else.

Interestingly, if you repeat steps 1-4 of the STR, and then type in:

tabs[0].content.windowUtils.nodesFromRect(0, 0, 0, tabs[0].content.innerWidth, tabs[0].content.innerHeight, 0, true, false, true)

you get the same restricted number of nodes. If however, you then type in:

tabs[0].content.windowUtils.nodesFromRect(0, 0, 0, tabs[0].content.innerWidth, tabs[0].content.innerHeight, 0, true, false, false)

then we get far more nodes - apparently, the aOnlyVisible argument is restricting us somehow here.

Any idea what's going on here, emilio?

Flags: needinfo?(emilio)
Assignee: nobody → emilio
Flags: needinfo?(emilio)

Don't include it twice, and compute it explicitly since PresShell's
GetCanvasBackground gets computed during painting otherwise.

nsDisplayTransform::HitTest clips the rect it passes to its children,
and thus intersecting the whole area isn't relevant.

Depends on D141300

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/52120ef3072f Improve getWireframe() handling of canvas background. r=mconley https://hg.mozilla.org/integration/autoland/rev/84fa6be07a61 Don't stop looking for intersecting frames too early in case there are fully-opaque transformed elements. r=miko,mconley
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch

Reproducible on a 2022-03-14 Nightly build on macOS 11. Verified as fixed on Nightly 102.0a1 (20220502213947) on macOS, Win10 64-bits, Ubuntu 20.04.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: