Closed Bug 1875011 Opened 2 years ago Closed 2 years ago

Use non-rounded scroll position in nsHTMLScrollFrame::ScrollByCSSPixelsInternal behind layout.scroll.disable-pixel-alignment pref

Categories

(Core :: Layout: Scrolling and Overflow, task)

task

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox122 --- fixed
firefox123 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

Details

Attachments

(2 files)

We use rounded scroll positions in nsHTMLScrollFrame::ScrollByCSSPixelsInternal, it is the cause of 1px difference failure in the wpt added in bug 1874551.

Note that nsHTMLScrollFrame::ScrollToCSSPixels also uses the rounded scroll position but I leave it as it is for now since it's entirely unclear to me about the following comparisons in the function;

  // XXX I don't think the following blocks are needed anymore, now that
  // ScrollToImpl simply tries to scroll an integer number of layer
  // pixels from the current position
  nsPoint current = GetScrollPosition();
  if (currentCSSPixels.x == aScrollPosition.x) {
    pt.x = current.x;
    range.x = pt.x;
    range.width = 0;
  }
  if (currentCSSPixels.y == aScrollPosition.y) {
    pt.y = current.y;
    range.y = pt.y;
    range.height = 0;
  }

As the comment said, I guess it's not necessary, but if it's still necessary, or if we leave the comparison here in this bug, comparing CSSPoint with CSSIntPoint would be problematic. If we round the CSSPoint value for the comparison, it would be identical to the current version in most cases.

Pushed by hikezoe.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8a492fe4ed55 Rename GetScrollPositionCSSPixels to GetRoundedScrollPositionCSSPixels. r=botond https://hg.mozilla.org/integration/autoland/rev/e6395c398b89 Use non-rounded scroll position behind layout.scroll.disable-pixel-alignment in nsHTMLScrollFrame::ScrollByCSSPixelsInternal. r=botond
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: