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

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

Issue 219123002: Read the default min-width value from the UA style sheets (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
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 2837 matching lines...) Expand 10 before | Expand all | Expand 10 after
2848 float oldInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; 2848 float oldInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale;
2849 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedDescription, m_size); 2849 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedDescription, m_size);
2850 2850
2851 if (settingsImpl()->clobberUserAgentInitialScaleQuirk() 2851 if (settingsImpl()->clobberUserAgentInitialScaleQuirk()
2852 && m_pageScaleConstraintsSet.userAgentConstraints().initialScale != -1 2852 && m_pageScaleConstraintsSet.userAgentConstraints().initialScale != -1
2853 && m_pageScaleConstraintsSet.userAgentConstraints().initialScale * devic eScaleFactor() <= 1) { 2853 && m_pageScaleConstraintsSet.userAgentConstraints().initialScale * devic eScaleFactor() <= 1) {
2854 if (description.maxWidth == Length(DeviceWidth) 2854 if (description.maxWidth == Length(DeviceWidth)
2855 || (description.maxWidth.type() == ExtendToZoom && m_pageScaleConstr aintsSet.pageDefinedConstraints().initialScale == 1.0f)) 2855 || (description.maxWidth.type() == ExtendToZoom && m_pageScaleConstr aintsSet.pageDefinedConstraints().initialScale == 1.0f))
2856 setInitialPageScaleOverride(-1); 2856 setInitialPageScaleOverride(-1);
2857 } 2857 }
2858 m_pageScaleConstraintsSet.adjustForAndroidWebViewQuirks(adjustedDescription, m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor(), settings Impl()->supportDeprecatedTargetDensityDPI(), page()->settings().wideViewportQuir kEnabled(), page()->settings().useWideViewport(), page()->settings().loadWithOve rviewMode(), settingsImpl()->viewportMetaNonUserScalableQuirk()); 2858
2859 Length defaultMinWidth = page()->mainFrame()->document()->viewportDefaultMin Width();
2860 m_pageScaleConstraintsSet.adjustForAndroidWebViewQuirks(adjustedDescription, m_size, defaultMinWidth.intValue(), deviceScaleFactor(), settingsImpl()->suppor tDeprecatedTargetDensityDPI(), page()->settings().wideViewportQuirkEnabled(), pa ge()->settings().useWideViewport(), page()->settings().loadWithOverviewMode(), s ettingsImpl()->viewportMetaNonUserScalableQuirk());
2859 float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; 2861 float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale;
2860 if (oldInitialScale != newInitialScale && newInitialScale != -1) { 2862 if (oldInitialScale != newInitialScale && newInitialScale != -1) {
2861 m_pageScaleConstraintsSet.setNeedsReset(true); 2863 m_pageScaleConstraintsSet.setNeedsReset(true);
2862 if (mainFrameImpl() && mainFrameImpl()->frameView()) 2864 if (mainFrameImpl() && mainFrameImpl()->frameView())
2863 mainFrameImpl()->frameView()->setNeedsLayout(); 2865 mainFrameImpl()->frameView()->setNeedsLayout();
2864 } 2866 }
2865 2867
2866 updateMainFrameLayoutSize(); 2868 updateMainFrameLayoutSize();
2867 } 2869 }
2868 2870
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
4003 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4005 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4004 4006
4005 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4007 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4006 return false; 4008 return false;
4007 4009
4008 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4010 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4009 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4011 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4010 } 4012 }
4011 4013
4012 } // namespace blink 4014 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698