Changeset 62834 in webkit


Ignore:
Timestamp:
Jul 8, 2010 2:05:06 PM (14 years ago)
Author:
dimich@chromium.org
Message:

WebCore: Remove IDL declarations and stubs for navigator.registerProtocolHandler and navigator.registerContentHandler.
https://bugs.webkit.org/show_bug.cgi?id=41878

Reviewed by David Levin.

This is practically a rollback of http://trac.webkit.org/changeset/50477.

  • page/Chrome.cpp:
  • page/Chrome.h:
  • page/ChromeClient.h:
  • page/Navigator.cpp:
  • page/Navigator.h:
  • page/Navigator.idl:

LayoutTests: Remove IDL declarations and stubs for navigator.registerProtocolHandler and navigator.registerContentHandler
https://bugs.webkit.org/show_bug.cgi?id=41878

Reviewed by David Levin.

This is practically a rollback of http://trac.webkit.org/changeset/50477.

  • fast/dom/Window/window-properties-expected.txt:
  • fast/dom/navigator-detached-no-crash-expected.txt:
  • fast/dom/registerContentHandler-expected.txt: Removed.
  • fast/dom/registerContentHandler.html: Removed.
  • fast/dom/registerProtocolHandler-expected.txt: Removed.
  • fast/dom/registerProtocolHandler.html: Removed.
  • platform/chromium-mac/fast/dom/navigator-detached-no-crash-expected.txt:
  • platform/chromium-win/fast/dom/navigator-detached-no-crash-expected.txt:
  • platform/gtk/fast/dom/Window/window-properties-expected.txt:
  • platform/mac-leopard/fast/dom/navigator-detached-no-crash-expected.txt:
  • platform/qt/fast/dom/Window/window-properties-expected.txt:
