Changeset 62834 in webkit
- Timestamp:
- Jul 8, 2010 2:05:06 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r62833 r62834 1 2010-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 1 22 2010-07-08 Csaba Osztrogonác <ossy@webkit.org> 2 23 -
trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt
r62215 r62834 2088 2088 window.clientInformation.product [string] 2089 2089 window.clientInformation.productSub [string] 2090 window.clientInformation.registerContentHandler [function]2091 window.clientInformation.registerProtocolHandler [function]2092 2090 window.clientInformation.userAgent [string] 2093 2091 window.clientInformation.vendor [string] -
trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt
r50477 r62834 14 14 navigator.product is OK 15 15 navigator.productSub is OK 16 navigator.registerContentHandler() threw err Error: SYNTAX_ERR: DOM Exception 1217 navigator.registerProtocolHandler() threw err Error: SYNTAX_ERR: DOM Exception 1218 16 navigator.userAgent is OK 19 17 navigator.vendor is OK … … 32 30 navigator.product is OK 33 31 navigator.productSub is OK 34 navigator.registerContentHandler() is OK35 navigator.registerProtocolHandler() is OK36 32 navigator.userAgent is OK 37 33 navigator.vendor is OK -
trunk/LayoutTests/platform/chromium-mac/fast/dom/navigator-detached-no-crash-expected.txt
r56251 r62834 14 14 navigator.product is OK 15 15 navigator.productSub is OK 16 navigator.registerContentHandler() is OK17 navigator.registerProtocolHandler() is OK18 16 navigator.userAgent is OK 19 17 navigator.vendor is OK … … 32 30 navigator.product is OK 33 31 navigator.productSub is OK 34 navigator.registerContentHandler() is OK35 navigator.registerProtocolHandler() is OK36 32 navigator.userAgent is OK 37 33 navigator.vendor is OK -
trunk/LayoutTests/platform/chromium-win/fast/dom/navigator-detached-no-crash-expected.txt
r56267 r62834 14 14 navigator.product is OK 15 15 navigator.productSub is OK 16 navigator.registerContentHandler() is OK17 navigator.registerProtocolHandler() is OK18 16 navigator.userAgent is OK 19 17 navigator.vendor is OK … … 32 30 navigator.product is OK 33 31 navigator.productSub is OK 34 navigator.registerContentHandler() is OK35 navigator.registerProtocolHandler() is OK36 32 navigator.userAgent is OK 37 33 navigator.vendor is OK -
trunk/LayoutTests/platform/gtk/fast/dom/Window/window-properties-expected.txt
r61650 r62834 1687 1687 window.clientInformation.product [string] 1688 1688 window.clientInformation.productSub [string] 1689 window.clientInformation.registerContentHandler [function]1690 window.clientInformation.registerProtocolHandler [function]1691 1689 window.clientInformation.userAgent [string] 1692 1690 window.clientInformation.vendor [string] -
trunk/LayoutTests/platform/mac-leopard/fast/dom/navigator-detached-no-crash-expected.txt
r50477 r62834 14 14 navigator.product is OK 15 15 navigator.productSub is OK 16 navigator.registerContentHandler() threw err Error: SYNTAX_ERR: DOM Exception 1217 navigator.registerProtocolHandler() threw err Error: SYNTAX_ERR: DOM Exception 1218 16 navigator.userAgent is OK 19 17 navigator.vendor is OK … … 32 30 navigator.product is OK 33 31 navigator.productSub is OK 34 navigator.registerContentHandler() is OK35 navigator.registerProtocolHandler() is OK36 32 navigator.userAgent is OK 37 33 navigator.vendor is OK -
trunk/LayoutTests/platform/qt/fast/dom/Window/window-properties-expected.txt
r62223 r62834 2058 2058 window.clientInformation.product [string] 2059 2059 window.clientInformation.productSub [string] 2060 window.clientInformation.registerContentHandler [function]2061 window.clientInformation.registerProtocolHandler [function]2062 2060 window.clientInformation.userAgent [string] 2063 2061 window.clientInformation.vendor [string] -
trunk/WebCore/ChangeLog
r62832 r62834 1 2010-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 1 17 2010-07-08 Xan Lopez <xlopez@igalia.com> 2 18 -
trunk/WebCore/page/Chrome.cpp
r58611 r62834 319 319 } 320 320 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 331 321 IntRect Chrome::windowResizerRect() const 332 322 { -
trunk/WebCore/page/Chrome.h
r58445 r62834 122 122 bool shouldInterruptJavaScript(); 123 123 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 127 124 IntRect windowResizerRect() const; 128 125 -
trunk/WebCore/page/ChromeClient.h
r62451 r62834 126 126 virtual bool tabsToLinks() const = 0; 127 127 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 131 128 virtual IntRect windowResizerRect() const = 0; 132 129 -
trunk/WebCore/page/Navigator.cpp
r62577 r62834 28 28 #include "DOMMimeTypeArray.h" 29 29 #include "DOMPluginArray.h" 30 #include "ExceptionCode.h"31 30 #include "Frame.h" 32 31 #include "FrameLoader.h" 33 32 #include "FrameLoaderClient.h" 34 33 #include "Geolocation.h" 35 #include "KURL.h"36 34 #include "Language.h" 37 35 #include "Page.h" … … 173 171 #endif 174 172 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 removing186 // 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 custom235 // 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 264 173 } // namespace WebCore -
trunk/WebCore/page/Navigator.h
r62577 r62834 35 35 class String; 36 36 37 typedef int ExceptionCode;38 39 37 class Navigator : public NavigatorBase, public RefCounted<Navigator> { 40 38 public: … … 63 61 #endif 64 62 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 68 63 private: 69 64 Navigator(Frame*); -
trunk/WebCore/page/Navigator.idl
r62577 r62834 48 48 void getStorageUpdates(); 49 49 #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);55 50 }; 56 51
Note: See TracChangeset
for help on using the changeset viewer.