⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 109288 in webkit


Ignore:
Timestamp:
Feb 29, 2012, 5:29:56 PM (15 years ago)
Author:
levin@chromium.org
Message:

[chromium] Add the ability to turn off autoresize.
​https://bugs.webkit.org/show_bug.cgi?id=77452

Reviewed by Darin Fisher.

Source/WebCore:

Test: fast/autoresize/turn-off-autoresize.html

  • page/FrameView.cpp:

(WebCore::FrameView::enableAutoSizeMode): Fix the code
path for turning off autoresize to set the scrollbars to auto.

Source/WebKit/chromium:

  • public/WebView.h:

(WebKit::WebViewImpl::enableAutoResizeMode): Cleaned up the api.
(WebKit::WebViewImpl::disableAutoResizeMode): Added the ability to disable auto-resize.
(WebKit::WebViewImpl::enableAutoResizeMode): Deprecated it.

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::enableAutoResizeMode): Adjust for new api.
(WebKit::WebViewImpl::disableAutoResizeMode): Allow turning off autoresize.
(WebKit::WebViewImpl::enableAutoResizeMode): Call the other two apis, but
this api will be deleted shortly.
(WebKit::WebViewImpl::configureAutoResizeMode): Common code.

  • src/WebViewImpl.h:

(WebViewImpl): Adjust to new public api.

Tools:

  • DumpRenderTree/chromium/LayoutTestController.cpp:

(LayoutTestController::LayoutTestController): Expose a way to turn off auto-resize.
(LayoutTestController::enableAutoResizeMode): Ditto and adjust to new WebKit api.
(LayoutTestController::disableAutoResizeMode): Ditto.

  • DumpRenderTree/chromium/LayoutTestController.h: Ditto.

LayoutTests:

  • fast/autoresize/turn-off-autoresize-expected.txt: Added.
  • fast/autoresize/turn-off-autoresize.html: Added.
