Changeset 127751 in webkit


Ignore:
Timestamp:
Sep 6, 2012 10:11:32 AM (12 years ago)
Author:
mitz@apple.com
Message:

REGRESSION(r127712): It broke http/tests/xmlhttprequest/basic-auth.html on JSC platforms
https://bugs.webkit.org/show_bug.cgi?id=95972

Source/WebCore:

Reverted r127712, because it was based on the false premise that “[Optional] works the way
XMLHttpRequest expects”.

  • bindings/js/JSXMLHttpRequestCustom.cpp:

(WebCore::JSXMLHttpRequest::open):

  • bindings/v8/custom/V8XMLHttpRequestCustom.cpp:

(WebCore::V8XMLHttpRequest::openCallback):
(WebCore):

  • xml/XMLHttpRequest.cpp:

(WebCore::XMLHttpRequest::open):
(WebCore):

  • xml/XMLHttpRequest.h:

(XMLHttpRequest):

  • xml/XMLHttpRequest.idl:

LayoutTests:

Removed the failing test from the skipped list.

  • platform/qt/Skipped:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r127744 r127751  
     12012-09-06  Dan Bernstein  <mitz@apple.com>
     2
     3        REGRESSION(r127712): It broke http/tests/xmlhttprequest/basic-auth.html on JSC platforms
     4        https://bugs.webkit.org/show_bug.cgi?id=95972
     5
     6        Removed the failing test from the skipped list.
     7
     8        * platform/qt/Skipped:
     9
    1102012-09-06  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
    211
  • trunk/LayoutTests/platform/qt/Skipped

    r127728 r127751  
    28032803fast/viewport/viewport-limits-adjusted-for-no-user-scale-control.html
    28042804fast/viewport/viewport-limits-adjusted-for-no-user-scale.html
    2805 
    2806 # REGRESSION(r127712): It broke http/tests/xmlhttprequest/basic-auth.html on JSC platforms
    2807 # https://bugs.webkit.org/show_bug.cgi?id=95972
    2808 http/tests/xmlhttprequest/basic-auth.html
  • trunk/Source/WebCore/ChangeLog

    r127748 r127751  
     12012-09-06  Dan Bernstein  <mitz@apple.com>
     2
     3        REGRESSION(r127712): It broke http/tests/xmlhttprequest/basic-auth.html on JSC platforms
     4        https://bugs.webkit.org/show_bug.cgi?id=95972
     5
     6        Reverted r127712, because it was based on the false premise that “[Optional] works the way
     7        XMLHttpRequest expects”.
     8
     9        * bindings/js/JSXMLHttpRequestCustom.cpp:
     10        (WebCore::JSXMLHttpRequest::open):
     11        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
     12        (WebCore::V8XMLHttpRequest::openCallback):
     13        (WebCore):
     14        * xml/XMLHttpRequest.cpp:
     15        (WebCore::XMLHttpRequest::open):
     16        (WebCore):
     17        * xml/XMLHttpRequest.h:
     18        (XMLHttpRequest):
     19        * xml/XMLHttpRequest.idl:
     20
    1212012-09-06  Keishi Hattori  <keishi@webkit.org>
    222
  • trunk/Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp

    r127712 r127751  
    8080
    8181// Custom functions
     82JSValue JSXMLHttpRequest::open(ExecState* exec)
     83{
     84    if (exec->argumentCount() < 2)
     85        return throwError(exec, createNotEnoughArgumentsError(exec));
     86
     87    const KURL& url = impl()->scriptExecutionContext()->completeURL(exec->argument(1).toString(exec)->value(exec));
     88    String method = exec->argument(0).toString(exec)->value(exec);
     89
     90    ExceptionCode ec = 0;
     91    if (exec->argumentCount() >= 3) {
     92        bool async = exec->argument(2).toBoolean(exec);
     93
     94        if (exec->argumentCount() >= 4 && !exec->argument(3).isUndefined()) {
     95            String user = valueToStringWithNullCheck(exec, exec->argument(3));
     96
     97            if (exec->argumentCount() >= 5 && !exec->argument(4).isUndefined()) {
     98                String password = valueToStringWithNullCheck(exec, exec->argument(4));
     99                impl()->open(method, url, async, user, password, ec);
     100            } else
     101                impl()->open(method, url, async, user, ec);
     102        } else
     103            impl()->open(method, url, async, ec);
     104    } else
     105        impl()->open(method, url, ec);
     106
     107    setDOMException(exec, ec);
     108    return jsUndefined();
     109}
    82110
    83111JSValue JSXMLHttpRequest::send(ExecState* exec)
  • trunk/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp

    r127712 r127751  
    102102}
    103103
     104v8::Handle<v8::Value> V8XMLHttpRequest::openCallback(const v8::Arguments& args)
     105{
     106    INC_STATS("DOM.XMLHttpRequest.open()");
     107    // Four cases:
     108    // open(method, url)
     109    // open(method, url, async)
     110    // open(method, url, async, user)
     111    // open(method, url, async, user, passwd)
     112
     113    if (args.Length() < 2)
     114        return throwNotEnoughArgumentsError(args.GetIsolate());
     115
     116    XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(args.Holder());
     117
     118    String method = toWebCoreString(args[0]);
     119    String urlstring = toWebCoreString(args[1]);
     120    ScriptExecutionContext* context = getScriptExecutionContext();
     121    if (!context)
     122        return v8::Undefined();
     123
     124    KURL url = context->completeURL(urlstring);
     125
     126    ExceptionCode ec = 0;
     127
     128    if (args.Length() >= 3) {
     129        bool async = args[2]->BooleanValue();
     130
     131        if (args.Length() >= 4 && !args[3]->IsUndefined()) {
     132            String user = toWebCoreStringWithNullCheck(args[3]);
     133           
     134            if (args.Length() >= 5 && !args[4]->IsUndefined()) {
     135                String passwd = toWebCoreStringWithNullCheck(args[4]);
     136                xmlHttpRequest->open(method, url, async, user, passwd, ec);
     137            } else
     138                xmlHttpRequest->open(method, url, async, user, ec);
     139        } else
     140            xmlHttpRequest->open(method, url, async, ec);
     141    } else
     142        xmlHttpRequest->open(method, url, ec);
     143
     144    if (ec)
     145        return setDOMException(ec, args.GetIsolate());
     146
     147    return v8::Undefined();
     148}
     149
    104150static bool isDocumentType(v8::Handle<v8::Value> value)
    105151{
  • trunk/Source/WebCore/xml/XMLHttpRequest.cpp

    r127712 r127751  
    446446}
    447447
    448 void XMLHttpRequest::open(const String& method, const String& url, ExceptionCode& ec)
    449 {
    450     internalOpen(method, scriptExecutionContext()->completeURL(url), true, ec);
    451 }
    452 
    453 void XMLHttpRequest::open(const String& method, const String& url, bool async, ExceptionCode& ec)
    454 {
    455     internalOpen(method, scriptExecutionContext()->completeURL(url), async, ec);
    456 }
    457 
    458 void XMLHttpRequest::open(const String& method, const String& url, bool async, const String& user, ExceptionCode& ec)
    459 {
    460     KURL urlWithCredentials(scriptExecutionContext()->completeURL(url));
    461     urlWithCredentials.setUser(user);
    462 
    463     internalOpen(method, urlWithCredentials, async, ec);
    464 }
    465 
    466 void XMLHttpRequest::open(const String& method, const String& url, bool async, const String& user, const String& password, ExceptionCode& ec)
    467 {
    468     KURL urlWithCredentials(scriptExecutionContext()->completeURL(url));
    469     urlWithCredentials.setUser(user);
    470     urlWithCredentials.setPass(password);
    471 
    472     internalOpen(method, urlWithCredentials, async, ec);
    473 }
    474 
    475 void XMLHttpRequest::internalOpen(const String& method, const KURL& url, bool async, ExceptionCode& ec)
     448void XMLHttpRequest::open(const String& method, const KURL& url, ExceptionCode& ec)
     449{
     450    open(method, url, true, ec);
     451}
     452
     453void XMLHttpRequest::open(const String& method, const KURL& url, bool async, ExceptionCode& ec)
    476454{
    477455    internalAbort();
     
    535513    else
    536514        m_state = OPENED;
     515}
     516
     517void XMLHttpRequest::open(const String& method, const KURL& url, bool async, const String& user, ExceptionCode& ec)
     518{
     519    KURL urlWithCredentials(url);
     520    urlWithCredentials.setUser(user);
     521
     522    open(method, urlWithCredentials, async, ec);
     523}
     524
     525void XMLHttpRequest::open(const String& method, const KURL& url, bool async, const String& user, const String& password, ExceptionCode& ec)
     526{
     527    KURL urlWithCredentials(url);
     528    urlWithCredentials.setUser(user);
     529    urlWithCredentials.setPass(password);
     530
     531    open(method, urlWithCredentials, async, ec);
    537532}
    538533
  • trunk/Source/WebCore/xml/XMLHttpRequest.h

    r127712 r127751  
    8484    bool withCredentials() const { return m_includeCredentials; }
    8585    void setWithCredentials(bool, ExceptionCode&);
    86     void open(const String& method, const String& url, ExceptionCode&);
    87     void open(const String& method, const String& url, bool async, ExceptionCode&);
    88     void open(const String& method, const String& url, bool async, const String& user, ExceptionCode&);
    89     void open(const String& method, const String& url, bool async, const String& user, const String& password, ExceptionCode&);
     86    void open(const String& method, const KURL&, ExceptionCode&);
     87    void open(const String& method, const KURL&, bool async, ExceptionCode&);
     88    void open(const String& method, const KURL&, bool async, const String& user, ExceptionCode&);
     89    void open(const String& method, const KURL&, bool async, const String& user, const String& password, ExceptionCode&);
    9090    void send(ExceptionCode&);
    9191    void send(Document*, ExceptionCode&);
     
    139139    XMLHttpRequest(ScriptExecutionContext*, PassRefPtr<SecurityOrigin>);
    140140
    141     void internalOpen(const String& method, const KURL&, bool async, ExceptionCode&);
    142 
    143141    virtual void refEventTarget() { ref(); }
    144142    virtual void derefEventTarget() { deref(); }
  • trunk/Source/WebCore/xml/XMLHttpRequest.idl

    r127712 r127751  
    6262            setter raises(DOMException);
    6363
    64         void open(in DOMString method, in DOMString url, in [Optional] boolean async, in [Optional] DOMString user, in [Optional] DOMString password)
     64        [Custom] void open(in DOMString method, in DOMString url, in [Optional] boolean async, in [Optional] DOMString user, in [Optional] DOMString password)
    6565            raises(DOMException);
    6666
Note: See TracChangeset for help on using the changeset viewer.