New issue
Advanced search Search tips

Issue 812311 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Frame AutoSize papers over subpixel issues with scrollbars

Project Member Reported by bokan@chromium.org, Feb 14 2018

Issue description

Chrome Version       : r536359

In FrameViewAutoSizeInfo, we try to resize the frame such that the content inside it doesn't have scrollbars. Unfortunately, it seems that there are some issues with subpixel precision causing scrollbars to appear when they otherwise wouldn't. FrameViewAutoSizeInfo is the only user of a scrollbar mode that suspends the normal scrollbar showing mechanisms and locks them to whatever FVASI has decided. This adds needless complexity both to the ScrollableAreas and FVASI.

To see the issue, comment out this block in FVASI:

    // Check to see if a scrollbar is needed for a given dimension and
    // if so, increase the other dimension to account for the scrollbar.
    // Since the dimensions are only for the view rectangle, once a
    // dimension exceeds the maximum, there is no need to increase it further.
    if (new_size.Width() > max_auto_size_.Width()) {
      Scrollbar* local_horizontal_scrollbar =
          layout_viewport->HorizontalScrollbar();
      if (!local_horizontal_scrollbar) {
        local_horizontal_scrollbar =
            layout_viewport->CreateScrollbar(kHorizontalScrollbar);
      }
      if (!local_horizontal_scrollbar->IsOverlayScrollbar()) {
        new_size.SetHeight(new_size.Height() +
                           local_horizontal_scrollbar->Height());
      }

      // Don't bother checking for a vertical scrollbar because the width is at
      // already greater the maximum.
    } else if (new_size.Height() > max_auto_size_.Height()) {
      Scrollbar* local_vertical_scrollbar =
          layout_viewport->VerticalScrollbar();
      if (!local_vertical_scrollbar) {
        local_vertical_scrollbar =
            layout_viewport->CreateScrollbar(kVerticalScrollbar);
      }
      if (!local_vertical_scrollbar->IsOverlayScrollbar())
        new_size.SetWidth(new_size.Width() + local_vertical_scrollbar->Width());

      // Don't bother checking for a horizontal scrollbar because the height is
      // already greater the maximum.
    }

As well as the scrollbar mode setting bit below it. Then follow the repro instructions in  issue 811478  or see the repro in ScrollbarsTest.AutosizeTest. The content will have scrollbars even though it shouldn't have to.

This bug tracks fixing the source of the scrollbars (which appears to be FVASI being subpixel unaware) and removing all the scrollbar mode mechanisms.



 

Comment 1 by bokan@chromium.org, Feb 14 2018

Labels: Hotlist-GoodFirstBug

Sign in to add a comment