WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
IDL Attributes implementation
71968-patch.txt (text/plain), 46.72 KB, created by
Kaustubh Atrawalkar
on 2011-11-18 03:34:25 PST
(
hide
)
Description:
IDL Attributes implementation
Filename:
MIME Type:
Creator:
Kaustubh Atrawalkar
Created:
2011-11-18 03:34:25 PST
Size:
46.72 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 100741) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,55 @@ >+2011-11-18 Kaustubh Atrawalkar <kaustubh@motorola.com> >+ >+ Intial Implementation of DOMURL. Adding IDL attributes and empty functions. >+ https://bugs.webkit.org/show_bug.cgi?id=71968 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implmenting DOMURL attributes as per the draft - >+ http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html >+ >+ Tests: fast/dom/DOMURL/get-domurl-attribute-port.html >+ fast/dom/DOMURL/set-domurl-attribute-hash.html >+ fast/dom/DOMURL/set-domurl-attribute-host.html >+ fast/dom/DOMURL/set-domurl-attribute-hostname.html >+ fast/dom/DOMURL/set-domurl-attribute-pathname.html >+ fast/dom/DOMURL/set-domurl-attribute-port.html >+ fast/dom/DOMURL/set-domurl-attribute-protocol.html >+ fast/dom/DOMURL/set-domurl-attribute-search.html >+ >+ * html/DOMURL.cpp: >+ (WebCore::DOMURL::DOMURL): >+ (WebCore::DOMURL::revokeObjectURL): >+ (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): >+ * html/DOMURL.idl: >+ > 2011-11-18 Adam Barth <abarth@webkit.org> > > Remove unneeded include (and ifdef) from V8DOMWindowCustom.cpp >Index: Source/WebCore/html/DOMURL.cpp >=================================================================== >--- Source/WebCore/html/DOMURL.cpp (revision 100561) >+++ 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 >@@ -32,7 +33,9 @@ > #include "Blob.h" > #include "BlobURL.h" > #include "KURL.h" >+#include "NotImplemented.h" > #include "ScriptExecutionContext.h" >+#include "SecurityOrigin.h" > #include "ThreadableBlobRegistry.h" > #include <wtf/MainThread.h> > >@@ -43,6 +46,15 @@ > > namespace WebCore { > >+DOMURL::DOMURL(String& url, String& baseURL) >+ : ContextDestructionObserver(0) >+ , m_href(KURL(ParsedURLString, url)) >+{ >+ // Resolve the URL relative to baseURL if is provide. >+ if (!baseURL.isEmpty()) >+ m_href = KURL(m_href, baseURL); >+} >+ > DOMURL::DOMURL(ScriptExecutionContext* scriptExecutionContext) > : ContextDestructionObserver(scriptExecutionContext) > { >@@ -125,6 +137,246 @@ void DOMURL::revokeObjectURL(const Strin > #endif > } > >+KURL DOMURL::href() const >+{ >+ return m_href; >+} >+ >+void DOMURL::setHref(const String& value) >+{ >+ m_href = KURL(ParsedURLString, 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 100561) >+++ 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 >@@ -29,6 +30,8 @@ > #if ENABLE(BLOB) > > #include "ActiveDOMObject.h" >+#include "DOMStringList.h" >+#include "KURL.h" > #include "PlatformString.h" > #include <wtf/HashSet.h> > #include <wtf/PassRefPtr.h> >@@ -43,8 +46,49 @@ 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(String& url, String& baseURL) { return adoptRef(new DOMURL(url, baseURL)); } > ~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 getParameter(const String&); >+ void appendParameter(const String&, const String&); >+ void appendParameter(const String&, const PassRefPtr<DOMStringList>); >+ void clearParameter(const String&); >+ > #if ENABLE(MEDIA_STREAM) > String createObjectURL(MediaStream*); > #endif >@@ -52,7 +96,10 @@ public: > void revokeObjectURL(const String&); > > private: >+ KURL m_href; >+ > explicit DOMURL(ScriptExecutionContext*); >+ DOMURL(String&, String&); > > virtual void contextDestroyed(); > >Index: Source/WebCore/html/DOMURL.idl >=================================================================== >--- Source/WebCore/html/DOMURL.idl (revision 100561) >+++ 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 >@@ -24,13 +25,33 @@ > */ > > module html { >+ [Constructor(DOMString url, optional DOMString baseURL)] > interface [ > Conditional=BLOB, >- OmitConstructor, > GenerateNativeConverter, > GenerateToJS, >- NoStaticTables >+ NoStaticTables, >+ Replaceable > ] 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; >+ attribute DOMString href; >+ >+ 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); > #endif >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 100741) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,40 @@ >+2011-11-18 Kaustubh Atrawalkar <kaustubh@motorola.com> >+ >+ Intial Implementation of DOMURL. Adding IDL attributes and empty functions. >+ https://bugs.webkit.org/show_bug.cgi?id=71968 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implmenting DOMURL attributes as per the draft - >+ http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html >+ >+ * fast/dom/DOMURL: Added. >+ * fast/dom/DOMURL/get-domurl-attribute-port-expected.txt: Added. >+ * fast/dom/DOMURL/get-domurl-attribute-port.html: Added. >+ * fast/dom/DOMURL/script-tests: Added. >+ * fast/dom/DOMURL/script-tests/get-domurl-attribute-port.js: Added. >+ * fast/dom/DOMURL/script-tests/set-domurl-attribute-hash.js: Added. >+ * fast/dom/DOMURL/script-tests/set-domurl-attribute-host.js: Added. >+ * fast/dom/DOMURL/script-tests/set-domurl-attribute-hostname.js: Added. >+ * fast/dom/DOMURL/script-tests/set-domurl-attribute-pathname.js: Added. >+ * fast/dom/DOMURL/script-tests/set-domurl-attribute-port.js: Added. >+ * fast/dom/DOMURL/script-tests/set-domurl-attribute-protocol.js: Added. >+ * fast/dom/DOMURL/script-tests/set-domurl-attribute-search.js: Added. >+ * fast/dom/DOMURL/set-domurl-attribute-hash-expected.txt: Added. >+ * fast/dom/DOMURL/set-domurl-attribute-hash.html: Added. >+ * fast/dom/DOMURL/set-domurl-attribute-host-expected.txt: Added. >+ * fast/dom/DOMURL/set-domurl-attribute-host.html: Added. >+ * fast/dom/DOMURL/set-domurl-attribute-hostname-expected.txt: Added. >+ * fast/dom/DOMURL/set-domurl-attribute-hostname.html: Added. >+ * fast/dom/DOMURL/set-domurl-attribute-pathname-expected.txt: Added. >+ * fast/dom/DOMURL/set-domurl-attribute-pathname.html: Added. >+ * fast/dom/DOMURL/set-domurl-attribute-port-expected.txt: Added. >+ * fast/dom/DOMURL/set-domurl-attribute-port.html: Added. >+ * fast/dom/DOMURL/set-domurl-attribute-protocol-expected.txt: Added. >+ * fast/dom/DOMURL/set-domurl-attribute-protocol.html: Added. >+ * fast/dom/DOMURL/set-domurl-attribute-search-expected.txt: Added. >+ * fast/dom/DOMURL/set-domurl-attribute-search.html: Added. >+ > 2011-11-18 Steve Block <steveblock@google.com> > > Rebaseline acid3.html for Chromium Mac 10.5 >Index: LayoutTests/fast/dom/DOMURL/get-domurl-attribute-port-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/get-domurl-attribute-port-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/get-domurl-attribute-port-expected.txt (revision 0) >@@ -0,0 +1,15 @@ >+Test getting the port attribute of the DOMURL. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Default port is empty >+PASS domurl.port is >+Unspecified port should return empty string >+PASS domurl.port is >+Empty port should be empty >+PASS domurl.port is >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/get-domurl-attribute-port.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/get-domurl-attribute-port.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/get-domurl-attribute-port.html (revision 0) >@@ -0,0 +1,10 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script src="script-tests/get-domurl-attribute-port.js"></script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/set-domurl-attribute-hash-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/set-domurl-attribute-hash-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/set-domurl-attribute-hash-expected.txt (revision 0) >@@ -0,0 +1,25 @@ >+Test setting the hash attribute of the DOMURL. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Hash value does not start with '#' >+PASS domurl.href is 'https://www.mydomain.com:8080/path/testurl.html#hash-value' >+Hash value starts with '#' >+PASS domurl.href is 'file:///path/testurl.html#hash_value' >+'?' in hash value >+PASS domurl.href is 'http://www.mydomain.com/path/testurl.html#hash?value' >+'#' in hash value, and illegal characters in hostname >+PASS domurl.href is 'https://www.my"d(){}|~om?ain#com/path/testurl.html#middle' >+Set hash to null >+PASS domurl.href is 'https://www.mydomain.com/path/testurl.html#' >+Set hash to empty string >+PASS domurl.href is 'https://www.mydomain.com/path/testurl.html#' >+Add hash to mailto: protocol >+PASS domurl.href is 'mailto:e-mail_address@goes_here#hash-value' >+Add hash to non-standard protocol >+PASS domurl.href is 'foo:bar#hash' >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/set-domurl-attribute-hash.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/set-domurl-attribute-hash.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/set-domurl-attribute-hash.html (revision 0) >@@ -0,0 +1,10 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script src="script-tests/set-domurl-attribute-hash.js"></script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/set-domurl-attribute-host-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/set-domurl-attribute-host-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/set-domurl-attribute-host-expected.txt (revision 0) >@@ -0,0 +1,39 @@ >+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.href is 'https://www.otherdomain.com:0/path/' >+Set host with '?' in it >+PASS domurl.href is 'https://www.other/?domain.com:8080/path/?key=value' >+Set default port for another protocol >+PASS domurl.href is 'https://www.otherdomain.com:80/path/' >+Set default port >+PASS domurl.href is 'https://www.otherdomain.com/path/' >+Set host with letters in port number >+PASS domurl.href is 'https://www.otherdomain.com:44/path/' >+Leading space in port number >+PASS domurl.href is 'https://www.otherdomain.com:0/path/' >+Colon without port number >+PASS domurl.href is 'https://www.otherdomain.com:0/path/' >+Set host to null >+PASS domurl.href is 'https://www.mydomain.com:8080/path/' >+Set host to empty string >+PASS domurl.href is 'https://www.mydomain.com:8080/path/' >+Set host to URL with file: protocol >+PASS domurl.href is 'file://mydomain.com/path/' >+Set host containing slashes in it >+PASS domurl.href is 'https://www.otherdom/ain.com/path/' >+Set host to domurl malformed URL >+PASS domurl.href is 'https:/\rww.my@domain.com:8080/path/' >+Set host that starts with ':' >+PASS domurl.href is 'https://domain.com:8080/path/' >+Set host to URL containing username and .. >+PASS domurl.href is 'https://rwwmy@www.other!domain.com:25/pa..th/' >+Set host to domurl URL with tel: protocol >+PASS domurl.href is 'tel:+1-816-555-1212' >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/set-domurl-attribute-host.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/set-domurl-attribute-host.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/set-domurl-attribute-host.html (revision 0) >@@ -0,0 +1,10 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script src="script-tests/set-domurl-attribute-host.js"></script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/set-domurl-attribute-hostname-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/set-domurl-attribute-hostname-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/set-domurl-attribute-hostname-expected.txt (revision 0) >@@ -0,0 +1,25 @@ >+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.href is 'https://www.otherdomain.com:8080/path/' >+Extra slashes before hostname >+PASS domurl.href is 'https://www.otherdomain.com:8080/path/' >+Set hostname to URL with foo: protocol >+PASS domurl.href is 'foo://www.otherdomain.com/path/' >+Set hostname to null >+PASS domurl.href is 'https://www.mydomain.com:8080/path/' >+Set hostname to empty string >+PASS domurl.href is 'https://www.mydomain.com:8080/path/' >+Set hostname to URL with 2 colons >+PASS domurl.href is 'really:bad:url' >+Set domurl hostname that contains space in it >+PASS domurl.href is 'http://www.my domain.com/path/' >+Set hostname to undefined >+PASS domurl.href is 'https://undefined:8080/path/' >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/set-domurl-attribute-hostname.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/set-domurl-attribute-hostname.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/set-domurl-attribute-hostname.html (revision 0) >@@ -0,0 +1,10 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script src="script-tests/set-domurl-attribute-hostname.js"></script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/set-domurl-attribute-pathname-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/set-domurl-attribute-pathname-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/set-domurl-attribute-pathname-expected.txt (revision 0) >@@ -0,0 +1,25 @@ >+Test setting the pathname attribute of the DOMURL. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Set pathname that starts with slash >+PASS domurl.href is 'https://www.mydomain.com/path%20name?key=value' >+Set pathname that does not start with slash and contains '?' >+PASS domurl.href is 'https://www.mydomain.com/pa%3Fth?key=value' >+Set pathname that starts with double slash and contains '#' >+PASS domurl.href is 'https://www.mydomain.com//path%23name?key=value' >+Set domurl pathname containing .. in it >+PASS domurl.href is 'https://www.mydomain.com/path?key=value' >+Set pathname to null >+PASS domurl.href is 'https://www.mydomain.com/?key=value' >+Set pathname to empty string >+PASS domurl.href is 'https://www.mydomain.com/?key=value' >+Set pathname that includes illegal characters to URL that contains illegal characters. >+PASS domurl.href is 'https://www.my|d[]()omain.com/path/testurl.html?key=value' >+Set pathname to domurl URL with non-hierarchical protocol >+PASS domurl.href is 'tel:+1800-555-1212' >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/set-domurl-attribute-pathname.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/set-domurl-attribute-pathname.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/set-domurl-attribute-pathname.html (revision 0) >@@ -0,0 +1,10 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script src="script-tests/set-domurl-attribute-pathname.js"></script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/set-domurl-attribute-port-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/set-domurl-attribute-port-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/set-domurl-attribute-port-expected.txt (revision 0) >@@ -0,0 +1,25 @@ >+Test setting the port attribute of the DOMURL. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Default port as number >+PASS domurl.href is 'https://www.webkit.org/path/testurl.html?key=value' >+Set port to 0 >+PASS domurl.href is 'https://www.webkit.org:0/path/testurl.html?key=value' >+Set port to undefined >+PASS domurl.href is 'https://www.webkit.org:0/path/testurl.html?key=value' >+Set port to non-number >+PASS domurl.href is 'https://www.mydomain.com:4/path/testurl.html?key=value' >+Set port to null >+PASS domurl.href is 'https://www.mydomain.com:0/path/testurl.html?key=value' >+Set port to empty string >+PASS domurl.href is 'https://www.mydomain.com:0/path/testurl.html?key=value' >+Set port to undefined >+PASS domurl.href is 'https://www.mydomain.com:0/path/testurl.html?key=value' >+Set port to URL with foo: protocol >+PASS domurl.href is 'foo://bar:50/' >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/set-domurl-attribute-port.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/set-domurl-attribute-port.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/set-domurl-attribute-port.html (revision 0) >@@ -0,0 +1,10 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script src="script-tests/set-domurl-attribute-port.js"></script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/set-domurl-attribute-protocol-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/set-domurl-attribute-protocol-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/set-domurl-attribute-protocol-expected.txt (revision 0) >@@ -0,0 +1,29 @@ >+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.href is 'http-foo://www.mydomain.com/path/' >+Set domurl protocol that contains ':' >+PASS domurl.href is 'http://www.mydomain.com/path/' >+Set domurl protocol that contains invalid characters >+PASS domurl.href is 'https://www.mydomain.com/path/' >+Set domurl protocol to a URL with invalid host name >+PASS domurl.href is 'foo:^^' >+Set domurl protocol that starts with ':' >+PASS domurl.href is 'https://www.mydomain.com/path/' >+Set protocol to null >+PASS domurl.href is 'https://www.mydomain.com/path/' >+Set protocol to empty string >+PASS domurl.href is 'https://www.mydomain.com/path/' >+Set protocol to http on malformed URL >+PASS domurl.href is 'http:/??bar' >+Set protocol to domurl URL which points to a local file >+PASS domurl.href is 'f-oo:path' >+Set protocol to undefined >+PASS domurl.href is 'undefined://www.mydomain.com/path/' >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/set-domurl-attribute-protocol.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/set-domurl-attribute-protocol.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/set-domurl-attribute-protocol.html (revision 0) >@@ -0,0 +1,10 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script src="script-tests/set-domurl-attribute-protocol.js"></script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/set-domurl-attribute-search-expected.txt >=================================================================== >--- LayoutTests/fast/dom/DOMURL/set-domurl-attribute-search-expected.txt (revision 0) >+++ LayoutTests/fast/dom/DOMURL/set-domurl-attribute-search-expected.txt (revision 0) >@@ -0,0 +1,23 @@ >+Test setting the search attribute of the DOMURL. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Set search without '?' >+PASS domurl.href is 'https://www.mydomain.com/path/?value=key' >+Set search that starts with '?' and contains spaces >+PASS domurl.href is 'https://www.mydomain.com/path/?val%20ue=%20key?' >+Set search to domurl malformed URL >+PASS domurl.href is 's:www.mydomain.com/path/?%' >+Set search containing '#' >+PASS domurl.href is 'https://www.mydomain.com/path/?value%23key#hash' >+Set search to domurl malformed URL >+PASS domurl.href is 'bad:/|/url?value=key' >+Set search to null >+PASS domurl.href is 'https://www.mydomain.com/path/' >+Set search to empty string >+PASS domurl.href is 'https://www.mydomain.com/path/?' >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/fast/dom/DOMURL/set-domurl-attribute-search.html >=================================================================== >--- LayoutTests/fast/dom/DOMURL/set-domurl-attribute-search.html (revision 0) >+++ LayoutTests/fast/dom/DOMURL/set-domurl-attribute-search.html (revision 0) >@@ -0,0 +1,10 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script src="script-tests/set-domurl-attribute-search.js"></script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/fast/dom/DOMURL/script-tests/get-domurl-attribute-port.js >=================================================================== >--- LayoutTests/fast/dom/DOMURL/script-tests/get-domurl-attribute-port.js (revision 0) >+++ LayoutTests/fast/dom/DOMURL/script-tests/get-domurl-attribute-port.js (revision 0) >@@ -0,0 +1,14 @@ >+description('Test getting the port attribute of the DOMURL.'); >+ >+var domurl = document.createElement("DOMURL"); >+ >+debug("Default port is empty"); >+shouldBe("domurl.port", ""); >+ >+debug("Unspecified port should return empty string"); >+domurl.href = "http://webkit.org/"; >+shouldBe("domurl.port", ""); >+ >+debug("Empty port should be empty"); >+domurl.href = "http://webkit.org:/"; >+shouldBe("domurl.port", ""); >Index: LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-hash.js >=================================================================== >--- LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-hash.js (revision 0) >+++ LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-hash.js (revision 0) >@@ -0,0 +1,47 @@ >+description('Test setting the hash attribute of the DOMURL.'); >+ >+var domurl = window.webkitURL; >+ >+debug("Hash value does not start with '#'"); >+domurl.href = "https://www.mydomain.com:8080/path/testurl.html#middle"; >+domurl.hash = "hash-value"; >+shouldBe("domurl.href", "'https://www.mydomain.com:8080/path/testurl.html#hash-value'"); >+ >+debug("Hash value starts with '#'"); >+domurl.href = "file:///path/testurl.html#middle"; >+domurl.hash = "#hash_value"; >+shouldBe("domurl.href", "'file:///path/testurl.html#hash_value'"); >+ >+debug("'?' in hash value"); >+domurl.href = "http://www.mydomain.com/path/testurl.html#middle"; >+domurl.hash = "#hash?value"; >+shouldBe("domurl.href", "'http://www.mydomain.com/path/testurl.html#hash?value'"); >+ >+debug("'#' in hash value, and illegal characters in hostname"); >+domurl.href = "https://www.my\"d(){}|~om?ain#com/path/testurl.html#middle"; >+domurl.hash = "#hash#value"; >+shouldBe("domurl.href", "'https://www.my\"d(){}|~om?ain#com/path/testurl.html#middle'"); >+ >+debug("Set hash to null"); >+domurl.href = "https://www.mydomain.com/path/testurl.html#middle"; >+domurl.hash = null; >+shouldBe("domurl.href", "'https://www.mydomain.com/path/testurl.html#'"); >+ >+debug("Set hash to empty string"); >+domurl.href = "https://www.mydomain.com/path/testurl.html#middle"; >+domurl.hash = ""; >+shouldBe("domurl.href", "'https://www.mydomain.com/path/testurl.html#'"); >+ >+debug("Add hash to mailto: protocol"); >+domurl.href = "mailto:e-mail_address@goes_here"; >+domurl.hash = "hash-value"; >+shouldBe("domurl.href", "'mailto:e-mail_address@goes_here#hash-value'"); >+ >+debug("Add hash to non-standard protocol"); >+try { >+domurl.href = "foo:bar"; >+domurl.hash = "#hash"; >+shouldBe("domurl.href", "'foo:bar#hash'"); >+} catch(e) { >+debug("Exception: " + e.description); >+} >Index: LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-host.js >=================================================================== >--- LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-host.js (revision 0) >+++ LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-host.js (revision 0) >@@ -0,0 +1,94 @@ >+description('Test setting the host attribute of the DOMURL.'); >+ >+var domurl = window.webkitURL; >+ >+debug("Basic test"); >+domurl.href = "https://www.mydomain.com:8080/path/"; >+domurl.host = "www.otherdomain.com:0"; >+shouldBe("domurl.href", "'https://www.otherdomain.com:0/path/'"); >+ >+debug("Set host with '?' in it"); >+try { >+domurl.href = "https://www.mydomain.com:8080/path/?key=value"; >+domurl.host = "www.other?domain.com:8080"; >+shouldBe("domurl.href", "'https://www.other/?domain.com:8080/path/?key=value'"); >+} catch(e) { >+debug("Exception: " + e.description); >+} >+ >+debug("Set default port for another protocol"); >+domurl.href = "https://www.mydomain.com:8080/path/"; >+domurl.host = "www.otherdomain.com:80"; >+shouldBe("domurl.href", "'https://www.otherdomain.com:80/path/'"); >+ >+debug("Set default port"); >+domurl.href = "https://www.mydomain.com:8080/path/"; >+domurl.host = "www.otherdomain.com:443"; >+shouldBe("domurl.href", "'https://www.otherdomain.com/path/'"); >+ >+debug("Set host with letters in port number"); >+domurl.href = "https://www.mydomain.com:8080/path/"; >+domurl.host = "www.otherdomain.com:44a5"; >+shouldBe("domurl.href", "'https://www.otherdomain.com:44/path/'"); >+ >+debug("Leading space in port number"); >+domurl.href = "https://www.mydomain.com:8080/path/"; >+domurl.host = "www.otherdomain.com: 443"; >+shouldBe("domurl.href", "'https://www.otherdomain.com:0/path/'"); >+ >+debug("Colon without port number"); >+domurl.href = "https://www.mydomain.com:8080/path/"; >+domurl.host = "www.otherdomain.com:"; >+shouldBe("domurl.href", "'https://www.otherdomain.com:0/path/'"); >+ >+debug("Set host to null"); >+domurl.href = "https://www.mydomain.com:8080/path/"; >+domurl.host = null; >+shouldBe("domurl.href", "'https://www.mydomain.com:8080/path/'"); >+ >+debug("Set host to empty string"); >+domurl.href = "https://www.mydomain.com:8080/path/"; >+domurl.host = ""; >+shouldBe("domurl.href", "'https://www.mydomain.com:8080/path/'"); >+ >+debug("Set host to URL with file: protocol"); >+domurl.href = "file:///path/"; >+domurl.host = "mydomain.com"; >+shouldBe("domurl.href", "'file://mydomain.com/path/'"); >+ >+debug("Set host containing slashes in it"); >+try { >+domurl.href = "https://www.mydomain.com:8080/path/"; >+domurl.host = "www.other\dom/ain.com"; >+shouldBe("domurl.href", "'https://www.otherdom/ain.com/path/'"); >+} catch(e) { >+debug("Exception: " + e.description); >+} >+ >+debug("Set host to domurl malformed URL"); >+domurl.href = "https:/\rww.my@domain.com:8080/path/"; >+domurl.host = "www.other!domain.com:15"; >+shouldBe("domurl.href", "'https:/\\rww.my@domain.com:8080/path/'"); >+ >+debug("Set host that starts with ':'"); >+try { >+domurl.href = "https://domain.com:8080/path/"; >+domurl.host = ":www.otherdomain.com:15"; >+shouldBe("domurl.href", "'https://domain.com:8080/path/'"); >+} catch(e) { >+debug("Exception: " + e.description); >+} >+ >+debug("Set host to URL containing username and .."); >+try { >+domurl.href = "https://rwwmy@domain.com:8080/pa..th/"; >+domurl.host = "www.other!domain.com:25"; >+shouldBe("domurl.href", "'https://rwwmy@www.other!domain.com:25/pa..th/'"); >+} catch(e) { >+debug("Exception: " + e.description); >+} >+ >+debug("Set host to domurl URL with tel: protocol"); >+domurl.href = "tel:+1-816-555-1212"; >+domurl.host = "+1-800-555-1212"; >+shouldBe("domurl.href", "'tel:+1-816-555-1212'"); >Index: LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-hostname.js >=================================================================== >--- LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-hostname.js (revision 0) >+++ LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-hostname.js (revision 0) >@@ -0,0 +1,47 @@ >+description('Test setting the hostname attribute of the DOMURL.'); >+ >+var domurl = window.webkitURL; >+ >+debug("Basic test"); >+domurl.href = "https://www.mydomain.com:8080/path/"; >+domurl.hostname = "www.otherdomain.com"; >+shouldBe("domurl.href", "'https://www.otherdomain.com:8080/path/'"); >+ >+try { >+debug("Extra slashes before hostname"); >+domurl.href = "https://www.mydomain.com:8080/path/"; >+domurl.hostname = "//www.otherdomain.com"; >+shouldBe("domurl.href", "'https://www.otherdomain.com:8080/path/'"); >+} catch(e) { >+debug("Exception: " + e.description); >+} >+ >+debug("Set hostname to URL with foo: protocol"); >+domurl.href = "foo://www.mydomain.com/path/"; >+domurl.hostname = "www.otherdomain.com"; >+shouldBe("domurl.href", "'foo://www.otherdomain.com/path/'"); >+ >+debug("Set hostname to null"); >+domurl.href = "https://www.mydomain.com:8080/path/"; >+domurl.hostname = null; >+shouldBe("domurl.href", "'https://www.mydomain.com:8080/path/'"); >+ >+debug("Set hostname to empty string"); >+domurl.href = "https://www.mydomain.com:8080/path/"; >+domurl.hostname = ""; >+shouldBe("domurl.href", "'https://www.mydomain.com:8080/path/'"); >+ >+debug("Set hostname to URL with 2 colons"); >+domurl.href = "really:bad:url"; >+domurl.hostname = "mydomain.com"; >+shouldBe("domurl.href", "'really:bad:url'"); >+ >+debug("Set domurl hostname that contains space in it"); >+domurl.href = "http://www.my domain.com/path/"; >+domurl.hostname = "www.other domain.com"; >+shouldBe("domurl.href", "'http://www.my domain.com/path/'"); >+ >+debug("Set hostname to undefined"); >+domurl.href = "https://www.mydomain.com:8080/path/"; >+domurl.hostname = undefined; >+shouldBe("domurl.href", "'https://undefined:8080/path/'"); >Index: LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-pathname.js >=================================================================== >--- LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-pathname.js (revision 0) >+++ LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-pathname.js (revision 0) >@@ -0,0 +1,51 @@ >+description('Test setting the pathname attribute of the DOMURL.'); >+ >+var domurl = window.webkitURL; >+ >+debug("Set pathname that starts with slash"); >+domurl.href = "https://www.mydomain.com/path/testurl.html?key=value"; >+domurl.pathname = "/path name"; >+shouldBe("domurl.href", "'https://www.mydomain.com/path%20name?key=value'"); >+ >+try { >+debug("Set pathname that does not start with slash and contains '?'"); >+domurl.href = "https://www.mydomain.com/path/testurl.html?key=value"; >+domurl.pathname = "pa?th"; >+shouldBe("domurl.href", "'https://www.mydomain.com/pa%3Fth?key=value'"); >+} catch(e) { >+debug("Exception: " + e.description); >+} >+ >+try { >+debug("Set pathname that starts with double slash and contains '#'"); >+domurl.href = "https://www.mydomain.com/path?key=value"; >+domurl.pathname = "//path#name"; >+shouldBe("domurl.href", "'https://www.mydomain.com//path%23name?key=value'"); >+} catch(e) { >+debug("Exception: " + e.description); >+} >+ >+debug("Set domurl pathname containing .. in it"); >+domurl.href = "https://www.mydomain.com/path/testurl.html?key=value"; >+domurl.pathname = "/it/../path"; >+shouldBe("domurl.href", "'https://www.mydomain.com/path?key=value'"); >+ >+debug("Set pathname to null"); >+domurl.href = "https://www.mydomain.com/path/testurl.html?key=value"; >+domurl.pathname = null; >+shouldBe("domurl.href", "'https://www.mydomain.com/?key=value'"); >+ >+debug("Set pathname to empty string"); >+domurl.href = "https://www.mydomain.com/?key=value"; >+domurl.pathname = ""; >+shouldBe("domurl.href", "'https://www.mydomain.com/?key=value'"); >+ >+debug("Set pathname that includes illegal characters to URL that contains illegal characters."); >+domurl.href = "https://www.my|d[]()omain.com/path/testurl.html?key=value"; >+domurl.pathname = "p$a|th"; >+shouldBe("domurl.href", "'https://www.my|d[]()omain.com/path/testurl.html?key=value'"); >+ >+debug("Set pathname to domurl URL with non-hierarchical protocol"); >+domurl.href = "tel:+1800-555-1212"; >+domurl.pathname = "the-path"; >+shouldBe("domurl.href", "'tel:+1800-555-1212'"); >Index: LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-port.js >=================================================================== >--- LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-port.js (revision 0) >+++ LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-port.js (revision 0) >@@ -0,0 +1,43 @@ >+description('Test setting the port attribute of the DOMURL.'); >+ >+var domurl = window.webkitURL; >+ >+debug("Default port as number"); >+domurl.href = "https://www.webkit.org:8080/path/testurl.html?key=value"; >+domurl.port = 443; >+shouldBe("domurl.href", "'https://www.webkit.org/path/testurl.html?key=value'"); >+ >+debug("Set port to 0"); >+domurl.href = "https://www.webkit.org:8080/path/testurl.html?key=value"; >+domurl.port = 0; >+shouldBe("domurl.href", "'https://www.webkit.org:0/path/testurl.html?key=value'"); >+ >+debug("Set port to undefined"); >+domurl.href = "https://www.webkit.org:8080/path/testurl.html?key=value"; >+domurl.port = undefined; >+shouldBe("domurl.href", "'https://www.webkit.org:0/path/testurl.html?key=value'"); >+ >+debug("Set port to non-number"); >+domurl.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; >+domurl.port = "4a"; >+shouldBe("domurl.href", "'https://www.mydomain.com:4/path/testurl.html?key=value'"); >+ >+debug("Set port to null"); >+domurl.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; >+domurl.port = null; >+shouldBe("domurl.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'"); >+ >+debug("Set port to empty string"); >+domurl.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; >+domurl.port = ""; >+shouldBe("domurl.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'"); >+ >+debug("Set port to undefined"); >+domurl.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; >+domurl.port = undefined; >+shouldBe("domurl.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'"); >+ >+debug("Set port to URL with foo: protocol"); >+domurl.href = "foo://bar/"; >+domurl.port = 50; >+shouldBe("domurl.href", "'foo://bar:50/'"); >Index: LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-protocol.js >=================================================================== >--- LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-protocol.js (revision 0) >+++ LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-protocol.js (revision 0) >@@ -0,0 +1,69 @@ >+description('Test setting the protocol attribute of the DOMURL.'); >+ >+var domurl = window.webkitURL; >+ >+debug("Basic test"); >+domurl.href = "https://www.mydomain.com/path/"; >+domurl.protocol = "http-foo"; >+shouldBe("domurl.href", "'http-foo://www.mydomain.com/path/'"); >+ >+debug("Set domurl protocol that contains ':'"); >+try { >+domurl.href = "https://www.mydomain.com/path/"; >+domurl.protocol = "http:foo"; >+shouldBe("domurl.href", "'http://www.mydomain.com/path/'"); >+} catch(e) { >+debug("Exception: " + e.description); >+} >+ >+debug("Set domurl protocol that contains invalid characters"); >+try { >+domurl.href = "https://www.mydomain.com/path/"; >+domurl.protocol = "http^foo"; >+shouldBe("domurl.href", "'https://www.mydomain.com/path/'"); >+} catch(e) { >+debug("Exception: " + e.description); >+} >+ >+debug("Set domurl protocol to a URL with invalid host name"); >+domurl.href = "h:^^"; >+domurl.protocol = "foo"; >+shouldBe("domurl.href", "'foo:^^'"); >+ >+try { >+debug("Set domurl protocol that starts with ':'"); >+domurl.href = "https://www.mydomain.com/path/"; >+domurl.protocol = ":http"; >+shouldBe("domurl.href", "'https://www.mydomain.com/path/'"); >+} catch(e) { >+debug("Exception: " + e.description); >+} >+ >+debug("Set protocol to null"); >+domurl.href = "https://www.mydomain.com/path/"; >+domurl.protocol = null; >+shouldBe("domurl.href", "'https://www.mydomain.com/path/'"); >+ >+try { >+debug("Set protocol to empty string"); >+domurl.href = "https://www.mydomain.com/path/"; >+domurl.protocol = ""; >+shouldBe("domurl.href", "'https://www.mydomain.com/path/'"); >+} catch(e) { >+debug("Exception: " + e.description); >+} >+ >+debug("Set protocol to http on malformed URL"); >+domurl.href = "foo:??bar"; >+domurl.protocol = "http"; >+shouldBe("domurl.href", "'http:/??bar'"); >+ >+debug("Set protocol to domurl URL which points to a local file"); >+domurl.href = "c:\path"; >+domurl.protocol = "f-oo"; >+shouldBe("domurl.href", "'f-oo:path'"); >+ >+debug("Set protocol to undefined"); >+domurl.href = "https://www.mydomain.com/path/"; >+domurl.protocol = undefined; >+shouldBe("domurl.href", "'undefined://www.mydomain.com/path/'"); >Index: LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-search.js >=================================================================== >--- LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-search.js (revision 0) >+++ LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-search.js (revision 0) >@@ -0,0 +1,42 @@ >+description('Test setting the search attribute of the DOMURL.'); >+ >+var domurl = window.webkitURL; >+ >+debug("Set search without '?'"); >+domurl.href = "https://www.mydomain.com/path/?key=value"; >+domurl.search = "value=key"; >+shouldBe("domurl.href", "'https://www.mydomain.com/path/?value=key'"); >+ >+debug("Set search that starts with '?' and contains spaces"); >+domurl.href = "https://www.mydomain.com/path/?key=value"; >+domurl.search = "?val ue= key?"; >+shouldBe("domurl.href", "'https://www.mydomain.com/path/?val%20ue=%20key?'"); >+ >+debug("Set search to domurl malformed URL"); >+domurl.href = "s:www.mydomain.com/path/"; >+domurl.search = "%"; >+shouldBe("domurl.href", "'s:www.mydomain.com/path/?%'"); >+ >+debug("Set search containing '#'"); >+try { >+domurl.href = "https://www.mydomain.com/path/?key=value#hash"; >+domurl.search = "?value#key"; >+shouldBe("domurl.href", "'https://www.mydomain.com/path/?value%23key#hash'"); >+} catch(e) { >+debug("Exception: " + e.description); >+} >+ >+debug("Set search to domurl malformed URL"); >+domurl.href = "bad:/|/url"; >+domurl.search = "?value=key"; >+shouldBe("domurl.href", "'bad:/|/url?value=key'"); >+ >+debug("Set search to null"); >+domurl.href = "https://www.mydomain.com/path/?key=value"; >+domurl.search = null; >+shouldBe("domurl.href", "'https://www.mydomain.com/path/'"); >+ >+debug("Set search to empty string"); >+domurl.href = "https://www.mydomain.com/path/?key=value"; >+domurl.search = ""; >+shouldBe("domurl.href", "'https://www.mydomain.com/path/?'");
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