Changeset 167861 in webkit


Ignore:
Timestamp:
Apr 27, 2014 1:43:52 PM (10 years ago)
Author:
weinig@apple.com
Message:

[iOS WebKit2] Add support for text autosizing
<rdar://problem/16545245>
https://bugs.webkit.org/show_bug.cgi?id=132237

Reviewed by Tim Horton.

../WebCore:
Move text autosizing width from Frame to Page, as it is a Page level concept.

  • WebCore.exp.in:
  • page/Frame.cpp:

(WebCore::Frame::textAutosizingWidth): Deleted.
(WebCore::Frame::setTextAutosizingWidth): Deleted.

  • page/Frame.h:
  • page/FrameView.cpp:

(WebCore::FrameView::layout):

  • page/Page.cpp:

(WebCore::Page::Page):

  • page/Page.h:

(WebCore::Page::textAutosizingWidth):
(WebCore::Page::setTextAutosizingWidth):

../WebKit/mac:

  • WebView/WebFrame.mm:

(-[WebFrame _setTextAutosizingWidth:]):
Forward setting of the text autosizing width to the Page.

../WebKit2:

  • Shared/WebPageCreationParameters.cpp:

(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):

  • Shared/WebPageCreationParameters.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::creationParameters):

  • UIProcess/WebPageProxy.h:
  • UIProcess/ios/WebPageProxyIOS.mm:

(WebKit::WebPageProxy::textAutosizingWidth):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::WebPage):
Pass the text autosizing width from the UIProcess to WebProcess.