Location:
trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r109283 r109288  
     12012-02-29  David Levin  <levin@chromium.org>
     2
     3        [chromium] Add the ability to turn off autoresize.
     4        https://bugs.webkit.org/show_bug.cgi?id=77452
     5
     6        Reviewed by Darin Fisher.
     7
     8        * fast/autoresize/turn-off-autoresize-expected.txt: Added.
     9        * fast/autoresize/turn-off-autoresize.html: Added.
     10
    1112012-02-29  Adam Klein  <adamk@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r109286 r109288  
     12012-02-29  David Levin  <levin@chromium.org>
     2
     3        [chromium] Add the ability to turn off autoresize.
     4        https://bugs.webkit.org/show_bug.cgi?id=77452
     5
     6        Reviewed by Darin Fisher.
     7
     8        Test: fast/autoresize/turn-off-autoresize.html
     9
     10        * page/FrameView.cpp:
     11        (WebCore::FrameView::enableAutoSizeMode): Fix the code
     12        path for turning off autoresize to set the scrollbars to auto.
     13
    1142012-02-29  David Barton  <dbarton@mathscribe.com>
    215
  • trunk/Source/WebCore/page/FrameView.cpp

    r108392 r109288  
    30253025    m_maxAutoSize = maxSize;
    30263026
    3027     if (!m_shouldAutoSize)
    3028         return;
    3029 
    30303027    setNeedsLayout();
    30313028    scheduleRelayout();
     3029    if (m_shouldAutoSize)
     3030        return;
     3031
     3032    // Since autosize mode forces the scrollbar mode, change them to being auto.
     3033    setVerticalScrollbarLock(false);
     3034    setHorizontalScrollbarLock(false);
     3035    setScrollbarModes(ScrollbarAuto, ScrollbarAuto);
    30323036}
    30333037
  • trunk/Source/WebKit/chromium/ChangeLog

    r109274 r109288  
     12012-02-29  David Levin  <levin@chromium.org>
     2
     3        [chromium] Add the ability to turn off autoresize.
     4        https://bugs.webkit.org/show_bug.cgi?id=77452
     5
     6        Reviewed by Darin Fisher.
     7
     8        * public/WebView.h:
     9        (WebKit::WebViewImpl::enableAutoResizeMode): Cleaned up the api.
     10        (WebKit::WebViewImpl::disableAutoResizeMode): Added the ability to disable auto-resize.
     11        (WebKit::WebViewImpl::enableAutoResizeMode): Deprecated it.
     12        * src/WebViewImpl.cpp:
     13        (WebKit::WebViewImpl::enableAutoResizeMode): Adjust for new api.
     14        (WebKit::WebViewImpl::disableAutoResizeMode): Allow turning off autoresize.
     15        (WebKit::WebViewImpl::enableAutoResizeMode): Call the other two apis, but
     16        this api will be deleted shortly.
     17        (WebKit::WebViewImpl::configureAutoResizeMode): Common code.
     18        * src/WebViewImpl.h:
     19        (WebViewImpl): Adjust to new public api.
     20
    1212012-02-29  Sheriff Bot  <webkit.review.bot@gmail.com>
    222
  • trunk/Source/WebKit/chromium/public/WebView.h

    r106146 r109288  
    261261    // content within the given bounds.
    262262    virtual void enableAutoResizeMode(
     263        const WebSize& minSize,
     264        const WebSize& maxSize) = 0;
     265
     266    // Turn off auto-resize.
     267    virtual void disableAutoResizeMode() = 0;
     268
     269    // DEPRECATED
     270    virtual void enableAutoResizeMode(
    263271        bool enable,
    264272        const WebSize& minSize,
    265273        const WebSize& maxSize) = 0;
    266 
    267274
    268275    // Media ---------------------------------------------------------------
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r108883 r109288  
    22652265}
    22662266
    2267 void WebViewImpl::enableAutoResizeMode(bool enable, const WebSize& minSize, const WebSize& maxSize)
    2268 {
    2269     m_shouldAutoResize = enable;
     2267
     2268void WebViewImpl::enableAutoResizeMode(const WebSize& minSize, const WebSize& maxSize)
     2269{
     2270    m_shouldAutoResize = true;
    22702271    m_minAutoSize = minSize;
    22712272    m_maxAutoSize = maxSize;
    2272     if (!mainFrameImpl() || !mainFrameImpl()->frame() || !mainFrameImpl()->frame()->view())
    2273         return;
    2274 
    2275     mainFrameImpl()->frame()->view()->enableAutoSizeMode(m_shouldAutoResize, m_minAutoSize, m_maxAutoSize);
     2273    configureAutoResizeMode();
     2274}
     2275
     2276void WebViewImpl::disableAutoResizeMode()
     2277{
     2278    m_shouldAutoResize = false;
     2279    configureAutoResizeMode();
     2280}
     2281
     2282void WebViewImpl::enableAutoResizeMode(bool enable, const WebSize& minSize, const WebSize& maxSize)
     2283{
     2284    if (enable)
     2285        enableAutoResizeMode(enable, minSize, maxSize);
     2286    else
     2287        disableAutoResizeMode();
    22762288}
    22772289
    … …  
    25862598}
    25872599
     2600void WebViewImpl::configureAutoResizeMode()
     2601{
     2602    if (!mainFrameImpl() || !mainFrameImpl()->frame() || !mainFrameImpl()->frame()->view())
     2603        return;
     2604
     2605    mainFrameImpl()->frame()->view()->enableAutoSizeMode(m_shouldAutoResize, m_minAutoSize, m_maxAutoSize);
     2606}
     2607
    25882608unsigned long WebViewImpl::createUniqueIdentifierForRequest()
    25892609{
  • trunk/Source/WebKit/chromium/src/WebViewImpl.h

    r108883 r109288  
    188188    virtual WebSize fixedLayoutSize() const;
    189189    virtual void setFixedLayoutSize(const WebSize&);
     190    virtual void enableAutoResizeMode(
     191        const WebSize& minSize,
     192        const WebSize& maxSize);
     193    virtual void disableAutoResizeMode();
    190194    virtual void enableAutoResizeMode(
    191195        bool enable,
    … …  
    535539
    536540    void sendResizeEventAndRepaint();
     541    void configureAutoResizeMode();
    537542
    538543#if USE(ACCELERATED_COMPOSITING)
  • trunk/Tools/ChangeLog

    r109282 r109288  
     12012-02-29  David Levin  <levin@chromium.org>
     2
     3        [chromium] Add the ability to turn off autoresize.
     4        https://bugs.webkit.org/show_bug.cgi?id=77452
     5
     6        Reviewed by Darin Fisher.
     7
     8        * DumpRenderTree/chromium/LayoutTestController.cpp:
     9        (LayoutTestController::LayoutTestController): Expose a way to turn off auto-resize.
     10        (LayoutTestController::enableAutoResizeMode): Ditto and adjust to new WebKit api.
     11        (LayoutTestController::disableAutoResizeMode):  Ditto.
     12        * DumpRenderTree/chromium/LayoutTestController.h: Ditto.
     13
    1142012-02-29  Dirk Pranke  <dpranke@chromium.org>
    215
  • trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp

    r109236 r109288  
    105105    bindMethod("didLosePointerLock", &LayoutTestController::didLosePointerLock);
    106106#endif
     107    bindMethod("disableAutoResizeMode", &LayoutTestController::disableAutoResizeMode);
    107108    bindMethod("disableImageLoading", &LayoutTestController::disableImageLoading);
    108109    bindMethod("display", &LayoutTestController::display);
    … …  
    11301131    WebKit::WebSize maxSize(maxWidth, maxHeight);
    11311132
    1132     m_shell->webView()->enableAutoResizeMode(true, minSize, maxSize);
     1133    m_shell->webView()->enableAutoResizeMode(minSize, maxSize);
     1134    result->set(true);
     1135}
     1136
     1137void LayoutTestController::disableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result)
     1138{
     1139    if (arguments.size() !=2) {
     1140        result->set(false);
     1141        return;
     1142    }
     1143    int newWidth = cppVariantToInt32(arguments[0]);
     1144    int newHeight = cppVariantToInt32(arguments[1]);
     1145    WebKit::WebSize newSize(newWidth, newHeight);
     1146
     1147    m_shell->webViewHost()->setWindowRect(WebRect(0, 0, newSize.width, newSize.height));
     1148    m_shell->webView()->disableAutoResizeMode();
     1149    m_shell->webView()->resize(newSize);
    11331150    result->set(true);
    11341151}
  • trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h

    r109236 r109288  
    242242    void elementDoesAutoCompleteForElementWithId(const CppArgumentList&, CppVariant*);
    243243    void enableAutoResizeMode(const CppArgumentList&, CppVariant*);
     244    void disableAutoResizeMode(const CppArgumentList&, CppVariant*);
    244245    void numberOfActiveAnimations(const CppArgumentList&, CppVariant*);
    245246    void suspendAnimations(const CppArgumentList&, CppVariant*);
Note: See TracChangeset for help on using the changeset viewer.