Location:
trunk
Files:
4 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r62833 r62834  
     12010-07-08  Dmitry Titov  <dimich@chromium.org>
     2
     3        Reviewed by David Levin.
     4
     5        Remove IDL declarations and stubs for navigator.registerProtocolHandler and navigator.registerContentHandler
     6        https://bugs.webkit.org/show_bug.cgi?id=41878
     7
     8        This is practically a rollback of http://trac.webkit.org/changeset/50477.
     9
     10        * fast/dom/Window/window-properties-expected.txt:
     11        * fast/dom/navigator-detached-no-crash-expected.txt:
     12        * fast/dom/registerContentHandler-expected.txt: Removed.
     13        * fast/dom/registerContentHandler.html: Removed.
     14        * fast/dom/registerProtocolHandler-expected.txt: Removed.
     15        * fast/dom/registerProtocolHandler.html: Removed.
     16        * platform/chromium-mac/fast/dom/navigator-detached-no-crash-expected.txt:
     17        * platform/chromium-win/fast/dom/navigator-detached-no-crash-expected.txt:
     18        * platform/gtk/fast/dom/Window/window-properties-expected.txt:
     19        * platform/mac-leopard/fast/dom/navigator-detached-no-crash-expected.txt:
     20        * platform/qt/fast/dom/Window/window-properties-expected.txt:
     21
    1222010-07-08  Csaba Osztrogonác  <ossy@webkit.org>
    223
  • trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt

    r62215 r62834  
    20882088window.clientInformation.product [string]
    20892089window.clientInformation.productSub [string]
    2090 window.clientInformation.registerContentHandler [function]
    2091 window.clientInformation.registerProtocolHandler [function]
    20922090window.clientInformation.userAgent [string]
    20932091window.clientInformation.vendor [string]
  • trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt

    r50477 r62834  
    1414navigator.product is OK
    1515navigator.productSub is OK
    16 navigator.registerContentHandler() threw err Error: SYNTAX_ERR: DOM Exception 12
    17 navigator.registerProtocolHandler() threw err Error: SYNTAX_ERR: DOM Exception 12
    1816navigator.userAgent is OK
    1917navigator.vendor is OK
     
    3230navigator.product is OK
    3331navigator.productSub is OK
    34 navigator.registerContentHandler() is OK
    35 navigator.registerProtocolHandler() is OK
    3632navigator.userAgent is OK
    3733navigator.vendor is OK
  • trunk/LayoutTests/platform/chromium-mac/fast/dom/navigator-detached-no-crash-expected.txt

    r56251 r62834  
    1414navigator.product is OK
    1515navigator.productSub is OK
    16 navigator.registerContentHandler() is OK
    17 navigator.registerProtocolHandler() is OK
    1816navigator.userAgent is OK
    1917navigator.vendor is OK
     
    3230navigator.product is OK
    3331navigator.productSub is OK
    34 navigator.registerContentHandler() is OK
    35 navigator.registerProtocolHandler() is OK
    3632navigator.userAgent is OK
    3733navigator.vendor is OK
  • trunk/LayoutTests/platform/chromium-win/fast/dom/navigator-detached-no-crash-expected.txt

    r56267 r62834  
    1414navigator.product is OK
    1515navigator.productSub is OK
    16 navigator.registerContentHandler() is OK
    17 navigator.registerProtocolHandler() is OK
    1816navigator.userAgent is OK
    1917navigator.vendor is OK
     
    3230navigator.product is OK
    3331navigator.productSub is OK
    34 navigator.registerContentHandler() is OK
    35 navigator.registerProtocolHandler() is OK
    3632navigator.userAgent is OK
    3733navigator.vendor is OK
  • trunk/LayoutTests/platform/gtk/fast/dom/Window/window-properties-expected.txt

    r61650 r62834  
    16871687window.clientInformation.product [string]
    16881688window.clientInformation.productSub [string]
    1689 window.clientInformation.registerContentHandler [function]
    1690 window.clientInformation.registerProtocolHandler [function]
    16911689window.clientInformation.userAgent [string]
    16921690window.clientInformation.vendor [string]
  • trunk/LayoutTests/platform/mac-leopard/fast/dom/navigator-detached-no-crash-expected.txt

    r50477 r62834  
    1414navigator.product is OK
    1515navigator.productSub is OK
    16 navigator.registerContentHandler() threw err Error: SYNTAX_ERR: DOM Exception 12
    17 navigator.registerProtocolHandler() threw err Error: SYNTAX_ERR: DOM Exception 12
    1816navigator.userAgent is OK
    1917navigator.vendor is OK
     
    3230navigator.product is OK
    3331navigator.productSub is OK
    34 navigator.registerContentHandler() is OK
    35 navigator.registerProtocolHandler() is OK
    3632navigator.userAgent is OK
    3733navigator.vendor is OK
  • trunk/LayoutTests/platform/qt/fast/dom/Window/window-properties-expected.txt

    r62223 r62834  
    20582058window.clientInformation.product [string]
    20592059window.clientInformation.productSub [string]
    2060 window.clientInformation.registerContentHandler [function]
    2061 window.clientInformation.registerProtocolHandler [function]
    20622060window.clientInformation.userAgent [string]
    20632061window.clientInformation.vendor [string]
  • trunk/WebCore/ChangeLog

    r62832 r62834  
     12010-07-08  Dmitry Titov  <dimich@chromium.org>
     2
     3        Reviewed by David Levin.
     4
     5        Remove IDL declarations and stubs for navigator.registerProtocolHandler and navigator.registerContentHandler.
     6        https://bugs.webkit.org/show_bug.cgi?id=41878
     7
     8        This is practically a rollback of http://trac.webkit.org/changeset/50477.
     9
     10        * page/Chrome.cpp:
     11        * page/Chrome.h:
     12        * page/ChromeClient.h:
     13        * page/Navigator.cpp:
     14        * page/Navigator.h:
     15        * page/Navigator.idl:
     16
    1172010-07-08  Xan Lopez  <xlopez@igalia.com>
    218
  • trunk/WebCore/page/Chrome.cpp

    r58611 r62834  
    319319}
    320320
    321 void Chrome::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
    322 {
    323     m_client->registerProtocolHandler(scheme, baseURL, url, title);
    324 }
    325 
    326 void Chrome::registerContentHandler(const String& mimeType, const String& baseURL, const String& url, const String& title)
    327 {
    328     m_client->registerContentHandler(mimeType,  baseURL, url,  title);
    329 }
    330 
    331321IntRect Chrome::windowResizerRect() const
    332322{
  • trunk/WebCore/page/Chrome.h

    r58445 r62834  
    122122        bool shouldInterruptJavaScript();
    123123
    124         void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title);
    125         void registerContentHandler(const String& mimeType, const String& baseURL, const String& url, const String& title);
    126 
    127124        IntRect windowResizerRect() const;
    128125
  • trunk/WebCore/page/ChromeClient.h

    r62451 r62834  
    126126        virtual bool tabsToLinks() const = 0;
    127127
    128         virtual void registerProtocolHandler(const String&, const String&, const String&, const String&) { }
    129         virtual void registerContentHandler(const String&, const String&, const String&, const String&) { }
    130 
    131128        virtual IntRect windowResizerRect() const = 0;
    132129
  • trunk/WebCore/page/Navigator.cpp

    r62577 r62834  
    2828#include "DOMMimeTypeArray.h"
    2929#include "DOMPluginArray.h"
    30 #include "ExceptionCode.h"
    3130#include "Frame.h"
    3231#include "FrameLoader.h"
    3332#include "FrameLoaderClient.h"
    3433#include "Geolocation.h"
    35 #include "KURL.h"
    3634#include "Language.h"
    3735#include "Page.h"
     
    173171#endif
    174172
    175 static bool verifyCustomHandlerURL(const String& baseURL, const String& url, ExceptionCode& ec)
    176 {
    177     // The specification requires that it is a SYNTAX_ERR if the the "%s" token is not present.
    178     static const char token[] = "%s";
    179     int index = url.find(token);
    180     if (-1 == index) {
    181         ec = SYNTAX_ERR;
    182         return false;
    183     }
    184 
    185     // It is also a SYNTAX_ERR if the custom handler URL, as created by removing
    186     // the "%s" token and prepending the base url, does not resolve.
    187     String newURL = url;
    188     newURL.remove(index, sizeof(token) / sizeof(token[0]));
    189 
    190     KURL base(ParsedURLString, baseURL);
    191     KURL kurl(base, newURL);
    192 
    193     if (kurl.isEmpty() || !kurl.isValid()) {
    194         ec = SYNTAX_ERR;
    195         return false;
    196     }
    197 
    198     return true;
    199 }
    200 
    201 static bool verifyProtocolHandlerScheme(const String& scheme, ExceptionCode& ec)
    202 {
    203     // It is a SECURITY_ERR for these schemes to be handled by a custom handler.
    204     if (equalIgnoringCase(scheme, "http") || equalIgnoringCase(scheme, "https") || equalIgnoringCase(scheme, "file")) {
    205         ec = SECURITY_ERR;
    206         return false;
    207     }
    208     return true;
    209 }
    210 
    211 void Navigator::registerProtocolHandler(const String& scheme, const String& url, const String& title, ExceptionCode& ec)
    212 {
    213     if (!verifyProtocolHandlerScheme(scheme, ec))
    214         return;
    215 
    216     if (!m_frame)
    217         return;
    218 
    219     Document* document = m_frame->document();
    220     if (!document)
    221         return;
    222 
    223     String baseURL = document->baseURL().baseAsString();
    224 
    225     if (!verifyCustomHandlerURL(baseURL, url, ec))
    226         return;
    227 
    228     if (Page* page = m_frame->page())
    229         page->chrome()->registerProtocolHandler(scheme, baseURL, url, m_frame->displayStringModifiedByEncoding(title));
    230 }
    231 
    232 static bool verifyProtocolHandlerMimeType(const String& type, ExceptionCode& ec)
    233 {
    234     // It is a SECURITY_ERR for these mime types to be assigned to a custom
    235     // handler.
    236     if (equalIgnoringCase(type, "text/html") || equalIgnoringCase(type, "text/css") || equalIgnoringCase(type, "application/x-javascript")) {
    237         ec = SECURITY_ERR;
    238         return false;
    239     }
    240     return true;
    241 }
    242 
    243 void Navigator::registerContentHandler(const String& mimeType, const String& url, const String& title, ExceptionCode& ec)
    244 {
    245     if (!verifyProtocolHandlerMimeType(mimeType, ec))
    246         return;
    247 
    248     if (!m_frame)
    249         return;
    250 
    251     Document* document = m_frame->document();
    252     if (!document)
    253         return;
    254 
    255     String baseURL = document->baseURL().baseAsString();
    256 
    257     if (!verifyCustomHandlerURL(baseURL, url, ec))
    258         return;
    259 
    260     if (Page* page = m_frame->page())
    261         page->chrome()->registerContentHandler(mimeType, baseURL, url, m_frame->displayStringModifiedByEncoding(title));
    262 }
    263 
    264173} // namespace WebCore
  • trunk/WebCore/page/Navigator.h

    r62577 r62834  
    3535    class String;
    3636
    37     typedef int ExceptionCode;
    38 
    3937    class Navigator : public NavigatorBase, public RefCounted<Navigator> {
    4038    public:
     
    6361#endif
    6462
    65         void registerProtocolHandler(const String& scheme, const String& url, const String& title, ExceptionCode& ec);
    66         void registerContentHandler(const String& mimeType, const String& url, const String& title, ExceptionCode& ec);
    67 
    6863    private:
    6964        Navigator(Frame*);
  • trunk/WebCore/page/Navigator.idl

    r62577 r62834  
    4848        void getStorageUpdates();
    4949#endif
    50 
    51         void registerProtocolHandler(in DOMString scheme, in DOMString url, in DOMString title)
    52             raises(DomException);
    53         void registerContentHandler(in DOMString mimeType, in DOMString url, in DOMString title)
    54             raises(DomException);
    5550    };
    5651
Note: See TracChangeset for help on using the changeset viewer.