Location:
trunk/Source
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r167857 r167861  
     12014-04-27  Sam Weinig  <sam@webkit.org>
     2
     3        [iOS WebKit2] Add support for text autosizing
     4        <rdar://problem/16545245>
     5        https://bugs.webkit.org/show_bug.cgi?id=132237
     6
     7        Reviewed by Tim Horton.
     8
     9        Move text autosizing width from Frame to Page, as it is a Page level concept.
     10
     11        * WebCore.exp.in:
     12        * page/Frame.cpp:
     13        (WebCore::Frame::textAutosizingWidth): Deleted.
     14        (WebCore::Frame::setTextAutosizingWidth): Deleted.
     15        * page/Frame.h:
     16        * page/FrameView.cpp:
     17        (WebCore::FrameView::layout):
     18        * page/Page.cpp:
     19        (WebCore::Page::Page):
     20        * page/Page.h:
     21        (WebCore::Page::textAutosizingWidth):
     22        (WebCore::Page::setTextAutosizingWidth):
     23
    1242014-04-27  Zan Dobersek  <zdobersek@igalia.com>
    225
  • trunk/Source/WebCore/WebCore.exp.in

    r167853 r167861  
    31143114#if ENABLE(IOS_TEXT_AUTOSIZING)
    31153115__ZN7WebCore12RenderObject19resetTextAutosizingEv
    3116 __ZN7WebCore5Frame22setTextAutosizingWidthEf
    31173116#endif
    31183117
  • trunk/Source/WebCore/page/Frame.cpp

    r167809 r167861  
    486486}
    487487
    488 #if ENABLE(IOS_TEXT_AUTOSIZING)
    489 float Frame::textAutosizingWidth() const
    490 {
    491     return m_textAutosizingWidth;
    492 }
    493 
    494 void Frame::setTextAutosizingWidth(float width)
    495 {
    496     m_textAutosizingWidth = width;
    497 }
    498 #endif
    499 
    500488#if PLATFORM(IOS)
    501489void Frame::scrollOverflowLayer(RenderLayer* layer, const IntRect& visibleRect, const IntRect& exposeRect)
  • trunk/Source/WebCore/page/Frame.h

    r167594 r167861  
    241241        String matchLabelsAgainstElement(const Vector<String>& labels, Element*);
    242242
    243 #if ENABLE(IOS_TEXT_AUTOSIZING)
    244         void setTextAutosizingWidth(float);
    245         float textAutosizingWidth() const;
    246 #endif
    247 
    248243#if PLATFORM(IOS)
    249244        // Scroll the selection in an overflow layer on iOS.
     
    326321#endif
    327322
    328 #if ENABLE(IOS_TEXT_AUTOSIZING)
    329         float m_textAutosizingWidth;
    330 #endif
    331 
    332323        float m_pageZoomFactor;
    333324        float m_textZoomFactor;
  • trunk/Source/WebCore/page/FrameView.cpp

    r167663 r167861  
    12861286#if ENABLE(IOS_TEXT_AUTOSIZING)
    12871287        float minZoomFontSize = frame().settings().minimumZoomFontSize();
    1288         float visWidth = frame().page()->mainFrame().textAutosizingWidth();
     1288        float visWidth = frame().page()->textAutosizingWidth();
    12891289        if (minZoomFontSize && visWidth && !root->view().printing()) {
    12901290            root->adjustComputedFontSizesOnBlocks(minZoomFontSize, visWidth);   
  • trunk/Source/WebCore/page/Page.cpp

    r167630 r167861  
    163163    , m_deviceScaleFactor(1)
    164164    , m_topContentInset(0)
     165#if ENABLE(IOS_TEXT_AUTOSIZING)
     166    , m_textAutosizingWidth(0)
     167#endif
    165168    , m_suppressScrollbarAnimations(false)
    166169    , m_verticalScrollElasticity(ScrollElasticityAllowed)
     
    784787        view->topContentInsetDidChange();
    785788}
    786    
     789
    787790void Page::setShouldSuppressScrollbarAnimations(bool suppressAnimations)
    788791{
  • trunk/Source/WebCore/page/Page.h

    r167811 r167861  
    283283    float topContentInset() const { return m_topContentInset; }
    284284    void setTopContentInset(float);
    285 
     285   
     286#if ENABLE(IOS_TEXT_AUTOSIZING)
     287    float textAutosizingWidth() const { return m_textAutosizingWidth; }
     288    void setTextAutosizingWidth(float textAutosizingWidth) { m_textAutosizingWidth = textAutosizingWidth; }
     289#endif
     290   
    286291    bool shouldSuppressScrollbarAnimations() const { return m_suppressScrollbarAnimations; }
    287292    void setShouldSuppressScrollbarAnimations(bool suppressAnimations);
     
    505510
    506511    float m_topContentInset;
    507 
     512   
     513#if ENABLE(IOS_TEXT_AUTOSIZING)
     514    float m_textAutosizingWidth;
     515#endif
     516   
    508517    bool m_suppressScrollbarAnimations;
    509518   
  • trunk/Source/WebKit/mac/ChangeLog

    r167825 r167861  
     12014-04-27  Sam Weinig  <sam@webkit.org>
     2
     3        [iOS WebKit2] Add support for text autosizing
     4        <rdar://problem/16545245>
     5        https://bugs.webkit.org/show_bug.cgi?id=132237
     6
     7        Reviewed by Tim Horton.
     8
     9        * WebView/WebFrame.mm:
     10        (-[WebFrame _setTextAutosizingWidth:]):
     11        Forward setting of the text autosizing width to the Page.
     12
    1132014-04-25  Dean Jackson  <dino@apple.com>
    214
  • trunk/Source/WebKit/mac/WebView/WebFrame.mm

    r165870 r167861  
    19161916- (void)_setTextAutosizingWidth:(CGFloat)width
    19171917{
    1918     WebCore::Frame *frame = core(self);
    1919     frame->setTextAutosizingWidth(width);
     1918    WebCore::Frame* frame = core(self);
     1919    Page* page = frame->page();
     1920    if (!page)
     1921        return;
     1922
     1923    page->setTextAutosizingWidth(width);
    19201924}
    19211925#else
  • trunk/Source/WebKit2/ChangeLog

    r167860 r167861  
     12014-04-27  Sam Weinig  <sam@webkit.org>
     2
     3        [iOS WebKit2] Add support for text autosizing
     4        <rdar://problem/16545245>
     5        https://bugs.webkit.org/show_bug.cgi?id=132237
     6
     7        Reviewed by Tim Horton.
     8
     9        * Shared/WebPageCreationParameters.cpp:
     10        (WebKit::WebPageCreationParameters::encode):
     11        (WebKit::WebPageCreationParameters::decode):
     12        * Shared/WebPageCreationParameters.h:
     13        * UIProcess/WebPageProxy.cpp:
     14        (WebKit::WebPageProxy::creationParameters):
     15        * UIProcess/WebPageProxy.h:
     16        * UIProcess/ios/WebPageProxyIOS.mm:
     17        (WebKit::WebPageProxy::textAutosizingWidth):
     18        * WebProcess/WebPage/WebPage.cpp:
     19        (WebKit::WebPage::WebPage):
     20        Pass the text autosizing width from the UIProcess to WebProcess.
     21
    1222014-04-27  Tim Horton  <timothy_horton@apple.com>
    223
  • trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp

    r167742 r167861  
    7474    encoder << screenSize;
    7575    encoder << availableScreenSize;
     76    encoder << textAutosizingWidth;
    7677#endif
    7778}
     
    155156    if (!decoder.decode(parameters.availableScreenSize))
    156157        return false;
     158    if (!decoder.decode(parameters.textAutosizingWidth))
     159        return false;
    157160#endif
    158161
  • trunk/Source/WebKit2/Shared/WebPageCreationParameters.h

    r167742 r167861  
    116116    WebCore::FloatSize screenSize;
    117117    WebCore::FloatSize availableScreenSize;
     118    float textAutosizingWidth;
    118119#endif
    119120};
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r167854 r167861  
    42484248    parameters.screenSize = screenSize();
    42494249    parameters.availableScreenSize = availableScreenSize();
     4250    parameters.textAutosizingWidth = textAutosizingWidth();
    42504251#endif
    42514252
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r167854 r167861  
    13511351    WebCore::FloatSize screenSize();
    13521352    WebCore::FloatSize availableScreenSize();
    1353 
     1353    float textAutosizingWidth();
    13541354
    13551355    void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint& newScrollPosition);
  • trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm

    r167774 r167861  
    478478    return FloatSize(WKGetAvailableScreenSize());
    479479}
    480 
     480   
     481float WebPageProxy::textAutosizingWidth()
     482{
     483    return WKGetScreenSize().width;
     484}
     485   
    481486void WebPageProxy::dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition)
    482487{
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r167854 r167861  
    381381    m_page->setGroupName(m_pageGroup->identifier());
    382382    m_page->setDeviceScaleFactor(parameters.deviceScaleFactor);
     383#if PLATFORM(IOS)
     384    m_page->setTextAutosizingWidth(parameters.textAutosizingWidth);
     385#endif
    383386
    384387    updatePreferences(parameters.store);
Note: See TracChangeset for help on using the changeset viewer.