Closed Bug 1661283 Opened 4 years ago Closed 4 years ago

Overflow badge not shown for Document node

Categories

(DevTools :: Inspector, defect, P3)

defect

Tracking

(firefox82 fixed)

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: bradwerth, Assigned: bradwerth)

References

(Blocks 1 open bug)

Details

Attachments

(7 files, 1 obsolete file)

Attached file overflow-document.html

Steps to Reproduce:

  1. Ensure the pref "devtools.overflow.debugging.enabled" is true.
  2. Load the attached overflow-document.html file. Note that the page has a vertical scrollbar.
  3. Open the devtools Inspector and select the body tag.

Expected Results:
The body tag should have a "scroll" badge.

The fix will likely involve a change to InspectorUtils::GetOverflowingChildrenOfElement.

Assignee: nobody → bwerth

(In reply to Brad Werth [:bradwerth] from comment #1)

The fix will likely involve a change to InspectorUtils::GetOverflowingChildrenOfElement.

Nope, the problem is that NodeActor.initialize for a HTMLBodyElement checks isScrollable and decides that the body is not scrollable, even if a scrollbar is present. I'm now checking DocumentWalker to see why it fails in this case.

This will be used to support the display of "scroll" badges in devtools.

This requires using the same Element::GetScrollFrame logic used in the new
Element::HasVisibleScrollbars method. This also makes GetScrollFrame public,
so that InspectorUtils can use it.

Depends on D88504

This removes the need for the document/dom walk.

Depends on D88505

This also reuses a cached result of isScrollable, to avoid a second call.

Depends on D88506

(In reply to Brad Werth [:bradwerth] from comment #2)

(In reply to Brad Werth [:bradwerth] from comment #1)

The fix will likely involve a change to InspectorUtils::GetOverflowingChildrenOfElement.

Nope, the problem is that NodeActor.initialize for a HTMLBodyElement checks isScrollable and decides that the body is not scrollable, even if a scrollbar is present. I'm now checking DocumentWalker to see why it fails in this case.

Both the isScrollable logic and the GetOverflowingChildrenOfElement needed an update to handle the body element case. This has the pleasant effect of eliminating the possibly-slow DocumentWalker call in isScrollable.

Attachment #9172541 - Attachment description: yBug 1661283 Part 4: Make NodeActor.initialize respect overflow debugging pref. → Bug 1661283 Part 4: Make NodeActor.initialize respect overflow debugging pref.
Attachment #9173155 - Attachment description: Bug 1661283 Part 7: Add await reflow to test that checks badges, to fix intermittency. → Bug 1661283 Part 7: Update TestActor reflow function, and await reflow in an intermittent test.
Attachment #9173155 - Attachment is obsolete: true
Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/986ef17f0fe4
Part 1: Add a ChromeOnly method to Element for getting scrollbar visibility. r=emilio
https://hg.mozilla.org/integration/autoland/rev/87c6bbff43c5
Part 2: Make InspectorUtils::GetOverflowingChildrenOfElement correctly handle the body element. r=emilio
https://hg.mozilla.org/integration/autoland/rev/8b32a0860985
Part 3: Make NodeActor.isScrollable use the new Element.hasVisibleScrollbars method. r=gl
https://hg.mozilla.org/integration/autoland/rev/236068f7e724
Part 4: Make NodeActor.initialize respect overflow debugging pref. r=gl
https://hg.mozilla.org/integration/autoland/rev/62d68911ba94
Part 5: Add a test of GetOverflowingChildrenOfElement on the body element. r=gl
https://hg.mozilla.org/integration/autoland/rev/2d040d38476f
Part 6: Add a test of NodeActor.isScrollable on various elements. r=gl
Regressions: 1707636
No longer regressions: 1707636
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: