Title: [173548] trunk
Revision
173548
Author
cfleiz...@apple.com
Date
2014-09-11 17:32:05 -0700 (Thu, 11 Sep 2014)

Log 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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (173547 => 173548)


--- trunk/LayoutTests/ChangeLog	2014-09-11 23:12:53 UTC (rev 173547)
+++ trunk/LayoutTests/ChangeLog	2014-09-12 00:32:05 UTC (rev 173548)
@@ -1,3 +1,13 @@
+2014-09-11  Chris Fleizach  <cfleiz...@apple.com>
+
+        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.
+
+        * platform/mac-wk2/accessibility/content-inset-scrollview-frame-expected.txt:
+        * platform/mac-wk2/accessibility/content-inset-scrollview-frame.html:
+
 2014-09-11  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r173530.

Modified: trunk/LayoutTests/platform/mac-wk2/accessibility/content-inset-scrollview-frame-expected.txt (173547 => 173548)


--- trunk/LayoutTests/platform/mac-wk2/accessibility/content-inset-scrollview-frame-expected.txt	2014-09-11 23:12:53 UTC (rev 173547)
+++ trunk/LayoutTests/platform/mac-wk2/accessibility/content-inset-scrollview-frame-expected.txt	2014-09-12 00:32:05 UTC (rev 173548)
@@ -5,8 +5,16 @@
 
 The position of the web area and the scroll view should be the same when there's no content inset
 PASS webX == scrollViewX && webY == scrollViewY is true
+
+
 After setting the content inset, the new y position should be less than the initial
-PASS scrollViewY - scrollView.y is 100
+PASS newScrollViewY - scrollViewY is 100
+
+
+The content inset also reduces the height of the scroll view, which should be reflected here.
+PASS scrollViewHeight > newScrollViewHeight is true
+
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/platform/mac-wk2/accessibility/content-inset-scrollview-frame.html (173547 => 173548)


--- trunk/LayoutTests/platform/mac-wk2/accessibility/content-inset-scrollview-frame.html	2014-09-11 23:12:53 UTC (rev 173547)
+++ trunk/LayoutTests/platform/mac-wk2/accessibility/content-inset-scrollview-frame.html	2014-09-12 00:32:05 UTC (rev 173548)
@@ -15,19 +15,29 @@
     if (window.accessibilityController) {
         var webArea = accessibilityController.rootElement.childAtIndex(0);
         var webX = webArea.x;
-        var webY = webArea.y;
+        var webY = webArea.y - webArea.height;
 
         var scrollView = webArea.parentElement();
         var scrollViewX = scrollView.x;
-        var scrollViewY = scrollView.y;
-  
+        // 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.
+        var scrollViewY = scrollView.y - scrollView.height;
+        var scrollViewHeight = scrollView.height;  
+
         debug("The position of the web area and the scroll view should be the same when there's no content inset");
         shouldBeTrue("webX == scrollViewX && webY == scrollViewY");
+        debug("\n");
  
         window.internals.setTopContentInset(100);
 
+        var newScrollViewHeight = scrollView.height;
+        var newScrollViewY =  scrollView.y - scrollView.height;
         debug("After setting the content inset, the new y position should be less than the initial");
-        shouldBe("scrollViewY - scrollView.y", "100")
+        shouldBe("newScrollViewY - scrollViewY", "100")
+        debug("\n");
+
+        debug("The content inset also reduces the height of the scroll view, which should be reflected here.");
+        shouldBeTrue("scrollViewHeight > newScrollViewHeight");
+        debug("\n");
     }
 </script>
 

Modified: trunk/Source/WebCore/ChangeLog (173547 => 173548)


--- trunk/Source/WebCore/ChangeLog	2014-09-11 23:12:53 UTC (rev 173547)
+++ trunk/Source/WebCore/ChangeLog	2014-09-12 00:32:05 UTC (rev 173548)
@@ -1,3 +1,18 @@
+2014-09-11  Chris Fleizach  <cfleiz...@apple.com>
+
+        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.
+
+        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):
+
 2014-09-11  Roger Fong  <roger_f...@apple.com>
 
         [Windows] Unreviewed build fix.

Modified: trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp (173547 => 173548)


--- trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp	2014-09-11 23:12:53 UTC (rev 173547)
+++ trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp	2014-09-12 00:32:05 UTC (rev 173548)
@@ -222,7 +222,10 @@
         return LayoutRect();
 
     LayoutRect rect = m_scrollView->frameRect();
-    rect.setY(rect.y() + m_scrollView->topContentInset());
+    float topContentInset = m_scrollView->topContentInset();
+    // Top content inset pushes the frame down and shrinks it.
+    rect.move(0, topContentInset);
+    rect.contract(0, topContentInset);
     return rect;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to