WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Updated patch
71968_patch.txt (text/plain), 51.41 KB, created by
Kaustubh Atrawalkar
on 2011-12-08 05:06:36 PST
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
Kaustubh Atrawalkar
Created:
2011-12-08 05:06:36 PST
Size:
51.41 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 102325) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,60 @@ >+2011-12-06 Kaustubh Atrawalkar <kaustubh@motorola.com> && Erik Arvidsson <arv@chromium.org> >+ >+ Implement URL API >+ https://bugs.webkit.org/show_bug.cgi?id=71968 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Initial implementation of DOMURL IDL attributes. >+ Changed to static class methods for createObjectURL & revokeObjectURL >+ >+ Tests: fast/dom/DOMURL/check-instanceof-domurl-functions.html >+ fast/dom/DOMURL/domurl-attribute-hash.html >+ fast/dom/DOMURL/domurl-attribute-host.html >+ fast/dom/DOMURL/domurl-attribute-hostname.html >+ fast/dom/DOMURL/domurl-attribute-pathname.html >+ fast/dom/DOMURL/domurl-attribute-port.html >+ fast/dom/DOMURL/domurl-attribute-protocol.html >+ fast/dom/DOMURL/domurl-attribute-search.html >+ fast/dom/DOMURL/stringifier-domurl-attribute-href.html >+ >+ * html/DOMURL.cpp: >+ (WebCore::DOMURL::DOMURL): >+ (WebCore::DOMURL::contextDestroyed): >+ (WebCore::DOMURL::createObjectURL): >+ (WebCore::DOMURL::revokeObjectURL): >+ (WebCore::DOMURL::host): >+ (WebCore::DOMURL::setHost): >+ (WebCore::DOMURL::setHostname): >+ (WebCore::DOMURL::port): >+ (WebCore::DOMURL::setPort): >+ (WebCore::DOMURL::setPathname): >+ (WebCore::DOMURL::search): >+ (WebCore::DOMURL::setSearch): >+ (WebCore::DOMURL::hash): >+ (WebCore::DOMURL::setHash): >+ (WebCore::DOMURL::setFilename): >+ (WebCore::DOMURL::origin): >+ (WebCore::DOMURL::getParameter): >+ (WebCore::DOMURL::appendParameter): >+ (WebCore::DOMURL::clearParameter): >+ * html/DOMURL.h: >+ (WebCore::DOMURL::create): >+ (WebCore::DOMURL::protocol): >+ (WebCore::DOMURL::setProtocol): >+ (WebCore::DOMURL::username): >+ (WebCore::DOMURL::setUsername): >+ (WebCore::DOMURL::password): >+ (WebCore::DOMURL::setPassword): >+ (WebCore::DOMURL::hostname): >+ (WebCore::DOMURL::pathname): >+ (WebCore::DOMURL::filename): >+ (WebCore::DOMURL::href): >+ (WebCore::DOMURL::setHref): >+ (WebCore::DOMURL::toString): >+ * html/DOMURL.idl: >+ * page/DOMWindow.idl: >+ > 2011-12-08 Sheriff Bot <webkit.review.bot@gmail.com> > > Unreviewed, rolling out r102323. >Index: Source/WebCore/html/DOMURL.cpp >=================================================================== >--- Source/WebCore/html/DOMURL.cpp (revision 102325) >+++ Source/WebCore/html/DOMURL.cpp (working copy) >@@ -1,5 +1,6 @@ > /* > * Copyright (C) 2011 Google Inc. All rights reserved. >+ * Copyright (C) 2011 Motorola Mobility Inc. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -24,56 +25,99 @@ > */ > > #include "config.h" >- >-#if ENABLE(BLOB) >- > #include "DOMURL.h" > >+#include "ActiveDOMObject.h" >+#include "KURL.h" >+#include "NotImplemented.h" >+#include "SecurityOrigin.h" >+#include <wtf/MainThread.h> >+ >+#if ENABLE(BLOB) > #include "Blob.h" > #include "BlobURL.h" >-#include "KURL.h" > #include "ScriptExecutionContext.h" > #include "ThreadableBlobRegistry.h" >-#include <wtf/MainThread.h> >- >+#include <wtf/PassOwnPtr.h> > #if ENABLE(MEDIA_STREAM) > #include "MediaStream.h" > #include "MediaStreamRegistry.h" > #endif >+#endif > > namespace WebCore { > >-DOMURL::DOMURL(ScriptExecutionContext* scriptExecutionContext) >- : ContextDestructionObserver(scriptExecutionContext) >+#if ENABLE(BLOB) >+class PublicURLManager; >+typedef HashMap<ScriptExecutionContext*, OwnPtr<PublicURLManager> > PublicURLManagerMap; >+static PublicURLManagerMap& publicURLManagerMap(); >+ >+class PublicURLManager : public ContextDestructionObserver { >+public: >+ explicit PublicURLManager(ScriptExecutionContext* scriptExecutionContext) >+ : ContextDestructionObserver(scriptExecutionContext) { } >+ >+ virtual void contextDestroyed() >+ { >+ HashSet<String>::iterator blobURLsEnd = m_blobURLs.end(); >+ for (HashSet<String>::iterator iter = m_blobURLs.begin(); iter != blobURLsEnd; ++iter) >+ ThreadableBlobRegistry::unregisterBlobURL(KURL(ParsedURLString, *iter)); >+ >+#if ENABLE(MEDIA_STREAM) >+ HashSet<String>::iterator streamURLsEnd = m_streamURLs.end(); >+ for (HashSet<String>::iterator iter = m_streamURLs.begin(); iter != streamURLsEnd; ++iter) >+ MediaStreamRegistry::registry().unregisterMediaStreamURL(KURL(ParsedURLString, *iter)); >+#endif >+ >+ ScriptExecutionContext* context = scriptExecutionContext(); >+ ContextDestructionObserver::contextDestroyed(); >+ publicURLManagerMap().remove(context); >+ } >+ >+ HashSet<String>& blobURLs() { return m_blobURLs; } >+#if ENABLE(MEDIA_STREAM) >+ HashSet<String>& streamURLs() { return m_streamURLs; } >+#endif >+ >+private: >+ HashSet<String> m_blobURLs; >+#if ENABLE(MEDIA_STREAM) >+ HashSet<String> m_streamURLs; >+#endif >+}; >+ >+static PublicURLManagerMap& publicURLManagerMap() > { >+ DEFINE_STATIC_LOCAL(PublicURLManagerMap, staticPublicURLManagers, ()); >+ return staticPublicURLManagers; > } > >-DOMURL::~DOMURL() >+static PublicURLManager& publicURLManager(ScriptExecutionContext* scriptExecutionContext) > { >+ PublicURLManagerMap& map = publicURLManagerMap(); >+ OwnPtr<PublicURLManager>& manager = map.add(scriptExecutionContext, nullptr).first->second; >+ if (!manager) >+ manager = adoptPtr(new PublicURLManager(scriptExecutionContext)); >+ return *manager; > } > >-void DOMURL::contextDestroyed() >+static HashSet<String>& publicBlobURLs(ScriptExecutionContext* scriptExecutionContext) > { >- ContextDestructionObserver::contextDestroyed(); >- >- HashSet<String>::iterator publicBlobURLsEnd = m_publicBlobURLs.end(); >- for (HashSet<String>::iterator iter = m_publicBlobURLs.begin(); iter != publicBlobURLsEnd; ++iter) >- ThreadableBlobRegistry::unregisterBlobURL(KURL(ParsedURLString, *iter)); >+ return publicURLManager(scriptExecutionContext).blobURLs(); >+} > > #if ENABLE(MEDIA_STREAM) >- HashSet<String>::iterator publicStreamURLsEnd = m_publicStreamURLs.end(); >- for (HashSet<String>::iterator iter = m_publicStreamURLs.begin(); iter != publicStreamURLsEnd; ++iter) >- MediaStreamRegistry::registry().unregisterMediaStreamURL(KURL(ParsedURLString, *iter)); >-#endif >+static HashSet<String>& publicStreamURLs(ScriptExecutionContext* scriptExecutionContext) >+{ >+ return publicURLManager(scriptExecutionContext).streamURLs(); > } > >-#if ENABLE(MEDIA_STREAM) >-String DOMURL::createObjectURL(MediaStream* stream) >+String DOMURL::createObjectURL(ScriptExecutionContext* scriptExecutionContext, MediaStream* stream) > { >- if (!m_scriptExecutionContext || !stream) >+ if (!scriptExecutionContext || !stream) > return String(); > >- KURL publicURL = BlobURL::createPublicURL(scriptExecutionContext()->securityOrigin()); >+ KURL publicURL = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin()); > if (publicURL.isEmpty()) > return String(); > >@@ -81,50 +125,210 @@ String DOMURL::createObjectURL(MediaStre > ASSERT(isMainThread()); > > MediaStreamRegistry::registry().registerMediaStreamURL(publicURL, stream); >- m_publicStreamURLs.add(publicURL.string()); >+ publicStreamURLs(scriptExecutionContext).add(publicURL.string()); > > return publicURL.string(); > } > #endif > >-String DOMURL::createObjectURL(Blob* blob) >+String DOMURL::createObjectURL(ScriptExecutionContext* scriptExecutionContext, Blob* blob) > { >- if (!m_scriptExecutionContext || !blob) >+ if (!scriptExecutionContext || !blob) > return String(); > >- KURL publicURL = BlobURL::createPublicURL(scriptExecutionContext()->securityOrigin()); >+ KURL publicURL = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin()); > if (publicURL.isEmpty()) > return String(); > > ThreadableBlobRegistry::registerBlobURL(publicURL, blob->url()); >- m_publicBlobURLs.add(publicURL.string()); >+ publicBlobURLs(scriptExecutionContext).add(publicURL.string()); > > return publicURL.string(); > } > >-void DOMURL::revokeObjectURL(const String& urlString) >+void DOMURL::revokeObjectURL(ScriptExecutionContext* scriptExecutionContext, const String& urlString) > { >- if (!m_scriptExecutionContext) >+ if (!scriptExecutionContext) > return; > > KURL url(KURL(), urlString); > >- if (m_publicBlobURLs.contains(url.string())) { >+ HashSet<String>& blobURLs = publicBlobURLs(scriptExecutionContext); >+ if (blobURLs.contains(url.string())) { > ThreadableBlobRegistry::unregisterBlobURL(url); >- m_publicBlobURLs.remove(url.string()); >+ blobURLs.remove(url.string()); > } >- > #if ENABLE(MEDIA_STREAM) >- if (m_publicStreamURLs.contains(url.string())) { >+ HashSet<String>& streamURLs = publicStreamURLs(scriptExecutionContext); >+ if (streamURLs.contains(url.string())) { > // FIXME: make sure of this assertion below. Raise a spec question if required. > // Since WebWorkers cannot obtain Stream objects, we should be on the main thread. > ASSERT(isMainThread()); > MediaStreamRegistry::registry().unregisterMediaStreamURL(url); >- m_publicStreamURLs.remove(url.string()); >+ streamURLs.remove(url.string()); > } > #endif > } >+#endif >+ >+DOMURL::DOMURL(const String& url, const String& baseURL) >+{ >+ m_href = KURL(KURL(), url); >+ // Resolve the URL relative to baseURL if is provide. >+ if (!baseURL.isEmpty()) >+ m_href = KURL(m_href, baseURL); >+} >+ >+DOMURL::~DOMURL() >+{ >+} >+ >+String DOMURL::host() const >+{ >+ if (m_href.hostEnd() == m_href.pathStart()) >+ return m_href.host(); >+ if (isDefaultPortForProtocol(m_href.port(), m_href.protocol())) >+ return m_href.host(); >+ return m_href.host() + ":" + String::number(m_href.port()); >+} >+ >+void DOMURL::setHost(const String& value) >+{ >+ if (value.isEmpty()) >+ return; >+ >+ if (!m_href.canSetHostOrPort()) >+ return; >+ >+ size_t colon = value.find(':'); >+ if (!colon) >+ return; >+ >+ if (colon == notFound) >+ m_href.setHostAndPort(value); >+ else { >+ unsigned portStart = colon + 1; >+ unsigned portEnd = portStart; >+ >+ while (isASCIIDigit(value[portEnd])) >+ ++portEnd; >+ >+ unsigned port = value.substring(portStart, portEnd - portStart).toUInt(); >+ if (!port) >+ m_href.setHostAndPort(value.substring(0, colon + 1) + "0"); >+ else { >+ if (isDefaultPortForProtocol(port, m_href.protocol())) >+ m_href.setHostAndPort(value.substring(0, colon)); >+ else >+ m_href.setHostAndPort(value.substring(0, portEnd)); >+ } >+ } >+} >+ >+void DOMURL::setHostname(const String& value) >+{ >+ unsigned i = 0; >+ unsigned hostLength = value.length(); >+ while (value[i] == '/') >+ i++; >+ >+ if (i == hostLength) >+ return; >+ >+ if (!m_href.canSetHostOrPort()) >+ return; >+ >+ m_href.setHost(value.substring(i)); >+} >+ >+String DOMURL::port() const >+{ >+ if (href().hasPort()) >+ return String::number(href().port()); >+ >+ return emptyString(); >+} >+ >+void DOMURL::setPort(const String& value) >+{ >+ if (!m_href.canSetHostOrPort()) >+ return; >+ >+ unsigned port = value.toUInt(); >+ if (isDefaultPortForProtocol(port, m_href.protocol())) >+ m_href.removePort(); >+ else >+ m_href.setPort(value.toUInt()); >+} >+ >+void DOMURL::setPathname(const String& value) >+{ >+ if (!m_href.canSetPathname()) >+ return; >+ >+ String newPathname = (value[0] == '/') ? value : ("/" + value); >+ m_href.setPath(newPathname); >+} >+ >+String DOMURL::search() const >+{ >+ String query = href().query(); >+ return query.isEmpty() ? emptyString() : "?" + query; >+} >+ >+void DOMURL::setSearch(const String& value) >+{ >+ String newSearch = (value[0] == '?') ? value.substring(1) : value; >+ m_href.setQuery(newSearch); >+} >+ >+String DOMURL::hash() const >+{ >+ String fragment = href().fragmentIdentifier(); >+ return fragment.isEmpty() ? emptyString() : "#" + fragment; >+} >+ >+void DOMURL::setHash(const String& value) >+{ >+ String newHash = (value[0] == '#') ? value.substring(1) : value; >+ m_href.setFragmentIdentifier(newHash); >+} >+ >+void DOMURL::setFilename(const String&) >+{ >+ // FIXME: Implement me. >+ notImplemented(); >+} >+ >+String DOMURL::origin() const >+{ >+ RefPtr<SecurityOrigin> origin = SecurityOrigin::create(href()); >+ return origin->toString(); >+} >+ >+String DOMURL::getParameter(const String&) >+{ >+ // FIXME: Implement me. >+ notImplemented(); >+ return String(); >+} >+ >+void DOMURL::appendParameter(const String&, const PassRefPtr<DOMStringList>) >+{ >+ // FIXME: Implement me. >+ notImplemented(); >+} >+ >+void DOMURL::appendParameter(const String&, const String&) >+{ >+ // FIXME: Implement me. >+ notImplemented(); >+} >+void DOMURL::clearParameter(const String&) >+{ >+ // FIXME: Implement me. >+ notImplemented(); >+} > > } // namespace WebCore > >-#endif // ENABLE(BLOB) >Index: Source/WebCore/html/DOMURL.h >=================================================================== >--- Source/WebCore/html/DOMURL.h (revision 102325) >+++ Source/WebCore/html/DOMURL.h (working copy) >@@ -1,5 +1,6 @@ > /* > * Copyright (C) 2011 Google Inc. All rights reserved. >+ * Copyright (C) 2011 Motorola Mobility Inc. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -26,11 +27,9 @@ > #ifndef DOMURL_h > #define DOMURL_h > >-#if ENABLE(BLOB) >- >-#include "ActiveDOMObject.h" >+#include "DOMStringList.h" >+#include "KURL.h" > #include "PlatformString.h" >-#include <wtf/HashSet.h> > #include <wtf/PassRefPtr.h> > #include <wtf/RefCounted.h> > >@@ -40,30 +39,70 @@ class Blob; > class MediaStream; > class ScriptExecutionContext; > >-class DOMURL : public RefCounted<DOMURL>, public ContextDestructionObserver { >+class DOMURL : public RefCounted<DOMURL> { > public: >- static PassRefPtr<DOMURL> create(ScriptExecutionContext* scriptExecutionContext) { return adoptRef(new DOMURL(scriptExecutionContext)); } >+ static PassRefPtr<DOMURL> create(const String& url, const String& baseURL) { return adoptRef(new DOMURL(url, baseURL)); } >+ static PassRefPtr<DOMURL> create(const String& url) { return adoptRef(new DOMURL(url, emptyString())); } > ~DOMURL(); > >-#if ENABLE(MEDIA_STREAM) >- String createObjectURL(MediaStream*); >-#endif >- String createObjectURL(Blob*); >- void revokeObjectURL(const String&); >+ String protocol() const { return href().protocol() + ":"; } >+ void setProtocol(const String& value) { m_href.setProtocol(value); } > >-private: >- explicit DOMURL(ScriptExecutionContext*); >+ String username() const { return href().user(); } >+ void setUsername(const String& value) { m_href.setUser(value); } >+ >+ String password() const { return href().pass(); } >+ void setPassword(const String& value) { m_href.setPass(value); } >+ >+ String host() const; >+ void setHost(const String&); >+ >+ String hostname() const { return href().host(); } >+ void setHostname(const String&); >+ >+ String port() const; >+ void setPort(const String&); >+ >+ String pathname() const { return href().path(); } >+ void setPathname(const String&); >+ >+ String search() const; >+ void setSearch(const String&); >+ >+ String hash() const; >+ void setHash(const String&); > >- virtual void contextDestroyed(); >+ String filename() const { return href().lastPathComponent(); } >+ void setFilename(const String&); > >- HashSet<String> m_publicBlobURLs; >+ String origin() const; >+ >+ KURL href() const { return m_href; } >+ void setHref(const String& value) { m_href = KURL(KURL(), value); } >+ >+ String toString() const { return m_href.string(); } >+ >+ String getParameter(const String&); >+ void appendParameter(const String&, const String&); >+ void appendParameter(const String&, const PassRefPtr<DOMStringList>); >+ void clearParameter(const String&); >+ >+#if ENABLE(BLOB) >+ static void contextDestroyed(ScriptExecutionContext*); >+ >+ static String createObjectURL(ScriptExecutionContext*, Blob*); >+ static void revokeObjectURL(ScriptExecutionContext*, const String&); > #if ENABLE(MEDIA_STREAM) >- HashSet<String> m_publicStreamURLs; >+ static String createObjectURL(ScriptExecutionContext*, MediaStream*); > #endif >+#endif >+ >+private: >+ KURL m_href; >+ >+ DOMURL(const String&, const String&); > }; > > } // namespace WebCore > >-#endif // ENABLE(BLOB) >- > #endif // DOMURL_h >Index: Source/WebCore/html/DOMURL.idl >=================================================================== >--- Source/WebCore/html/DOMURL.idl (revision 102325) >+++ Source/WebCore/html/DOMURL.idl (working copy) >@@ -1,5 +1,6 @@ > /* > * Copyright (C) 2011 Google Inc. All rights reserved. >+ * Copyright (C) 2011 Motorola Mobility Inc. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -25,16 +26,35 @@ > > module html { > interface [ >- Conditional=BLOB, >- OmitConstructor, > GenerateNativeConverter, > GenerateToJS, >- NoStaticTables >+ Replaceable, >+ Constructor(in DOMString url, in [Optional=CallWithNullValue] DOMString baseURL) > ] DOMURL { >+ attribute DOMString protocol; >+ attribute DOMString username; >+ attribute DOMString password; >+ attribute DOMString host; >+ attribute DOMString hostname; >+ attribute DOMString port; >+ attribute DOMString pathname; >+ attribute DOMString search; >+ attribute DOMString hash; >+ >+ attribute DOMString filename; >+ readonly attribute DOMString origin; >+ stringifier attribute DOMString href; >+ >+ [DontEnum] DOMString toString(); >+ DOMString getParameter(in DOMString name); >+ void appendParameter(in DOMString name, in DOMString values); >+ void appendParameter(in DOMString name, in DOMString[] values); >+ void clearParameter(in DOMString name); >+ > #if defined(ENABLE_MEDIA_STREAM) && ENABLE_MEDIA_STREAM >- [ConvertNullStringTo=Undefined] DOMString createObjectURL(in MediaStream stream); >+ static [Conditional=BLOB,ConvertNullStringTo=Undefined,CallWith=ScriptExecutionContext] DOMString createObjectURL(in MediaStream stream); > #endif >- [ConvertNullStringTo=Undefined] DOMString createObjectURL(in Blob blob); >- void revokeObjectURL(in DOMString url); >+ static [Conditional=BLOB,ConvertNullStringTo=Undefined,CallWith=ScriptExecutionContext] DOMString createObjectURL(in Blob blob); >+ static [Conditional=BLOB,CallWith=ScriptExecutionContext] void revokeObjectURL(in DOMString url); > }; > } >Index: Source/WebCore/page/DOMWindow.cpp >=================================================================== >--- Source/WebCore/page/DOMWindow.cpp (revision 102325) >+++ Source/WebCore/page/DOMWindow.cpp (working copy) >@@ -1935,15 +1935,6 @@ void DOMWindow::showModalDialog(const St > dialogFrame->page()->chrome()->runModal(); > } > >-#if ENABLE(BLOB) >-DOMURL* DOMWindow::webkitURL() const >-{ >- if (!m_domURL && isCurrentlyDisplayedInFrame()) >- m_domURL = DOMURL::create(this->scriptExecutionContext()); >- return m_domURL.get(); >-} >-#endif >- > #if ENABLE(QUOTA) > StorageInfo* DOMWindow::webkitStorageInfo() const > { >Index: Source/WebCore/page/DOMWindow.h >=================================================================== >--- Source/WebCore/page/DOMWindow.h (revision 102325) >+++ Source/WebCore/page/DOMWindow.h (working copy) >@@ -347,10 +347,6 @@ namespace WebCore { > using RefCounted<DOMWindow>::ref; > using RefCounted<DOMWindow>::deref; > >-#if ENABLE(BLOB) >- DOMURL* webkitURL() const; >-#endif >- > #if ENABLE(SQL_DATABASE) > PassRefPtr<Database> openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&); > #endif >Index: Source/WebCore/page/DOMWindow.idl >=================================================================== >--- Source/WebCore/page/DOMWindow.idl (revision 102325) >+++ Source/WebCore/page/DOMWindow.idl (working copy) >@@ -813,7 +813,7 @@ module window { > > attribute [Conditional=BLOB] WebKitBlobBuilderConstructor WebKitBlobBuilder; > >- readonly attribute [Conditional=BLOB] DOMURL webkitURL; >+ attribute DOMURLConstructor webkitURL; > > #if defined(ENABLE_QUOTA) && ENABLE_QUOTA > readonly attribute [EnabledAtRuntime=Quota] StorageInfo webkitStorageInfo; >Index: Source/WebCore/workers/WorkerContext.cpp >=================================================================== >--- Source/WebCore/workers/WorkerContext.cpp (revision 102325) >+++ Source/WebCore/workers/WorkerContext.cpp (working copy) >@@ -379,15 +379,6 @@ EventTargetData* WorkerContext::ensureEv > return &m_eventTargetData; > } > >-#if ENABLE(BLOB) >-DOMURL* WorkerContext::webkitURL() const >-{ >- if (!m_domURL) >- m_domURL = DOMURL::create(this->scriptExecutionContext()); >- return m_domURL.get(); >-} >-#endif >- > #if ENABLE(FILE_SYSTEM) > void WorkerContext::webkitRequestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) > { >Index: Source/WebCore/workers/WorkerContext.h >=================================================================== >--- Source/WebCore/workers/WorkerContext.h (revision 102325) >+++ Source/WebCore/workers/WorkerContext.h (working copy) >@@ -131,10 +131,6 @@ namespace WebCore { > virtual bool isContextThread() const; > virtual bool isJSExecutionForbidden() const; > >-#if ENABLE(BLOB) >- DOMURL* webkitURL() const; >-#endif >- > #if ENABLE(FILE_SYSTEM) > enum FileSystemType { > TEMPORARY, >Index: Source/WebCore/workers/WorkerContext.idl >=================================================================== >--- Source/WebCore/workers/WorkerContext.idl (revision 102325) >+++ Source/WebCore/workers/WorkerContext.idl (working copy) >@@ -101,7 +101,7 @@ module threads { > attribute FileReaderSyncConstructor FileReaderSync; > #endif > >- readonly attribute [Conditional=BLOB] DOMURL webkitURL; >+ attribute DOMURLConstructor webkitURL; > > #if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM > const unsigned short TEMPORARY = 0; >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 102325) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,32 @@ >+2011-12-06 Kaustubh Atrawalkar <kaustubh@motorola.com> >+ >+ Implement URL API. >+ https://bugs.webkit.org/show_bug.cgi?id=71968 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Initial implementation of IDL Attributes. Added test cases. >+ >+ * fast/dom/DOMURL: Added. >+ * fast/dom/DOMURL/check-instanceof-domurl-functions-expected.txt: Added. >+ * fast/dom/DOMURL/check-instanceof-domurl-functions.html: Added. >+ * fast/dom/DOMURL/domurl-attribute-hash-expected.txt: Added. >+ * fast/dom/DOMURL/domurl-attribute-hash.html: Added. >+ * fast/dom/DOMURL/domurl-attribute-host-expected.txt: Added. >+ * fast/dom/DOMURL/domurl-attribute-host.html: Added. >+ * fast/dom/DOMURL/domurl-attribute-hostname-expected.txt: Added. >+ * fast/dom/DOMURL/domurl-attribute-hostname.html: Added. >+ * fast/dom/DOMURL/domurl-attribute-pathname-expected.txt: Added. >+ * fast/dom/DOMURL/domurl-attribute-pathname.html: Added. >+ * fast/dom/DOMURL/domurl-attribute-port-expected.txt: Added. >+ * fast/dom/DOMURL/domurl-attribute-port.html: Added. >+ * fast/dom/DOMURL/domurl-attribute-protocol-expected.txt: Added. >+ * fast/dom/DOMURL/domurl-attribute-protocol.html: Added. >+ * fast/dom/DOMURL/domurl-attribute-search-expected.txt: Added. >+ * fast/dom/DOMURL/domurl-attribute-search.html: Added. >+ * fast/dom/DOMURL/stringifier-domurl-attribute-href-expected.txt: Added. >+ * fast/dom/DOMURL/stringifier-domurl-attribute-href.html: Added. >+ > 2011-12-08 Csaba Osztrogonác <ossy@webkit.org> > > [WK2] Unreviewed gardening. >Index: LayoutTests/fast/dom/DOMURL/check-instanceof-domurl-functions-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/check-instanceof-domurl-functions-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/check-instanceof-domurl-functions-expected.txt (revision 0) >@@ -0,0 +1,62 @@ >+Test instanceof functions and properties of webkitURL. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS 'protocol' in webkitURL is false >+PASS 'username' in webkitURL is false >+PASS 'password' in webkitURL is false >+PASS 'host' in webkitURL is false >+PASS 'hostname' in webkitURL is false >+PASS 'port' in webkitURL is false >+PASS 'pathname' in webkitURL is false >+PASS 'search' in webkitURL is false >+PASS 'hash' in webkitURL is false >+PASS 'filename' in webkitURL is false >+PASS 'origin' in webkitURL is false >+PASS 'parameterNames' in webkitURL is false >+PASS 'getParametername' in webkitURL is false >+PASS 'getParameterAllname' in webkitURL is false >+PASS 'appendParameter' in webkitURL is false >+PASS 'clearParametername' in webkitURL is false >+PASS 'href' in webkitURL is false >+PASS 'createObjectURL' in webkitURL is true >+PASS 'revokeObjectURL' in webkitURL is true >+PASS url instanceof webkitURL is true >+PASS url.hasOwnProperty('getParameter') is false >+PASS url.hasOwnProperty('appendParameter') is false >+PASS url.hasOwnProperty('clearParameter') is false >+PASS url.createObjectURL is undefined. >+PASS url.revokeObjectURL is undefined. >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+PASS 'protocol' in webkitURL is false >+PASS 'username' in webkitURL is false >+PASS 'password' in webkitURL is false >+PASS 'host' in webkitURL is false >+PASS 'hostname' in webkitURL is false >+PASS 'port' in webkitURL is false >+PASS 'pathname' in webkitURL is false >+PASS 'search' in webkitURL is false >+PASS 'hash' in webkitURL is false >+PASS 'filename' in webkitURL is false >+PASS 'origin' in webkitURL is false >+PASS 'parameterNames' in webkitURL is false >+PASS 'getParametername' in webkitURL is false >+PASS 'getParameterAllname' in webkitURL is false >+PASS 'appendParameter' in webkitURL is false >+PASS 'clearParametername' in webkitURL is false >+PASS 'href' in webkitURL is false >+PASS 'createObjectURL' in webkitURL is true >+PASS 'revokeObjectURL' in webkitURL is true >+PASS url instanceof webkitURL is true >+PASS url.hasOwnProperty('getParameter') is false >+PASS url.hasOwnProperty('appendParameter') is false >+PASS url.hasOwnProperty('clearParameter') is false >+PASS url.createObjectURL is undefined. >+PASS url.revokeObjectURL is undefined. >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/check-instanceof-domurl-functions.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/check-instanceof-domurl-functions.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/check-instanceof-domurl-functions.html (revision 0) >@@ -0,0 +1,86 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description("Test instanceof functions and properties of webkitURL."); >+ >+var url = new webkitURL("www.webkit.org"); >+ >+shouldBeFalse("'protocol' in webkitURL"); >+shouldBeFalse("'username' in webkitURL"); >+shouldBeFalse("'password' in webkitURL"); >+shouldBeFalse("'host' in webkitURL"); >+shouldBeFalse("'hostname' in webkitURL"); >+shouldBeFalse("'port' in webkitURL"); >+shouldBeFalse("'pathname' in webkitURL"); >+shouldBeFalse("'search' in webkitURL"); >+shouldBeFalse("'hash' in webkitURL"); >+shouldBeFalse("'filename' in webkitURL"); >+shouldBeFalse("'origin' in webkitURL"); >+shouldBeFalse("'parameterNames' in webkitURL"); >+shouldBeFalse("'getParametername' in webkitURL"); >+shouldBeFalse("'getParameterAllname' in webkitURL"); >+shouldBeFalse("'appendParameter' in webkitURL"); >+shouldBeFalse("'clearParametername' in webkitURL"); >+shouldBeFalse("'href' in webkitURL"); >+ >+shouldBeTrue("'createObjectURL' in webkitURL"); >+shouldBeTrue("'revokeObjectURL' in webkitURL"); >+ >+shouldBeTrue("url instanceof webkitURL") >+shouldBeFalse("url.hasOwnProperty('getParameter')") >+shouldBeFalse("url.hasOwnProperty('appendParameter')") >+shouldBeFalse("url.hasOwnProperty('clearParameter')") >+shouldBeUndefined("url.createObjectURL"); >+shouldBeUndefined("url.revokeObjectURL"); >+ >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description("Test instanceof functions and properties of webkitURL."); >+ >+var url = new webkitURL("www.webkit.org"); >+ >+shouldBeFalse("'protocol' in webkitURL"); >+shouldBeFalse("'username' in webkitURL"); >+shouldBeFalse("'password' in webkitURL"); >+shouldBeFalse("'host' in webkitURL"); >+shouldBeFalse("'hostname' in webkitURL"); >+shouldBeFalse("'port' in webkitURL"); >+shouldBeFalse("'pathname' in webkitURL"); >+shouldBeFalse("'search' in webkitURL"); >+shouldBeFalse("'hash' in webkitURL"); >+shouldBeFalse("'filename' in webkitURL"); >+shouldBeFalse("'origin' in webkitURL"); >+shouldBeFalse("'parameterNames' in webkitURL"); >+shouldBeFalse("'getParametername' in webkitURL"); >+shouldBeFalse("'getParameterAllname' in webkitURL"); >+shouldBeFalse("'appendParameter' in webkitURL"); >+shouldBeFalse("'clearParametername' in webkitURL"); >+shouldBeFalse("'href' in webkitURL"); >+ >+shouldBeTrue("'createObjectURL' in webkitURL"); >+shouldBeTrue("'revokeObjectURL' in webkitURL"); >+ >+shouldBeTrue("url instanceof webkitURL") >+shouldBeFalse("url.hasOwnProperty('getParameter')") >+shouldBeFalse("url.hasOwnProperty('appendParameter')") >+shouldBeFalse("url.hasOwnProperty('clearParameter')") >+shouldBeUndefined("url.createObjectURL"); >+shouldBeUndefined("url.revokeObjectURL"); >+ >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/domurl-attribute-hash-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/domurl-attribute-hash-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/domurl-attribute-hash-expected.txt (revision 0) >@@ -0,0 +1,36 @@ >+Test setting the hash attribute of the DOMURL. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Hash value start with # >+PASS domurl.hash is "#middle" >+'?' in hash value >+PASS domurl.hash is "#hash?value" >+'#' in hash value, and illegal characters in hostname >+PASS domurl.hash is "" >+null hash >+PASS domurl.hash is "" >+hash to mailto: protocol >+PASS domurl.hash is "#hash-value" >+Add hash to non-standard protocol >+PASS domurl.hash is "#hash" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+Hash value start with # >+PASS domurl.hash is "#middle" >+'?' in hash value >+PASS domurl.hash is "#hash?value" >+'#' in hash value, and illegal characters in hostname >+PASS domurl.hash is "" >+null hash >+PASS domurl.hash is "" >+hash to mailto: protocol >+PASS domurl.hash is "#hash-value" >+Add hash to non-standard protocol >+PASS domurl.hash is "#hash" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/domurl-attribute-hash.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/domurl-attribute-hash.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/domurl-attribute-hash.html (revision 0) >@@ -0,0 +1,72 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description('Test setting the hash attribute of the DOMURL.'); >+ >+debug("Hash value start with #"); >+var domurl = new webkitURL("https://www.mydomain.com:8080/path/testurl.html#middle"); >+shouldBeEqualToString("domurl.hash", "#middle"); >+ >+debug("'?' in hash value"); >+var domurl = new webkitURL("http://www.mydomain.com/path/testurl.html#hash?value"); >+shouldBeEqualToString("domurl.hash", "#hash?value"); >+ >+debug("'#' in hash value, and illegal characters in hostname"); >+var domurl = new webkitURL("https://www.my\"d(){}|~om?ain#com/path/testurl.html#middle"); >+shouldBeEqualToString("domurl.hash", ""); >+ >+debug("null hash"); >+var domurl = new webkitURL("https://www.mydomain.com/path/testurl.html#"); >+shouldBeEqualToString("domurl.hash", ""); >+ >+debug("hash to mailto: protocol"); >+var domurl = new webkitURL("mailto:e-mail_address@goes_here#hash-value"); >+shouldBeEqualToString("domurl.hash", "#hash-value"); >+ >+debug("Add hash to non-standard protocol"); >+var domurl = new webkitURL("foo:bar#hash"); >+shouldBeEqualToString("domurl.hash", "#hash"); >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description('Test setting the hash attribute of the DOMURL.'); >+ >+debug("Hash value start with #"); >+var domurl = new webkitURL("https://www.mydomain.com:8080/path/testurl.html#middle"); >+shouldBeEqualToString("domurl.hash", "#middle"); >+ >+debug("'?' in hash value"); >+var domurl = new webkitURL("http://www.mydomain.com/path/testurl.html#hash?value"); >+shouldBeEqualToString("domurl.hash", "#hash?value"); >+ >+debug("'#' in hash value, and illegal characters in hostname"); >+var domurl = new webkitURL("https://www.my\"d(){}|~om?ain#com/path/testurl.html#middle"); >+shouldBeEqualToString("domurl.hash", ""); >+ >+debug("null hash"); >+var domurl = new webkitURL("https://www.mydomain.com/path/testurl.html#"); >+shouldBeEqualToString("domurl.hash", ""); >+ >+debug("hash to mailto: protocol"); >+var domurl = new webkitURL("mailto:e-mail_address@goes_here#hash-value"); >+shouldBeEqualToString("domurl.hash", "#hash-value"); >+ >+debug("Add hash to non-standard protocol"); >+var domurl = new webkitURL("foo:bar#hash"); >+shouldBeEqualToString("domurl.hash", "#hash"); >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/domurl-attribute-host-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/domurl-attribute-host-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/domurl-attribute-host-expected.txt (revision 0) >@@ -0,0 +1,24 @@ >+Test setting the host attribute of the DOMURL. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Basic test >+PASS domurl.host is "www.mydomain.com:8080" >+Default >+PASS domurl.host is "www.otherdomain.com" >+Host URL containing username >+PASS domurl.host is "domain.com:25" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+Basic test >+PASS domurl.host is "www.mydomain.com:8080" >+Default >+PASS domurl.host is "www.otherdomain.com" >+Host URL containing username >+PASS domurl.host is "domain.com:25" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/domurl-attribute-host.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/domurl-attribute-host.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/domurl-attribute-host.html (revision 0) >@@ -0,0 +1,50 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description('Test setting the host attribute of the DOMURL.'); >+ >+debug("Basic test"); >+var domurl = new webkitURL("https://www.mydomain.com:8080/path/"); >+shouldBeEqualToString("domurl.host", "www.mydomain.com:8080"); >+ >+debug("Default"); >+var domurl = new webkitURL("https://www.otherdomain.com/path/"); >+shouldBeEqualToString("domurl.host", "www.otherdomain.com"); >+ >+debug("Host URL containing username"); >+var domurl = new webkitURL("https://rwwmy@domain.com:25/pa..th/"); >+shouldBeEqualToString("domurl.host", "domain.com:25"); >+ >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description('Test setting the host attribute of the DOMURL.'); >+ >+debug("Basic test"); >+var domurl = new webkitURL("https://www.mydomain.com:8080/path/"); >+shouldBeEqualToString("domurl.host", "www.mydomain.com:8080"); >+ >+debug("Default"); >+var domurl = new webkitURL("https://www.otherdomain.com/path/"); >+shouldBeEqualToString("domurl.host", "www.otherdomain.com"); >+ >+debug("Host URL containing username"); >+var domurl = new webkitURL("https://rwwmy@domain.com:25/pa..th/"); >+shouldBeEqualToString("domurl.host", "domain.com:25"); >+ >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/domurl-attribute-hostname-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/domurl-attribute-hostname-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/domurl-attribute-hostname-expected.txt (revision 0) >@@ -0,0 +1,24 @@ >+Test setting the hostname attribute of the DOMURL. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Basic test >+PASS domurl.hostname is "www.mydomain.com" >+Hostname with foo: protocol >+PASS domurl.hostname is "www.mydomain.com" >+Set domurl hostname that contains space in it >+PASS domurl.hostname is "" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+Basic test >+PASS domurl.hostname is "www.mydomain.com" >+Hostname with foo: protocol >+PASS domurl.hostname is "www.mydomain.com" >+Set domurl hostname that contains space in it >+PASS domurl.hostname is "" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/domurl-attribute-hostname.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/domurl-attribute-hostname.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/domurl-attribute-hostname.html (revision 0) >@@ -0,0 +1,50 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description('Test setting the hostname attribute of the DOMURL.'); >+ >+debug("Basic test"); >+var domurl = new webkitURL("https://www.mydomain.com:8080/path/"); >+shouldBeEqualToString("domurl.hostname", "www.mydomain.com"); >+ >+debug("Hostname with foo: protocol"); >+var domurl = new webkitURL("foo://www.mydomain.com/path/"); >+shouldBeEqualToString("domurl.hostname", "www.mydomain.com"); >+ >+debug("Set domurl hostname that contains space in it"); >+var domurl = new webkitURL("http://www.my domain.com/path/"); >+shouldBeEqualToString("domurl.hostname", ""); >+ >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description('Test setting the hostname attribute of the DOMURL.'); >+ >+debug("Basic test"); >+var domurl = new webkitURL("https://www.mydomain.com:8080/path/"); >+shouldBeEqualToString("domurl.hostname", "www.mydomain.com"); >+ >+debug("Hostname with foo: protocol"); >+var domurl = new webkitURL("foo://www.mydomain.com/path/"); >+shouldBeEqualToString("domurl.hostname", "www.mydomain.com"); >+ >+debug("Set domurl hostname that contains space in it"); >+var domurl = new webkitURL("http://www.my domain.com/path/"); >+shouldBeEqualToString("domurl.hostname", ""); >+ >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/domurl-attribute-pathname-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/domurl-attribute-pathname-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/domurl-attribute-pathname-expected.txt (revision 0) >@@ -0,0 +1,24 @@ >+Test setting the pathname attribute of the DOMURL. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Basic Test >+PASS domurl.pathname is "/path/testurl.html" >+Pathname with symbols >+PASS domurl.pathname is "/pa%3Fth" >+pathname to null >+PASS domurl.pathname is "/" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+Basic Test >+PASS domurl.pathname is "/path/testurl.html" >+Pathname with symbols >+PASS domurl.pathname is "/pa%3Fth" >+pathname to null >+PASS domurl.pathname is "/" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/domurl-attribute-pathname.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/domurl-attribute-pathname.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/domurl-attribute-pathname.html (revision 0) >@@ -0,0 +1,50 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description('Test setting the pathname attribute of the DOMURL.'); >+ >+debug("Basic Test"); >+var domurl = new webkitURL("https://www.mydomain.com/path/testurl.html?key=value"); >+shouldBeEqualToString("domurl.pathname", "/path/testurl.html"); >+ >+debug("Pathname with symbols"); >+var domurl = new webkitURL("https://www.mydomain.com/pa%3Fth?key=value"); >+shouldBeEqualToString("domurl.pathname", "/pa%3Fth"); >+ >+debug("pathname to null"); >+var domurl = new webkitURL("https://www.mydomain.com/?key=value"); >+shouldBeEqualToString("domurl.pathname", "/"); >+ >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description('Test setting the pathname attribute of the DOMURL.'); >+ >+debug("Basic Test"); >+var domurl = new webkitURL("https://www.mydomain.com/path/testurl.html?key=value"); >+shouldBeEqualToString("domurl.pathname", "/path/testurl.html"); >+ >+debug("Pathname with symbols"); >+var domurl = new webkitURL("https://www.mydomain.com/pa%3Fth?key=value"); >+shouldBeEqualToString("domurl.pathname", "/pa%3Fth"); >+ >+debug("pathname to null"); >+var domurl = new webkitURL("https://www.mydomain.com/?key=value"); >+shouldBeEqualToString("domurl.pathname", "/"); >+ >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/domurl-attribute-port-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/domurl-attribute-port-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/domurl-attribute-port-expected.txt (revision 0) >@@ -0,0 +1,20 @@ >+Test getting the port attribute of the DOMURL. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Default or Unspecified port is empty >+PASS domurl.port is '' >+Empty port should be empty >+PASS domurl.port is '' >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+Default or Unspecified port is empty >+PASS domurl.port is '' >+Empty port should be empty >+PASS domurl.port is '' >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/domurl-attribute-port.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/domurl-attribute-port.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/domurl-attribute-port.html (revision 0) >@@ -0,0 +1,40 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description('Test getting the port attribute of the DOMURL.'); >+ >+var domurl = new webkitURL("http://webkit.org"); >+debug("Default or Unspecified port is empty"); >+shouldBe("domurl.port", "''"); >+ >+var domurl = new webkitURL("http://webkit.org:/"); >+debug("Empty port should be empty"); >+shouldBe("domurl.port", "''"); >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description('Test getting the port attribute of the DOMURL.'); >+ >+var domurl = new webkitURL("http://webkit.org"); >+debug("Default or Unspecified port is empty"); >+shouldBe("domurl.port", "''"); >+ >+var domurl = new webkitURL("http://webkit.org:/"); >+debug("Empty port should be empty"); >+shouldBe("domurl.port", "''"); >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/domurl-attribute-protocol-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/domurl-attribute-protocol-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/domurl-attribute-protocol-expected.txt (revision 0) >@@ -0,0 +1,20 @@ >+Test setting the protocol attribute of the DOMURL. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Basic test >+PASS domurl.protocol is "http-foo:" >+Protocol on malformed URL >+PASS domurl.protocol is "foo:" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+Basic test >+PASS domurl.protocol is "http-foo:" >+Protocol on malformed URL >+PASS domurl.protocol is "foo:" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/domurl-attribute-protocol.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/domurl-attribute-protocol.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/domurl-attribute-protocol.html (revision 0) >@@ -0,0 +1,44 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description('Test setting the protocol attribute of the DOMURL.'); >+ >+ >+debug("Basic test"); >+var domurl = new webkitURL("http-foo://www.mydomain.com/path/"); >+shouldBeEqualToString("domurl.protocol","http-foo:"); >+ >+debug("Protocol on malformed URL"); >+var domurl = new webkitURL("foo:??bar"); >+shouldBeEqualToString("domurl.protocol", "foo:"); >+ >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description('Test setting the protocol attribute of the DOMURL.'); >+ >+ >+debug("Basic test"); >+var domurl = new webkitURL("http-foo://www.mydomain.com/path/"); >+shouldBeEqualToString("domurl.protocol","http-foo:"); >+ >+debug("Protocol on malformed URL"); >+var domurl = new webkitURL("foo:??bar"); >+shouldBeEqualToString("domurl.protocol", "foo:"); >+ >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/domurl-attribute-search-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/domurl-attribute-search-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/domurl-attribute-search-expected.txt (revision 0) >@@ -0,0 +1,32 @@ >+Test setting the search attribute of the DOMURL. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Basic Test >+PASS domurl.search is "?key=value" >+Search that starts with '?' and contains spaces >+PASS domurl.search is "?val%20ue=%20key?" >+Search on malformed URL >+PASS domurl.search is "?%" >+Search containing '#' >+PASS domurl.search is "?key=value" >+Search to empty >+PASS domurl.search is "" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+Basic Test >+PASS domurl.search is "?key=value" >+Search that starts with '?' and contains spaces >+PASS domurl.search is "?val%20ue=%20key?" >+Search on malformed URL >+PASS domurl.search is "?%" >+Search containing '#' >+PASS domurl.search is "?key=value" >+Search to empty >+PASS domurl.search is "" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/domurl-attribute-search.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/domurl-attribute-search.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/domurl-attribute-search.html (revision 0) >@@ -0,0 +1,66 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description('Test setting the search attribute of the DOMURL.'); >+ >+debug("Basic Test"); >+var domurl = new webkitURL("https://www.mydomain.com/path/?key=value"); >+shouldBeEqualToString("domurl.search", "?key=value"); >+ >+debug("Search that starts with '?' and contains spaces"); >+var domurl = new webkitURL("https://www.mydomain.com/path/?val%20ue=%20key?"); >+shouldBeEqualToString("domurl.search", "?val%20ue=%20key?"); >+ >+debug("Search on malformed URL"); >+var domurl = new webkitURL("s:www.mydomain.com/path/?%"); >+shouldBeEqualToString("domurl.search", "?%"); >+ >+debug("Search containing '#'"); >+var domurl = new webkitURL("https://www.mydomain.com/path/?key=value#hash"); >+shouldBeEqualToString("domurl.search", "?key=value"); >+ >+debug("Search to empty"); >+var domurl = new webkitURL("https://www.mydomain.com/path/"); >+shouldBeEqualToString("domurl.search", ""); >+ >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description('Test setting the search attribute of the DOMURL.'); >+ >+debug("Basic Test"); >+var domurl = new webkitURL("https://www.mydomain.com/path/?key=value"); >+shouldBeEqualToString("domurl.search", "?key=value"); >+ >+debug("Search that starts with '?' and contains spaces"); >+var domurl = new webkitURL("https://www.mydomain.com/path/?val%20ue=%20key?"); >+shouldBeEqualToString("domurl.search", "?val%20ue=%20key?"); >+ >+debug("Search on malformed URL"); >+var domurl = new webkitURL("s:www.mydomain.com/path/?%"); >+shouldBeEqualToString("domurl.search", "?%"); >+ >+debug("Search containing '#'"); >+var domurl = new webkitURL("https://www.mydomain.com/path/?key=value#hash"); >+shouldBeEqualToString("domurl.search", "?key=value"); >+ >+debug("Search to empty"); >+var domurl = new webkitURL("https://www.mydomain.com/path/"); >+shouldBeEqualToString("domurl.search", ""); >+ >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/stringifier-domurl-attribute-href-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/stringifier-domurl-attribute-href-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/stringifier-domurl-attribute-href-expected.txt (revision 0) >@@ -0,0 +1,14 @@ >+Test stringifier property of href attribute of the DOMURL. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS url.toString() is url.href >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+PASS url.toString() is url.href >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/stringifier-domurl-attribute-href.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/stringifier-domurl-attribute-href.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/stringifier-domurl-attribute-href.html (revision 0) >@@ -0,0 +1,30 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description("Test stringifier property of href attribute of the DOMURL."); >+ >+var url = new webkitURL("http://www.example.com"); >+shouldBe("url.toString()", "url.href"); >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description("Test stringifier property of href attribute of the DOMURL."); >+ >+var url = new webkitURL("http://www.example.com"); >+shouldBe("url.toString()", "url.href"); >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
webkit.review.bot
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 71968
:
114916
|
115121
|
115138
|
115532
|
115780
|
116327
|
116565
|
118024
|
118104
|
118145
|
118290
|
118365
|
118687