Changeset 90806 in webkit


Ignore:
Timestamp:
Jul 11, 2011 7:51:39 PM (13 years ago)
Author:
hbono@chromium.org
Message:

Reviewed by Adam Roben.

Implement layoutTestController.setTextDirection for WebKit2 and Windows.
https://bugs.webkit.org/show_bug.cgi?id=61931

This change implements layoutTextController.setTextDirection for WebKit2
and Windows so we can run a layout test added by r87770 on them. Each
implementation adds a wrapper function for Editor::setBaseWritingDirection()
so LayoutTestController can call it.

Source/WebKit/win:

  • Interfaces/IWebFramePrivate.idl: Added setTextDirection to allow

LayoutTestController to change the text direction.

  • WebFrame.cpp: ditto.

(WebFrame::setTextDirection):

  • WebFrame.h: ditto.

Source/WebKit2:

  • WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: Added

WKBundleFrameSetTextDirection to allow LayoutTestController to change the
text direction.
(WKBundleFrameSetTextDirection):

  • WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h: ditto.
  • WebProcess/WebPage/WebFrame.cpp: Added setTextDirection to allow

WKBundleFrame to change the text direction.
(WebKit::WebFrame::setTextDirection):

  • WebProcess/WebPage/WebFrame.h: ditto.

Tools:

  • DumpRenderTree/win/LayoutTestControllerWin.cpp:

(LayoutTestController::setTextDirection): Implemented the binding function
for layoutTestController.setTextDirection (Windows).

  • WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:

Added a binding function for layoutTestController.setTextDirection (WebKit2).

  • WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: ditto.

(WTR::LayoutTestController::setTextDirection):

  • WebKitTestRunner/InjectedBundle/LayoutTestController.h: ditto.

