Title: [169084] trunk/Source/WebCore
Revision
169084
Author
[email protected]
Date
2014-05-19 16:56:55 -0700 (Mon, 19 May 2014)

Log Message

REGRESSION: Standalone images need to take topContentInset into account
https://bugs.webkit.org/show_bug.cgi?id=133092
-and corresponding-
<rdar://problem/16945791>

Reviewed by Darin Adler.

The FrameView’s size is accurate in terms of the NSWindow size, but that is not 
really what the ImageDocument code is looking for here. The ImageDocument wants to 
know the size of the unobscured viewport area. We should use visibleSize() for 
that.
* html/ImageDocument.cpp:
(WebCore::ImageDocument::scale):
(WebCore::ImageDocument::imageFitsInWindow):
(WebCore::ImageDocument::imageClicked):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (169083 => 169084)


--- trunk/Source/WebCore/ChangeLog	2014-05-19 23:55:47 UTC (rev 169083)
+++ trunk/Source/WebCore/ChangeLog	2014-05-19 23:56:55 UTC (rev 169084)
@@ -1,3 +1,21 @@
+2014-05-19  Beth Dakin  <[email protected]>
+
+        REGRESSION: Standalone images need to take topContentInset into account
+        https://bugs.webkit.org/show_bug.cgi?id=133092
+        -and corresponding-
+        <rdar://problem/16945791>
+
+        Reviewed by Darin Adler.
+
+        The FrameView’s size is accurate in terms of the NSWindow size, but that is not 
+        really what the ImageDocument code is looking for here. The ImageDocument wants to 
+        know the size of the unobscured viewport area. We should use visibleSize() for 
+        that.
+        * html/ImageDocument.cpp:
+        (WebCore::ImageDocument::scale):
+        (WebCore::ImageDocument::imageFitsInWindow):
+        (WebCore::ImageDocument::imageClicked):
+
 2014-05-19  Alex Christensen  <[email protected]>
 
         Collect web timing data on iOS.

Modified: trunk/Source/WebCore/html/ImageDocument.cpp (169083 => 169084)


--- trunk/Source/WebCore/html/ImageDocument.cpp	2014-05-19 23:55:47 UTC (rev 169083)
+++ trunk/Source/WebCore/html/ImageDocument.cpp	2014-05-19 23:56:55 UTC (rev 169084)
@@ -280,8 +280,9 @@
 
     LayoutSize imageSize = this->imageSize();
 
-    float widthScale = view->width() / imageSize.width().toFloat();
-    float heightScale = view->height() / imageSize.height().toFloat();
+    IntSize viewportSize = view->visibleSize();
+    float widthScale = viewportSize.width() / imageSize.width().toFloat();
+    float heightScale = viewportSize.height() / imageSize.height().toFloat();
 
     return std::min(widthScale, heightScale);
 }
@@ -327,8 +328,8 @@
         return true;
 
     LayoutSize imageSize = this->imageSize();
-    LayoutSize windowSize = LayoutSize(view->width(), view->height());
-    return imageSize.width() <= windowSize.width() && imageSize.height() <= windowSize.height();
+    IntSize viewportSize = view->visibleSize();
+    return imageSize.width() <= viewportSize.width() && imageSize.height() <= viewportSize.height();
 }
 
 
@@ -382,8 +383,9 @@
 
         float scale = this->scale();
 
-        int scrollX = static_cast<int>(x / scale - view()->width() / 2.0f);
-        int scrollY = static_cast<int>(y / scale - view()->height() / 2.0f);
+        IntSize viewportSize = view()->visibleSize();
+        int scrollX = static_cast<int>(x / scale - viewportSize.width() / 2.0f);
+        int scrollY = static_cast<int>(y / scale - viewportSize.height() / 2.0f);
 
         view()->setScrollPosition(IntPoint(scrollX, scrollY));
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to