Changeset 99195 in webkit
- Timestamp:
- Nov 3, 2011 8:22:16 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r99190 r99195 1 2011-11-03 Fady Samuel <fsamuel@chromium.org> 2 3 Removing line in computeViewportAttributes that enforces a minimum scale factor to never allow zooming out more than viewport 4 https://bugs.webkit.org/show_bug.cgi?id=70609 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Operations in computeViewportAttributes that are not a part of the spec: 9 10 http://www.w3.org/TR/2011/WD-css-device-adapt-20110915/#constraining-viewport-property-values 11 12 were moved into the functions restrictMinimumScaleFactorToViewportSize and 13 restrictScaleFactorToInitialScaleIfNotUserScalable. 14 15 * WebCore.exp.in: 16 * dom/ViewportArguments.cpp: 17 (WebCore::computeViewportAttributes): 18 (WebCore::restrictMinimumScaleFactorToViewportSize): 19 (WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable): 20 * dom/ViewportArguments.h: 21 1 22 2011-11-03 Andreas Kling <kling@webkit.org> 2 23 -
trunk/Source/WebCore/WebCore.exp.in
r99126 r99195 653 653 __ZN7WebCore25addLanguageChangeObserverEPvPFvS0_E 654 654 __ZN7WebCore25computeViewportAttributesENS_17ViewportArgumentsEiiiiNS_7IntSizeE 655 __ZN7WebCore50restrictScaleFactorToInitialScaleIfNotUserScalableERNS_18ViewportAttributesE 656 __ZN7WebCore40restrictMinimumScaleFactorToViewportSizeERNS_18ViewportAttributesENS_7IntSizeE 655 657 __ZN7WebCore25contextMenuItemTagOutlineEv 656 658 __ZN7WebCore26CSSMutableStyleDeclarationC1Ev -
trunk/Source/WebCore/dom/ViewportArguments.cpp
r99175 r99195 181 181 result.layoutSize.setHeight(static_cast<int>(roundf(height))); 182 182 183 // Update minimum scale factor, to never allow zooming out more than viewport184 result.minimumScale = max<float>(result.minimumScale, max(availableWidth / width, availableHeight / height));185 186 183 result.userScalable = args.userScalable; 187 // Make maximum and minimum scale equal to the initial scale if user is not allowed to zoom in/out. 188 if (!args.userScalable) 184 185 return result; 186 } 187 188 void restrictMinimumScaleFactorToViewportSize(ViewportAttributes& result, IntSize visibleViewport) 189 { 190 float availableWidth = visibleViewport.width(); 191 float availableHeight = visibleViewport.height(); 192 193 if (result.devicePixelRatio != 1.0) { 194 availableWidth /= result.devicePixelRatio; 195 availableHeight /= result.devicePixelRatio; 196 } 197 198 result.minimumScale = max<float>(result.minimumScale, max(availableWidth / result.layoutSize.width(), availableHeight / result.layoutSize.height())); 199 } 200 201 void restrictScaleFactorToInitialScaleIfNotUserScalable(ViewportAttributes& result) 202 { 203 if (!result.userScalable) 189 204 result.maximumScale = result.minimumScale = result.initialScale; 190 191 return result;192 205 } 193 206 -
trunk/Source/WebCore/dom/ViewportArguments.h
r99173 r99195 108 108 109 109 ViewportAttributes computeViewportAttributes(ViewportArguments args, int desktopWidth, int deviceWidth, int deviceHeight, int deviceDPI, IntSize visibleViewport); 110 void restrictMinimumScaleFactorToViewportSize(ViewportAttributes& result, IntSize visibleViewport); 111 void restrictScaleFactorToInitialScaleIfNotUserScalable(ViewportAttributes& result); 110 112 111 113 void setViewportFeature(const String& keyString, const String& valueString, Document*, void* data); -
trunk/Source/WebKit/efl/ChangeLog
r99155 r99195 1 2011-11-03 Fady Samuel <fsamuel@chromium.org> 2 3 Removing line in computeViewportAttributes that enforces a minimum scale factor to never allow zooming out more than viewport 4 https://bugs.webkit.org/show_bug.cgi?id=70609 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 * ewk/ewk_view.cpp: 9 (_ewk_view_viewport_attributes_compute): 10 1 11 2011-11-03 Dongwoo Im <dw.im@samsung.com> 2 12 -
trunk/Source/WebKit/efl/ewk/ewk_view.cpp
r99155 r99195 1089 1089 1090 1090 WebCore::ViewportAttributes attributes = WebCore::computeViewportAttributes(priv->viewportArguments, desktopWidth, deviceRect.width(), deviceRect.height(), deviceDPI, availableRect.size()); 1091 WebCore::restrictMinimumScaleFactorToViewportSize(attributes, availableRect.size()); 1092 WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(attributes); 1091 1093 1092 1094 return attributes; -
trunk/Source/WebKit/gtk/ChangeLog
r99108 r99195 1 2011-11-03 Fady Samuel <fsamuel@chromium.org> 2 3 Removing line in computeViewportAttributes that enforces a minimum scale factor to never allow zooming out more than viewport 4 https://bugs.webkit.org/show_bug.cgi?id=70609 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: 9 (DumpRenderTreeSupportGtk::dumpConfigurationForViewport): 10 * webkit/webkitviewportattributes.cpp: 11 (webkitViewportAttributesRecompute): 12 1 13 2011-11-02 Jon Lee <jonlee@apple.com> 2 14 -
trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
r97746 r99195 712 712 ViewportArguments arguments = webView->priv->corePage->mainFrame()->document()->viewportArguments(); 713 713 ViewportAttributes attrs = computeViewportAttributes(arguments, /* default layout width for non-mobile pages */ 980, deviceWidth, deviceHeight, deviceDPI, IntSize(availableWidth, availableHeight)); 714 714 restrictMinimumScaleFactorToViewportSize(attrs, IntSize(availableWidth, availableHeight)); 715 restrictScaleFactorToInitialScaleIfNotUserScalable(attrs); 715 716 fprintf(stdout, "viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n", attrs.layoutSize.width(), attrs.layoutSize.height(), attrs.initialScale, attrs.minimumScale, attrs.maximumScale, attrs.userScalable); 716 717 } -
trunk/Source/WebKit/gtk/webkit/webkitviewportattributes.cpp
r95901 r99195 536 536 537 537 ViewportAttributes attributes = computeViewportAttributes(arguments, priv->desktopWidth, priv->deviceWidth, priv->deviceHeight, priv->deviceDPI, IntSize(priv->availableWidth, priv->availableHeight)); 538 restrictMinimumScaleFactorToViewportSize(attributes, IntSize(priv->availableWidth, priv->availableHeight)); 539 restrictScaleFactorToInitialScaleIfNotUserScalable(attributes); 538 540 539 541 priv->width = attributes.layoutSize.width(); -
trunk/Source/WebKit/qt/Api/qwebpage.cpp
r99108 r99195 2559 2559 2560 2560 WebCore::ViewportAttributes conf = WebCore::computeViewportAttributes(d->viewportArguments(), desktopWidth, deviceWidth, deviceHeight, qt_defaultDpi(), availableSize); 2561 WebCore::restrictMinimumScaleFactorToViewportSize(conf, availableSize); 2562 WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(conf); 2561 2563 2562 2564 result.m_isValid = true; -
trunk/Source/WebKit/qt/ChangeLog
r99178 r99195 1 2011-11-03 Fady Samuel <fsamuel@chromium.org> 2 3 Removing line in computeViewportAttributes that enforces a minimum scale factor to never allow zooming out more than viewport 4 https://bugs.webkit.org/show_bug.cgi?id=70609 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 * Api/qwebpage.cpp: 9 (QWebPage::viewportAttributesForSize): 10 * WebCoreSupport/DumpRenderTreeSupportQt.cpp: 11 (DumpRenderTreeSupportQt::viewportAsText): 12 1 13 2011-11-03 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> 2 14 -
trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
r98975 r99195 766 766 /* device-dpi */ deviceDPI, 767 767 availableSize); 768 WebCore::restrictMinimumScaleFactorToViewportSize(conf, availableSize); 769 WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(conf); 768 770 769 771 QString res; -
trunk/Source/WebKit2/ChangeLog
r99194 r99195 1 2011-11-03 Fady Samuel <fsamuel@chromium.org> 2 3 Removing line in computeViewportAttributes that enforces a minimum scale factor to never allow zooming out more than viewport 4 https://bugs.webkit.org/show_bug.cgi?id=70609 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 * UIProcess/API/qt/qtouchwebview.cpp: 9 (QTouchWebViewPrivate::updateViewportConstraints): 10 * WebProcess/WebPage/WebPage.cpp: 11 (WebKit::WebPage::viewportConfigurationAsText): 12 1 13 2011-11-03 Andras Becsi <andras.becsi@nokia.com> 2 14 -
trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebview.cpp
r99192 r99195 93 93 94 94 WebCore::ViewportAttributes attr = WebCore::computeViewportAttributes(viewportArguments, wkPrefs->layoutFallbackWidth(), wkPrefs->deviceWidth(), wkPrefs->deviceHeight(), wkPrefs->deviceDPI(), availableSize); 95 WebCore::restrictMinimumScaleFactorToViewport(attr, availableSize); 96 WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(attr); 95 97 96 98 QtViewportInteractionEngine::Constraints newConstraints; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r99121 r99195 2619 2619 ViewportArguments arguments = mainFrame()->document()->viewportArguments(); 2620 2620 ViewportAttributes attrs = WebCore::computeViewportAttributes(arguments, /* default layout width for non-mobile pages */ 980, deviceWidth, deviceHeight, deviceDPI, IntSize(availableWidth, availableHeight)); 2621 WebCore::restrictMinimumScaleFactorToViewportSize(attrs, IntSize(availableWidth, availableHeight)); 2622 WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(attrs); 2621 2623 return String::format("viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n", attrs.layoutSize.width(), attrs.layoutSize.height(), attrs.initialScale, attrs.minimumScale, attrs.maximumScale, attrs.userScalable); 2622 2624 }
Note: See TracChangeset
for help on using the changeset viewer.