LayoutTests:

  • platform/mac-wk2/Skipped: Removed set-text-direction.html.
  • platform/win/Skipped: ditto.
Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r90802 r90806  
     12011-07-11  Hironori Bono  <hbono@chromium.org>
     2
     3        Reviewed by Adam Roben.
     4
     5        Implement layoutTestController.setTextDirection for WebKit2 and Windows.
     6        https://bugs.webkit.org/show_bug.cgi?id=61931
     7
     8        This change implements layoutTextController.setTextDirection for WebKit2
     9        and Windows so we can run a layout test added by r87770 on them. Each
     10        implementation adds a wrapper function for Editor::setBaseWritingDirection()
     11        so LayoutTestController can call it.
     12
     13        * platform/mac-wk2/Skipped: Removed set-text-direction.html.
     14        * platform/win/Skipped: ditto.
     15
    1162011-07-11  Ryosuke Niwa  <rniwa@webkit.org>
    217
  • trunk/LayoutTests/platform/win/Skipped

    r90726 r90806  
    10081008editing/spelling/spellcheck-paste.html
    10091009
    1010 # layoutTestController::setTextDirection() is not implemented
    1011 fast/html/set-text-direction.html
    1012 
    10131010# IndexedDB is not yet enabled.
    10141011storage/indexeddb
  • trunk/LayoutTests/platform/wk2/Skipped

    r90802 r90806  
    411411scrollbars/scrollbar-miss-mousemove-disabled.html
    412412scrollbars/scrollevent-iframe-no-scrolling-wheel.html
    413 
    414 # WebKitTestRunner needs an implementation of setTextDirection.
    415 # <https://bugs.webkit.org/show_bug.cgi?id=61931>
    416 fast/html/set-text-direction.html
    417413
    418414# CONSOLE MESSAGE: line 0: SVG animation pause API missing!
  • trunk/Source/WebKit/win/ChangeLog

    r90643 r90806  
     12011-07-11  Hironori Bono  <hbono@chromium.org>
     2
     3        Reviewed by Adam Roben.
     4
     5        Implement layoutTestController.setTextDirection for WebKit2 and Windows.
     6        https://bugs.webkit.org/show_bug.cgi?id=61931
     7
     8        This change implements layoutTextController.setTextDirection for WebKit2
     9        and Windows so we can run a layout test added by r87770 on them. Each
     10        implementation adds a wrapper function for Editor::setBaseWritingDirection()
     11        so LayoutTestController can call it.
     12
     13        * Interfaces/IWebFramePrivate.idl: Added setTextDirection to allow
     14        LayoutTestController to change the text direction.
     15        * WebFrame.cpp: ditto.
     16        (WebFrame::setTextDirection):
     17        * WebFrame.h: ditto.
     18
    1192011-07-08  Chang Shu  <cshu@webkit.org>
    220
  • trunk/Source/WebKit/win/Interfaces/IWebFramePrivate.idl

    r85256 r90806  
    121121   
    122122    HRESULT clearOpener();
     123
     124    HRESULT setTextDirection([in] BSTR direction);
    123125}
  • trunk/Source/WebKit/win/WebFrame.cpp

    r89991 r90806  
    10621062}
    10631063
     1064HRESULT WebFrame::setTextDirection(BSTR direction)
     1065{
     1066    Frame* coreFrame = core(this);
     1067    if (!coreFrame || !coreFrame->editor())
     1068        return E_FAIL;
     1069
     1070    String directionString(direction, SysStringLen(direction));
     1071    if (directionString == "auto")
     1072        coreFrame->editor()->setBaseWritingDirection(NaturalWritingDirection);
     1073    else if (directionString == "ltr")
     1074        coreFrame->editor()->setBaseWritingDirection(LeftToRightWritingDirection);
     1075    else if (directionString == "rtl")
     1076        coreFrame->editor()->setBaseWritingDirection(RightToLeftWritingDirection);
     1077    return S_OK;
     1078}
     1079
    10641080// IWebDocumentText -----------------------------------------------------------
    10651081
  • trunk/Source/WebKit/win/WebFrame.h

    r88737 r90806  
    283283
    284284    virtual HRESULT STDMETHODCALLTYPE clearOpener();
     285
     286    virtual HRESULT STDMETHODCALLTYPE setTextDirection(BSTR);
    285287
    286288    // IWebDocumentText
  • trunk/Source/WebKit2/ChangeLog

    r90766 r90806  
     12011-07-11  Hironori Bono  <hbono@chromium.org>
     2
     3        Reviewed by Adam Roben.
     4
     5        Implement layoutTestController.setTextDirection for WebKit2 and Windows.
     6        https://bugs.webkit.org/show_bug.cgi?id=61931
     7
     8        This change implements layoutTextController.setTextDirection for WebKit2
     9        and Windows so we can run a layout test added by r87770 on them. Each
     10        implementation adds a wrapper function for Editor::setBaseWritingDirection()
     11        so LayoutTestController can call it.
     12
     13        * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: Added
     14        WKBundleFrameSetTextDirection to allow LayoutTestController to change the
     15        text direction.
     16        (WKBundleFrameSetTextDirection):
     17        * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h: ditto.
     18        * WebProcess/WebPage/WebFrame.cpp: Added setTextDirection to allow
     19        WKBundleFrame to change the text direction.
     20        (WebKit::WebFrame::setTextDirection):
     21        * WebProcess/WebPage/WebFrame.h: ditto.
     22
    1232011-07-11  Benjamin Poulain  <benjamin@webkit.org>
    224
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp

    r86977 r90806  
    236236    return toImpl(frameRef)->containsAnyFormElements();
    237237}
     238
     239void WKBundleFrameSetTextDirection(WKBundleFrameRef frameRef, WKStringRef directionRef)
     240{
     241    toImpl(frameRef)->setTextDirection(toImpl(directionRef)->string());
     242}
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h

    r86977 r90806  
    5252
    5353WK_EXPORT bool WKBundleFrameContainsAnyFormElements(WKBundleFrameRef frame);
     54WK_EXPORT void WKBundleFrameSetTextDirection(WKBundleFrameRef frame, WKStringRef);
    5455
    5556#ifdef __cplusplus
  • trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp

    r86981 r90806  
    706706}
    707707
     708void WebFrame::setTextDirection(const String& direction)
     709{
     710    if (!m_coreFrame || !m_coreFrame->editor())
     711        return;
     712
     713    if (direction == "auto")
     714        m_coreFrame->editor()->setBaseWritingDirection(NaturalWritingDirection);
     715    else if (direction == "ltr")
     716        m_coreFrame->editor()->setBaseWritingDirection(LeftToRightWritingDirection);
     717    else if (direction == "rtl")
     718        m_coreFrame->editor()->setBaseWritingDirection(RightToLeftWritingDirection);
     719}
     720
    708721} // namespace WebKit
  • trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h

    r86977 r90806  
    122122    String mimeTypeForResourceWithURL(const WebCore::KURL&) const;
    123123
     124    void setTextDirection(const String&);
     125
    124126    // Simple listener class used by plug-ins to know when frames finish or fail loading.
    125127    class LoadListener {
  • trunk/Tools/ChangeLog

    r90805 r90806  
     12011-07-11  Hironori Bono  <hbono@chromium.org>
     2
     3        Reviewed by Adam Roben.
     4
     5        Implement layoutTestController.setTextDirection for WebKit2 and Windows.
     6        https://bugs.webkit.org/show_bug.cgi?id=61931
     7
     8        This change implements layoutTextController.setTextDirection for WebKit2
     9        and Windows so we can run a layout test added by r87770 on them. Each
     10        implementation adds a wrapper function for Editor::setBaseWritingDirection()
     11        so LayoutTestController can call it.
     12
     13        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
     14        (LayoutTestController::setTextDirection): Implemented the binding function
     15        for layoutTestController.setTextDirection (Windows).
     16        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
     17        Added a binding function for layoutTestController.setTextDirection (WebKit2).
     18        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: ditto.
     19        (WTR::LayoutTestController::setTextDirection):
     20        * WebKitTestRunner/InjectedBundle/LayoutTestController.h: ditto.
     21
    1222011-07-11  Raphael Kubo da Costa  <kubo@profusion.mobi>
    223
  • trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp

    r89733 r90806  
    15251525void LayoutTestController::setTextDirection(JSStringRef direction)
    15261526{
    1527     // FIXME: Implement.
     1527    COMPtr<IWebFramePrivate> framePrivate(Query, frame);
     1528    if (!framePrivate)
     1529        return;
     1530
     1531    framePrivate->setTextDirection(bstrT(direction).GetBSTR());
    15281532}
    15291533
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl

    r89682 r90806  
    109109        void setPOSIXLocale(in DOMString locale);
    110110
     111        void setTextDirection(in DOMString direction);
     112
    111113        void setWillSendRequestReturnsNull(in boolean flag);
    112114    };
  • trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp

    r89682 r90806  
    474474}
    475475
     476void LayoutTestController::setTextDirection(JSStringRef direction)
     477{
     478    WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
     479    return WKBundleFrameSetTextDirection(mainFrame, toWK(direction).get());
     480}
     481
    476482} // namespace WTR
  • trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h

    r89682 r90806  
    163163    void setWillSendRequestReturnsNull(bool f) { m_willSendRequestReturnsNull = f; }
    164164
     165    void setTextDirection(JSStringRef);
     166
    165167private:
    166168    static const double waitToDumpWatchdogTimerInterval;
Note: See TracChangeset for help on using the changeset viewer.