⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 173548 in webkit


Ignore:
Timestamp:
Sep 11, 2014, 5:32:05 PM (12 years ago)
Author:
Chris Fleizach
Message:

AX: Size of web view in Safari as reported by AX changes when adding/removing bars is wrong
​https://bugs.webkit.org/show_bug.cgi?id=136756

Reviewed by Beth Dakin.

Source/WebCore:

topContentInset not only seems to push the scroll view's origin down, but it also shrinks its height as well, which
was not accounted for in the original fix.

Modified: platform/mac-wk2/accessibility/content-inset-scrollview-frame.html

  • accessibility/AccessibilityScrollView.cpp:

(WebCore::AccessibilityScrollView::elementRect):

LayoutTests:

  • platform/mac-wk2/accessibility/content-inset-scrollview-frame-expected.txt:
  • platform/mac-wk2/accessibility/content-inset-scrollview-frame.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r173537 r173548  
     12014-09-11  Chris Fleizach  <cfleizach@apple.com>
     2
     3        AX: Size of web view in Safari as reported by AX changes when adding/removing bars is wrong
     4        https://bugs.webkit.org/show_bug.cgi?id=136756
     5
     6        Reviewed by Beth Dakin.
     7
     8        * platform/mac-wk2/accessibility/content-inset-scrollview-frame-expected.txt:
     9        * platform/mac-wk2/accessibility/content-inset-scrollview-frame.html:
     10
    1112014-09-11  Commit Queue  <commit-queue@webkit.org>
    212
  • trunk/LayoutTests/platform/mac-wk2/accessibility/content-inset-scrollview-frame-expected.txt

    r169093 r173548  
    66The position of the web area and the scroll view should be the same when there's no content inset
    77PASS webX == scrollViewX && webY == scrollViewY is true
     8
     9
    810After setting the content inset, the new y position should be less than the initial
    9 PASS scrollViewY - scrollView.y is 100
     11PASS newScrollViewY - scrollViewY is 100
     12
     13
     14The content inset also reduces the height of the scroll view, which should be reflected here.
     15PASS scrollViewHeight > newScrollViewHeight is true
     16
     17
    1018PASS successfullyParsed is true
    1119
  • trunk/LayoutTests/platform/mac-wk2/accessibility/content-inset-scrollview-frame.html

    r169093 r173548  
    1616        var webArea = accessibilityController.rootElement.childAtIndex(0);
    1717        var webX = webArea.x;
    18         var webY = webArea.y;
     18        var webY = webArea.y - webArea.height;
    1919
    2020        var scrollView = webArea.parentElement();
    2121        var scrollViewX = scrollView.x;
    22         var scrollViewY = scrollView.y;
    23  
     22        // to get what the y that we're expecting, we need to subtract the height, because Cocoa requires the bottom point to be consider the y origin.
     23        var scrollViewY = scrollView.y - scrollView.height;
     24        var scrollViewHeight = scrollView.height; 
     25
    2426        debug("The position of the web area and the scroll view should be the same when there's no content inset");
    2527        shouldBeTrue("webX == scrollViewX && webY == scrollViewY");
     28        debug("\n");
    2629 
    2730        window.internals.setTopContentInset(100);
    2831
     32        var newScrollViewHeight = scrollView.height;
     33        var newScrollViewY =  scrollView.y - scrollView.height;
    2934        debug("After setting the content inset, the new y position should be less than the initial");
    30         shouldBe("scrollViewY - scrollView.y", "100")
     35        shouldBe("newScrollViewY - scrollViewY", "100")
     36        debug("\n");
     37
     38        debug("The content inset also reduces the height of the scroll view, which should be reflected here.");
     39        shouldBeTrue("scrollViewHeight > newScrollViewHeight");
     40        debug("\n");
    3141    }
    3242</script>
  • trunk/Source/WebCore/ChangeLog

    r173546 r173548  
     12014-09-11  Chris Fleizach  <cfleizach@apple.com>
     2
     3        AX: Size of web view in Safari as reported by AX changes when adding/removing bars is wrong
     4        https://bugs.webkit.org/show_bug.cgi?id=136756
     5
     6        Reviewed by Beth Dakin.
     7
     8        topContentInset not only seems to push the scroll view's origin down, but it also shrinks its height as well, which
     9        was not accounted for in the original fix.
     10
     11        Modified: platform/mac-wk2/accessibility/content-inset-scrollview-frame.html
     12
     13        * accessibility/AccessibilityScrollView.cpp:
     14        (WebCore::AccessibilityScrollView::elementRect):
     15
    1162014-09-11  Roger Fong  <roger_fong@apple.com>
    217
  • trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp

    r171477 r173548  
    223223
    224224    LayoutRect rect = m_scrollView->frameRect();
    225     rect.setY(rect.y() + m_scrollView->topContentInset());
     225    float topContentInset = m_scrollView->topContentInset();
     226    // Top content inset pushes the frame down and shrinks it.
     227    rect.move(0, topContentInset);
     228    rect.contract(0, topContentInset);
    226229    return rect;
    227230}
Note: See TracChangeset for help on using the changeset viewer.