OLD | NEW |
---|---|
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 2987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2998 | 2998 |
2999 ViewportDescription adjustedDescription = description; | 2999 ViewportDescription adjustedDescription = description; |
3000 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ e == ViewportDescription::ViewportMeta) { | 3000 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ e == ViewportDescription::ViewportMeta) { |
3001 if (adjustedDescription.maxWidth.type() == ExtendToZoom) | 3001 if (adjustedDescription.maxWidth.type() == ExtendToZoom) |
3002 adjustedDescription.maxWidth = Length(); // auto | 3002 adjustedDescription.maxWidth = Length(); // auto |
3003 adjustedDescription.minWidth = adjustedDescription.maxWidth; | 3003 adjustedDescription.minWidth = adjustedDescription.maxWidth; |
3004 adjustedDescription.minHeight = adjustedDescription.maxHeight; | 3004 adjustedDescription.minHeight = adjustedDescription.maxHeight; |
3005 } | 3005 } |
3006 float oldInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; | 3006 float oldInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; |
3007 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedDescription, m_size); | 3007 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedDescription, m_size); |
3008 | |
3009 if (settingsImpl()->clobberUserAgentInitialScaleQuirk() | |
3010 && m_pageScaleConstraintsSet.userAgentConstraints().initialScale != -1 | |
3011 && m_pageScaleConstraintsSet.userAgentConstraints().initialScale * devic eScaleFactor() <= 1) { | |
3012 if (!description.maxWidth.isFixed() | |
aelias_OOO_until_Jul13
2013/11/04 17:41:01
On second thought, I don't think you really want !
mnaganov (inactive)
2013/11/04 18:03:16
Makes sense. WebFrameTests still pass. Let me run
| |
3013 || (description.maxWidth.isAuto() && m_pageScaleConstraintsSet.pageD efinedConstraints().initialScale == 1.0f)) | |
3014 setInitialPageScaleOverride(-1); | |
3015 } | |
3008 m_pageScaleConstraintsSet.adjustForAndroidWebViewQuirks(adjustedDescription, m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor(), settings Impl()->supportDeprecatedTargetDensityDPI(), page()->settings().wideViewportQuir kEnabled(), page()->settings().useWideViewport(), page()->settings().loadWithOve rviewMode()); | 3016 m_pageScaleConstraintsSet.adjustForAndroidWebViewQuirks(adjustedDescription, m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor(), settings Impl()->supportDeprecatedTargetDensityDPI(), page()->settings().wideViewportQuir kEnabled(), page()->settings().useWideViewport(), page()->settings().loadWithOve rviewMode()); |
3009 float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; | 3017 float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; |
3010 if (oldInitialScale != newInitialScale && newInitialScale != -1) | 3018 if (oldInitialScale != newInitialScale && newInitialScale != -1) |
3011 m_pageScaleConstraintsSet.setNeedsReset(true); | 3019 m_pageScaleConstraintsSet.setNeedsReset(true); |
3012 | 3020 |
3013 | |
3014 updateMainFrameLayoutSize(); | 3021 updateMainFrameLayoutSize(); |
3015 } | 3022 } |
3016 | 3023 |
3017 void WebViewImpl::updateMainFrameLayoutSize() | 3024 void WebViewImpl::updateMainFrameLayoutSize() |
3018 { | 3025 { |
3019 if (m_fixedLayoutSizeLock || !mainFrameImpl()) | 3026 if (m_fixedLayoutSizeLock || !mainFrameImpl()) |
3020 return; | 3027 return; |
3021 | 3028 |
3022 FrameView* view = mainFrameImpl()->frameView(); | 3029 FrameView* view = mainFrameImpl()->frameView(); |
3023 if (!view) | 3030 if (!view) |
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4175 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); | 4182 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); |
4176 | 4183 |
4177 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4184 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4178 return false; | 4185 return false; |
4179 | 4186 |
4180 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4187 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4181 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); | 4188 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); |
4182 } | 4189 } |
4183 | 4190 |
4184 } // namespace WebKit | 4191 } // namespace WebKit |
OLD | NEW |