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

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

Issue 2646663002: [Blink] Don't center images in Android WebViews (Closed)
Patch Set: [Blink] Don't center images in Android WebViews Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5a716aa9331096f846fcd571083c1446490fd60f..526a8500a9fdf1b16fc6b3a7afde3fc528b9a256 100644
--- a/third_party/WebKit/Source/core/html/ImageDocument.cpp
+++ b/third_party/WebKit/Source/core/html/ImageDocument.cpp
@@ -48,6 +48,7 @@
#include "core/loader/FrameLoader.h"
#include "core/loader/FrameLoaderClient.h"
#include "core/loader/resource/ImageResource.h"
+#include "core/page/Page.h"
#include "platform/HostWindow.h"
#include "wtf/text/StringBuilder.h"
#include <limits>
@@ -594,7 +595,9 @@ ImageResource* ImageDocument::cachedImageResourceDeprecated() {
}
bool ImageDocument::shouldShrinkToFit() const {
- return frame()->isMainFrame();
+ bool isAndroidWebView =
+ page() ? page()->settings().getForceZeroLayoutHeight() : false;
gone 2017/01/19 01:06:28 Is there a better name for this variable here, btw
aelias_OOO_until_Jul13 2017/01/19 01:11:08 I'd suggest isWrapContentWebView.
+ return frame()->isMainFrame() && !isAndroidWebView;
}
DEFINE_TRACE(ImageDocument) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698