Changeset 162515 in webkit


Ignore:
Timestamp:
Jan 22, 2014 5:07:25 AM (10 years ago)
Author:
Antti Koivisto
Message:

Update overlay scrollbars in single pass
https://bugs.webkit.org/show_bug.cgi?id=127289

Source/WebCore:

Reviewed by Anders Carlsson.

  • platform/ScrollView.cpp:

(WebCore::ScrollView::updateScrollbars):

Multi-pass scrollbar resolution is only needed for traditional scrollbars. Overlay scrollbars don't affect layout.

LayoutTests:

  • platform/mac/accessibility/iframe-aria-hidden.html:


Try to keep this non-flaky by forcing layout. Real fix would probably be in the
accessibility test framework.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r162510 r162515  
     12014-01-22  Antti Koivisto  <antti@apple.com>
     2
     3        Update overlay scrollbars in single pass
     4        https://bugs.webkit.org/show_bug.cgi?id=127289
     5
     6        * platform/mac/accessibility/iframe-aria-hidden.html:
     7       
     8            Try to keep this non-flaky by forcing layout. Real fix would probably be in the
     9            accessibility test framework.
     10
    1112014-01-22  ChangSeok Oh  <changseok.oh@collabora.com>
    212
  • trunk/LayoutTests/platform/mac/accessibility/iframe-aria-hidden.html

    r162474 r162515  
    2929
    3030        document.getElementById("iframe").setAttribute("aria-hidden", "false");
     31   
     32        document.getElementById("iframe").contentWindow.document.body.offsetWidth;
     33        document.body.offsetWidth;
     34
    3135        shouldBe("body.childrenCount", "4");
    3236        shouldBe("body.childAtIndex(0).childAtIndex(0).childAtIndex(0).role", "'AXRole: AXWebArea'");
  • trunk/Source/WebCore/ChangeLog

    r162508 r162515  
     12014-01-22  Antti Koivisto  <antti@apple.com>
     2
     3        Update overlay scrollbars in single pass
     4        https://bugs.webkit.org/show_bug.cgi?id=127289
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * platform/ScrollView.cpp:
     9        (WebCore::ScrollView::updateScrollbars):
     10       
     11            Multi-pass scrollbar resolution is only needed for traditional scrollbars. Overlay scrollbars don't affect layout.
     12
    1132014-01-22  Mihnea Ovidenie  <mihnea@adobe.com>
    214
  • trunk/Source/WebCore/platform/ScrollView.cpp

    r162447 r162515  
    506506        return;
    507507
     508    bool hasOverlayScrollbars = (!m_horizontalScrollbar || m_horizontalScrollbar->isOverlayScrollbar()) && (!m_verticalScrollbar || m_verticalScrollbar->isOverlayScrollbar());
     509
    508510    // If we came in here with the view already needing a layout, then go ahead and do that
    509511    // first.  (This will be the common case, e.g., when the page changes due to window resizing for example).
    510512    // This layout will not re-enter updateScrollbars and does not count towards our max layout pass total.
    511     if (!m_scrollbarsSuppressed) {
     513    if (!m_scrollbarsSuppressed && !hasOverlayScrollbars) {
    512514        m_inUpdateScrollbars = true;
    513515        visibleContentsResized();
     
    549551        IntSize fullVisibleSize = visibleContentRect(IncludeScrollbars).size();
    550552
    551         if (hScroll == ScrollbarAuto) {
     553        if (hScroll == ScrollbarAuto)
    552554            newHasHorizontalScrollbar = docSize.width() > visibleWidth();
    553             if (newHasHorizontalScrollbar && !m_updateScrollbarsPass && docSize.width() <= fullVisibleSize.width() && docSize.height() <= fullVisibleSize.height())
     555        if (vScroll == ScrollbarAuto)
     556            newHasVerticalScrollbar = docSize.height() > visibleHeight();
     557
     558        bool needAnotherPass = false;
     559        if (!hasOverlayScrollbars) {
     560            // If we ever turn one scrollbar off, always turn the other one off too.  Never ever
     561            // try to both gain/lose a scrollbar in the same pass.
     562            if (!m_updateScrollbarsPass && docSize.width() <= fullVisibleSize.width() && docSize.height() <= fullVisibleSize.height()) {
     563                if (hScroll == ScrollbarAuto)
     564                    newHasHorizontalScrollbar = false;
     565                if (vScroll == ScrollbarAuto)
     566                    newHasVerticalScrollbar = false;
     567            }
     568            if (!newHasHorizontalScrollbar && hasHorizontalScrollbar && vScroll != ScrollbarAlwaysOn) {
     569                newHasVerticalScrollbar = false;
     570                needAnotherPass = true;
     571            }
     572            if (!newHasVerticalScrollbar && hasVerticalScrollbar && hScroll != ScrollbarAlwaysOn) {
    554573                newHasHorizontalScrollbar = false;
    555         }
    556         if (vScroll == ScrollbarAuto) {
    557             newHasVerticalScrollbar = docSize.height() > visibleHeight();
    558             if (newHasVerticalScrollbar && !m_updateScrollbarsPass && docSize.width() <= fullVisibleSize.width() && docSize.height() <= fullVisibleSize.height())
    559                 newHasVerticalScrollbar = false;
    560         }
    561 
    562         // If we ever turn one scrollbar off, always turn the other one off too.  Never ever
    563         // try to both gain/lose a scrollbar in the same pass.
    564         bool needAnotherPass = false;
    565         if (!newHasHorizontalScrollbar && hasHorizontalScrollbar && vScroll != ScrollbarAlwaysOn) {
    566             newHasVerticalScrollbar = false;
    567             needAnotherPass = true;
    568         }
    569 
    570         if (!newHasVerticalScrollbar && hasVerticalScrollbar && hScroll != ScrollbarAlwaysOn) {
    571             newHasHorizontalScrollbar = false;
    572             needAnotherPass = true;
     574                needAnotherPass = true;
     575            }
    573576        }
    574577
Note: See TracChangeset for help on using the changeset viewer.