WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Working Progress Patch
71968-patch.txt (text/plain), 34.45 KB, created by
Kaustubh Atrawalkar
on 2011-11-23 01:34:10 PST
(
hide
)
Description:
Working Progress Patch
Filename:
MIME Type:
Creator:
Kaustubh Atrawalkar
Created:
2011-11-23 01:34:10 PST
Size:
34.45 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 101044) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,57 @@ >+2011-11-22 Kaustubh Atrawalkar <kaustubh@motorola.com> >+ >+ Implement URL API >+ https://bugs.webkit.org/show_bug.cgi?id=71968 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Initial implementation of DOMURL IDL attributes. >+ >+ 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::href): >+ (WebCore::DOMURL::setHref): >+ (WebCore::DOMURL::protocol): >+ (WebCore::DOMURL::setProtocol): >+ (WebCore::DOMURL::username): >+ (WebCore::DOMURL::setUsername): >+ (WebCore::DOMURL::password): >+ (WebCore::DOMURL::setPassword): >+ (WebCore::DOMURL::host): >+ (WebCore::DOMURL::setHost): >+ (WebCore::DOMURL::hostname): >+ (WebCore::DOMURL::setHostname): >+ (WebCore::DOMURL::port): >+ (WebCore::DOMURL::setPort): >+ (WebCore::DOMURL::pathname): >+ (WebCore::DOMURL::setPathname): >+ (WebCore::DOMURL::search): >+ (WebCore::DOMURL::setSearch): >+ (WebCore::DOMURL::hash): >+ (WebCore::DOMURL::setHash): >+ (WebCore::DOMURL::filename): >+ (WebCore::DOMURL::setFilename): >+ (WebCore::DOMURL::origin): >+ (WebCore::DOMURL::getParameter): >+ (WebCore::DOMURL::appendParameter): >+ (WebCore::DOMURL::clearParameter): >+ * html/DOMURL.h: >+ (WebCore::DOMURL::create): >+ (WebCore::DOMURL::toString): >+ * html/DOMURL.idl: >+ * page/DOMWindow.idl: >+ > 2011-11-22 Kenneth Russell <kbr@google.com> > > [chromium] Support Core Animation plugins in compositor >Index: Source/WebCore/html/DOMURL.cpp >=================================================================== >--- Source/WebCore/html/DOMURL.cpp (revision 101044) >+++ 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,38 +25,49 @@ > */ > > #include "config.h" >- >-#if ENABLE(BLOB) >- > #include "DOMURL.h" > >-#include "Blob.h" >-#include "BlobURL.h" > #include "KURL.h" >+#include "NotImplemented.h" > #include "ScriptExecutionContext.h" >-#include "ThreadableBlobRegistry.h" >+#include "SecurityOrigin.h" > #include <wtf/MainThread.h> > >+#if ENABLE(BLOB) >+#include "Blob.h" >+#include "BlobURL.h" >+#include "ThreadableBlobRegistry.h" > #if ENABLE(MEDIA_STREAM) > #include "MediaStream.h" > #include "MediaStreamRegistry.h" > #endif >+#endif > > namespace WebCore { > >-DOMURL::DOMURL(ScriptExecutionContext* scriptExecutionContext) >- : ContextDestructionObserver(scriptExecutionContext) >+DOMURL::DOMURL(const String& url, const String& baseURL) >+ : ContextDestructionObserver(0) > { >+ 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() > { > } > >+DOMURL::DOMURL(ScriptExecutionContext* scriptExecutionContext) >+ : ContextDestructionObserver(scriptExecutionContext) >+{ >+} >+ > void DOMURL::contextDestroyed() > { > ContextDestructionObserver::contextDestroyed(); > >+#if ENABLE(BLOB) > HashSet<String>::iterator publicBlobURLsEnd = m_publicBlobURLs.end(); > for (HashSet<String>::iterator iter = m_publicBlobURLs.begin(); iter != publicBlobURLsEnd; ++iter) > ThreadableBlobRegistry::unregisterBlobURL(KURL(ParsedURLString, *iter)); >@@ -65,8 +77,10 @@ void DOMURL::contextDestroyed() > for (HashSet<String>::iterator iter = m_publicStreamURLs.begin(); iter != publicStreamURLsEnd; ++iter) > MediaStreamRegistry::registry().unregisterMediaStreamURL(KURL(ParsedURLString, *iter)); > #endif >+#endif > } > >+#if ENABLE(BLOB) > #if ENABLE(MEDIA_STREAM) > String DOMURL::createObjectURL(MediaStream* stream) > { >@@ -124,7 +138,247 @@ void DOMURL::revokeObjectURL(const Strin > } > #endif > } >+#endif >+ >+KURL DOMURL::href() const >+{ >+ return m_href; >+} >+ >+void DOMURL::setHref(const String& value) >+{ >+ m_href = KURL(KURL(), value); >+} >+ >+String DOMURL::protocol() const >+{ >+ return href().protocol() + ":"; >+} >+ >+void DOMURL::setProtocol(const String& value) >+{ >+ if (value == "null") >+ return; >+ >+ KURL url = href(); >+ url.setProtocol(value); >+ setHref(url.string()); >+} >+ >+String DOMURL::username() const >+{ >+ return href().user(); >+} >+ >+void DOMURL::setUsername(const String& value) >+{ >+ KURL url = href(); >+ url.setUser(value); >+ setHref(url.string()); >+} >+ >+String DOMURL::password() const >+{ >+ return href().pass(); >+} >+ >+void DOMURL::setPassword(const String& value) >+{ >+ KURL url = href(); >+ url.setPass(value); >+ setHref(url.string()); >+} >+ >+String DOMURL::host() const >+{ >+ const KURL& url = href(); >+ if (url.hostEnd() == url.pathStart()) >+ return url.host(); >+ if (isDefaultPortForProtocol(url.port(), url.protocol())) >+ return url.host(); >+ return url.host() + ":" + String::number(url.port()); >+} >+ >+void DOMURL::setHost(const String& value) >+{ >+ if (value.isEmpty() || value == "null") >+ return; >+ >+ KURL url = href(); >+ if (!url.canSetHostOrPort()) >+ return; >+ >+ size_t colon = value.find(':'); >+ if (!colon) >+ return; >+ >+ if (colon == notFound) >+ url.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) >+ url.setHostAndPort(value.substring(0, colon + 1) + "0"); >+ else { >+ if (isDefaultPortForProtocol(port, url.protocol())) >+ url.setHostAndPort(value.substring(0, colon)); >+ else >+ url.setHostAndPort(value.substring(0, portEnd)); >+ } >+ } >+ setHref(url.string()); >+} >+ >+String DOMURL::hostname() const >+{ >+ return href().host(); >+} >+ >+void DOMURL::setHostname(const String& value) >+{ >+ if (value == "null") >+ return; >+ >+ unsigned i = 0; >+ unsigned hostLength = value.length(); >+ while (value[i] == '/') >+ i++; >+ >+ if (i == hostLength) >+ return; >+ >+ KURL url = href(); >+ if (!url.canSetHostOrPort()) >+ return; >+ >+ url.setHost(value.substring(i)); >+ setHref(url.string()); >+} >+ >+String DOMURL::port() const >+{ >+ if (href().hasPort()) >+ return String::number(href().port()); >+ >+ return emptyString(); >+} >+ >+void DOMURL::setPort(const String& value) >+{ >+ KURL url = href(); >+ if (!url.canSetHostOrPort()) >+ return; >+ >+ unsigned port = value.toUInt(); >+ if (isDefaultPortForProtocol(port, url.protocol())) >+ url.removePort(); >+ else >+ url.setPort(value.toUInt()); >+ >+ setHref(url.string()); >+} >+ >+String DOMURL::pathname() const >+{ >+ return href().path(); >+} >+ >+void DOMURL::setPathname(const String& value) >+{ >+ KURL url = href(); >+ if (!url.canSetPathname()) >+ return; >+ >+ if (value == "null") >+ url.setPath(String()); >+ else { >+ String newPathname = (value[0] == '/') ? value : ("/" + value); >+ url.setPath(newPathname); >+ } >+ setHref(url.string()); >+} >+ >+String DOMURL::search() const >+{ >+ String query = href().query(); >+ return query.isEmpty() ? emptyString() : "?" + query; >+} >+ >+void DOMURL::setSearch(const String& value) >+{ >+ KURL url = href(); >+ if (value == "null") >+ url.setQuery(String()); >+ else { >+ String newSearch = (value[0] == '?') ? value.substring(1) : value; >+ url.setQuery(newSearch.replace('#', "%23")); >+ } >+ setHref(url.string()); >+} >+ >+String DOMURL::hash() const >+{ >+ String fragment = href().fragmentIdentifier(); >+ return fragment.isEmpty() ? emptyString() : "#" + fragment; >+} >+ >+void DOMURL::setHash(const String& value) >+{ >+ KURL url = href(); >+ if (value == "null" || value == "#") >+ url.setFragmentIdentifier(String()); >+ else { >+ String newHash = (value[0] == '#') ? value.substring(1) : value; >+ url.setFragmentIdentifier(newHash); >+ } >+ setHref(url.string()); >+} >+ >+String DOMURL::filename() const >+{ >+ return href().lastPathComponent(); >+} >+ >+void DOMURL::setFilename(const String&) >+{ >+ // FIXME: Need to implement. Currently not supported as per draft. >+ 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 101044) >+++ 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,9 +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> >@@ -42,28 +43,77 @@ class ScriptExecutionContext; > > class DOMURL : public RefCounted<DOMURL>, public ContextDestructionObserver { > 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(); > >+ String protocol() const; >+ void setProtocol(const String&); >+ >+ String username() const; >+ void setUsername(const String&); >+ >+ String password() const; >+ void setPassword(const String&); >+ >+ String host() const; >+ void setHost(const String&); >+ >+ String hostname() const; >+ void setHostname(const String&); >+ >+ String port() const; >+ void setPort(const String&); >+ >+ String pathname() const; >+ void setPathname(const String&); >+ >+ String search() const; >+ void setSearch(const String&); >+ >+ String hash() const; >+ void setHash(const String&); >+ >+ String filename() const; >+ void setFilename(const String&); >+ >+ String origin() const; >+ >+ KURL href() const; >+ void setHref(const String&); >+ >+ 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 PassRefPtr<DOMURL> create(ScriptExecutionContext* scriptExecutionContext) { return adoptRef(new DOMURL(scriptExecutionContext)); } > #if ENABLE(MEDIA_STREAM) > String createObjectURL(MediaStream*); > #endif > String createObjectURL(Blob*); > void revokeObjectURL(const String&); >+#endif > > private: >- explicit DOMURL(ScriptExecutionContext*); >+ KURL m_href; >+ >+ DOMURL(const String&, const String&); > >+#if ENABLE(BLOB) >+ explicit DOMURL(ScriptExecutionContext*); > virtual void contextDestroyed(); > > HashSet<String> m_publicBlobURLs; > #if ENABLE(MEDIA_STREAM) > HashSet<String> m_publicStreamURLs; > #endif >+#endif > }; > > } // namespace WebCore > >-#endif // ENABLE(BLOB) >- > #endif // DOMURL_h >Index: Source/WebCore/html/DOMURL.idl >=================================================================== >--- Source/WebCore/html/DOMURL.idl (revision 101044) >+++ 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,37 @@ > > module html { > interface [ >- Conditional=BLOB, >- OmitConstructor, > GenerateNativeConverter, > GenerateToJS, >- NoStaticTables >+ 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); >+ [Conditional=BLOB] [ConvertNullStringTo=Undefined] static DOMString createObjectURL(in MediaStream stream); >+ > #endif >- [ConvertNullStringTo=Undefined] DOMString createObjectURL(in Blob blob); >- void revokeObjectURL(in DOMString url); >+ [Conditional=BLOB] [ConvertNullStringTo=Undefined] static DOMString createObjectURL(in Blob blob); >+ [Conditional=BLOB] static void revokeObjectURL(in DOMString url); > }; > } >Index: Source/WebCore/page/DOMWindow.idl >=================================================================== >--- Source/WebCore/page/DOMWindow.idl (revision 101044) >+++ Source/WebCore/page/DOMWindow.idl (working copy) >@@ -812,7 +812,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: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 101044) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,32 @@ >+2011-11-22 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-11-22 Csaba Osztrogonác <ossy@webkit.org> > > [Qt][GTK] editing/spelling/spellcheck-async.html fails >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,30 @@ >+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 url instanceof webkitURL is true >+PASS url.hasOwnProperty('getParameter') is false >+PASS url.hasOwnProperty('appendParameter') is false >+PASS url.hasOwnProperty('clearParameter') is false >+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,43 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<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,21 @@ >+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 >+ >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,36 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<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,15 @@ >+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 >+ >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,25 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<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,15 @@ >+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 >+ >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,25 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<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,15 @@ >+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 >+ >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,25 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<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,13 @@ >+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 >+ >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,20 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<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,13 @@ >+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 >+ >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,22 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<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,19 @@ >+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 >+ >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,33 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<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,10 @@ >+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 >+ >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,15 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 71968
:
114916
|
115121
|
115138
|
115532
|
115780
|
116327
|
116565
|
118024
|
118104
|
118145
|
118290
|
118365
|
118687