Closed Bug 1760910 Opened 8 months ago Closed 8 months ago

Console does not remain always remain scrolled to bottom


(DevTools :: Console, defect, P2)



(firefox101 fixed)

101 Branch
Tracking Status
firefox101 --- fixed


(Reporter: jdescottes, Assigned: dthayer)



(1 file)

I was looking at and I found a way to make the console lose its scroll to bottom

  • open console (scrolled to bottom)
  • run:
for (var i = 1; i < 100; i++) {
  window["a" + i] = (function(j) { window["a" + j]() }).bind(null, i+1)
function a100() {
  console.warn(new Error("test"));
window.setInterval(() => a1(), 1000)

Just a convoluted way to get a warning with a stacktrace. I feel like very tall messages are leading to this issue. To be confirmed.

Note that if your toolbox is very tall (eg 1000px tall), you might not reproduce the issue.

This seems related to the intersection observer at

    this.lastMessageIntersectionObserver = new IntersectionObserver(
      entries => {
        for (const entry of entries) {
          // Consider that we're not pinned to the bottom anymore if the last message is
          // less than half-visible.
          this.scrolledToBottom = entry.intersectionRatio >= 0.5;
      { root: this.outputNode, threshold: [0.5] }

Tall messages will consistently fail this check depending on the toolbox' height.

oh right, I never thought of this like that but if the observed element is taller than the root, it will impact the intersectionRatio (as well as how the observer callback will be called in regard to the defined thresholds)

At some point I tried having a dedicated invisible element at the bottom of the console output that would serve as the observed element instead of observing messages, I may try that again

Severity: -- → S3
Priority: -- → P2
Assignee: nobody → dothayer

This fixes the test included in the patch. However, it makes no guarantees to not
break other things without the virtualization patch, which changes this to observe
the bottom buffer element instead of the last message.

Pushed by
Use root margin instead of half-visibility for scroll pinning r=nchevobbe
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.