Commit df985172 authored by antti@apple.com's avatar antti@apple.com

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.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 07c6de7e
2014-01-22 Antti Koivisto <antti@apple.com>
Update overlay scrollbars in single pass
https://bugs.webkit.org/show_bug.cgi?id=127289
* 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.
2014-01-22 ChangSeok Oh <changseok.oh@collabora.com>
Unreviewed GTK gardening
......@@ -28,6 +28,10 @@ if (window.accessibilityController) {
shouldBe("body.childAtIndex(0).childrenCount", "0");
document.getElementById("iframe").setAttribute("aria-hidden", "false");
document.getElementById("iframe").contentWindow.document.body.offsetWidth;
document.body.offsetWidth;
shouldBe("body.childrenCount", "4");
shouldBe("body.childAtIndex(0).childAtIndex(0).childAtIndex(0).role", "'AXRole: AXWebArea'");
......
2014-01-22 Antti Koivisto <antti@apple.com>
Update overlay scrollbars in single pass
https://bugs.webkit.org/show_bug.cgi?id=127289
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.
2014-01-22 Mihnea Ovidenie <mihnea@adobe.com>
[CSSRegions] Incorrect layout of a region pseudo children
......@@ -505,10 +505,12 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset)
if (m_inUpdateScrollbars || prohibitsScrolling() || platformWidget())
return;
bool hasOverlayScrollbars = (!m_horizontalScrollbar || m_horizontalScrollbar->isOverlayScrollbar()) && (!m_verticalScrollbar || m_verticalScrollbar->isOverlayScrollbar());
// If we came in here with the view already needing a layout, then go ahead and do that
// first. (This will be the common case, e.g., when the page changes due to window resizing for example).
// This layout will not re-enter updateScrollbars and does not count towards our max layout pass total.
if (!m_scrollbarsSuppressed) {
if (!m_scrollbarsSuppressed && !hasOverlayScrollbars) {
m_inUpdateScrollbars = true;
visibleContentsResized();
m_inUpdateScrollbars = false;
......@@ -548,28 +550,29 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset)
IntSize docSize = totalContentsSize();
IntSize fullVisibleSize = visibleContentRect(IncludeScrollbars).size();
if (hScroll == ScrollbarAuto) {
if (hScroll == ScrollbarAuto)
newHasHorizontalScrollbar = docSize.width() > visibleWidth();
if (newHasHorizontalScrollbar && !m_updateScrollbarsPass && docSize.width() <= fullVisibleSize.width() && docSize.height() <= fullVisibleSize.height())
newHasHorizontalScrollbar = false;
}
if (vScroll == ScrollbarAuto) {
if (vScroll == ScrollbarAuto)
newHasVerticalScrollbar = docSize.height() > visibleHeight();
if (newHasVerticalScrollbar && !m_updateScrollbarsPass && docSize.width() <= fullVisibleSize.width() && docSize.height() <= fullVisibleSize.height())
newHasVerticalScrollbar = false;
}
// If we ever turn one scrollbar off, always turn the other one off too. Never ever
// try to both gain/lose a scrollbar in the same pass.
bool needAnotherPass = false;
if (!newHasHorizontalScrollbar && hasHorizontalScrollbar && vScroll != ScrollbarAlwaysOn) {
newHasVerticalScrollbar = false;
needAnotherPass = true;
}
if (!newHasVerticalScrollbar && hasVerticalScrollbar && hScroll != ScrollbarAlwaysOn) {
newHasHorizontalScrollbar = false;
needAnotherPass = true;
if (!hasOverlayScrollbars) {
// If we ever turn one scrollbar off, always turn the other one off too. Never ever
// try to both gain/lose a scrollbar in the same pass.
if (!m_updateScrollbarsPass && docSize.width() <= fullVisibleSize.width() && docSize.height() <= fullVisibleSize.height()) {
if (hScroll == ScrollbarAuto)
newHasHorizontalScrollbar = false;
if (vScroll == ScrollbarAuto)
newHasVerticalScrollbar = false;
}
if (!newHasHorizontalScrollbar && hasHorizontalScrollbar && vScroll != ScrollbarAlwaysOn) {
newHasVerticalScrollbar = false;
needAnotherPass = true;
}
if (!newHasVerticalScrollbar && hasVerticalScrollbar && hScroll != ScrollbarAlwaysOn) {
newHasHorizontalScrollbar = false;
needAnotherPass = true;
}
}
if (hasHorizontalScrollbar != newHasHorizontalScrollbar && (hasHorizontalScrollbar || !avoidScrollbarCreation())) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment