Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Unified Diff: third_party/WebKit/Source/core/html/ImageDocument.cpp

Issue 2730573003: Moved FrameHost::m_visualViewport to Page (Closed)
Patch Set: Fixed some compile errors on mac and android Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/ImageDocument.cpp
diff --git a/third_party/WebKit/Source/core/html/ImageDocument.cpp b/third_party/WebKit/Source/core/html/ImageDocument.cpp
index a434d553edfa512118e0b2d52c4c777d62e29585..10289f40106fb3858c78f2e4f49bb92b5995c61b 100644
--- a/third_party/WebKit/Source/core/html/ImageDocument.cpp
+++ b/third_party/WebKit/Source/core/html/ImageDocument.cpp
@@ -394,11 +394,11 @@ void ImageDocument::updateImageStyle() {
// To ensure the checker pattern is visible for large images, the
// checker size is dynamically adjusted to account for how much the
// page is currently being scaled.
- scale = frame()->host()->visualViewport().scale();
+ scale = frame()->page()->visualViewport().scale();
} else {
// The checker pattern is initialized based on how large the image is
// relative to the viewport.
- int viewportWidth = frame()->host()->visualViewport().size().width();
+ int viewportWidth = frame()->page()->visualViewport().size().width();
scale = viewportWidth / static_cast<double>(calculateDivWidth());
}
@@ -511,7 +511,7 @@ int ImageDocument::calculateDivWidth() {
// of the frame.
// * Images smaller in either dimension are centered along that axis.
LayoutSize imageSize = cachedImageSize(m_imageElement);
- int viewportWidth = frame()->host()->visualViewport().size().width();
+ int viewportWidth = frame()->page()->visualViewport().size().width();
// For huge images, minimum-scale=0.1 is still too big on small screens.
// Set the <div> width so that the image will shrink to fit the width of the
@@ -535,7 +535,7 @@ void ImageDocument::windowSizeChanged() {
// can display the full image without shrinking it, allowing a full-width
// reading mode for normal-width-huge-height images.
float viewportAspectRatio =
- frame()->host()->visualViewport().size().aspectRatio();
+ frame()->page()->visualViewport().size().aspectRatio();
int divHeight = std::max(imageSize.height().toInt(),
static_cast<int>(divWidth / viewportAspectRatio));
m_divElement->setInlineStyleProperty(CSSPropertyHeight, divHeight,
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698