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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 172203003: Don't ignore size updates that have a width and height == 0. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove setUseWideViewport from test Created 6 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2840 matching lines...) Expand 10 before | Expand all | Expand 10 after
2851 updateLayerTreeViewport(); 2851 updateLayerTreeViewport();
2852 2852
2853 // Relayout immediately to avoid violating the rule that needsLayout() 2853 // Relayout immediately to avoid violating the rule that needsLayout()
2854 // isn't set at the end of a layout. 2854 // isn't set at the end of a layout.
2855 if (view->needsLayout()) 2855 if (view->needsLayout())
2856 view->layout(); 2856 view->layout();
2857 } 2857 }
2858 2858
2859 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription & description) 2859 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription & description)
2860 { 2860 {
2861 if (!settings()->viewportEnabled() || !page() || !m_size.width || !m_size.he ight) 2861 if (!settings()->viewportEnabled() || !page() || (!m_size.width && !m_size.h eight))
2862 return; 2862 return;
2863 2863
2864 ViewportDescription adjustedDescription = description; 2864 ViewportDescription adjustedDescription = description;
2865 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ e == ViewportDescription::ViewportMeta) { 2865 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ e == ViewportDescription::ViewportMeta) {
2866 if (adjustedDescription.maxWidth.type() == ExtendToZoom) 2866 if (adjustedDescription.maxWidth.type() == ExtendToZoom)
2867 adjustedDescription.maxWidth = Length(); // auto 2867 adjustedDescription.maxWidth = Length(); // auto
2868 const int legacyWidthSnappingMagicNumber = 320; 2868 const int legacyWidthSnappingMagicNumber = 320;
2869 if (adjustedDescription.maxWidth.isFixed() && adjustedDescription.maxWid th.value() <= legacyWidthSnappingMagicNumber) 2869 if (adjustedDescription.maxWidth.isFixed() && adjustedDescription.maxWid th.value() <= legacyWidthSnappingMagicNumber)
2870 adjustedDescription.maxWidth = Length(DeviceWidth); 2870 adjustedDescription.maxWidth = Length(DeviceWidth);
2871 if (adjustedDescription.maxHeight.isFixed() && adjustedDescription.maxWi dth.value() <= m_size.height) 2871 if (adjustedDescription.maxHeight.isFixed() && adjustedDescription.maxWi dth.value() <= m_size.height)
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
3985 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 3985 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
3986 3986
3987 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 3987 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
3988 return false; 3988 return false;
3989 3989
3990 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 3990 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
3991 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 3991 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
3992 } 3992 }
3993 3993
3994 } // namespace blink 3994 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698