Changeset 266748 in webkit
- Timestamp:
- Sep 8, 2020 2:08:46 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r266746 r266748 1 2020-09-08 Alex Christensen <achristensen@webkit.org> 2 3 new URL("#") should throw an error 4 https://bugs.webkit.org/show_bug.cgi?id=216115 5 6 Reviewed by Yusuke Suzuki and Darin Adler. 7 8 * fast/dom/DOMURL/url-constructor-expected.txt: 9 * fast/dom/DOMURL/url-constructor.html: 10 * inspector/unit-tests/url-utilities.html: 11 * inspector/unit-tests/url-utilities-expected.txt: 12 1 13 2020-09-08 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/LayoutTests/fast/dom/DOMURL/url-constructor-expected.txt
r163208 r266748 8 8 One-parameter constructor - invalid URL should throw 9 9 PASS url = new URL("%^$#") threw exception TypeError: Type error. 10 PASS url = new URL("#") threw exception TypeError: Type error. 10 11 One-parameter constructor - relative URL not valid against default base 11 12 PASS url = new URL("foobar") threw exception TypeError: Type error. -
trunk/LayoutTests/fast/dom/DOMURL/url-constructor.html
r163208 r266748 16 16 debug("One-parameter constructor - invalid URL should throw"); 17 17 shouldThrow('url = new URL("%^$#")'); 18 shouldThrow('url = new URL("#")'); 18 19 19 20 debug("One-parameter constructor - relative URL not valid against default base"); -
trunk/LayoutTests/inspector/unit-tests/url-utilities-expected.txt
r249504 r266748 500 500 PASS: Removing fragment of 'http://example.com/path?#' should be 'http://example.com/path?'. 501 501 PASS: Removing fragment of 'http://example.com/path/?#' should be 'http://example.com/path/?'. 502 PASS: Removing fragment of ' #hash' should be 'about:blank'.502 PASS: Removing fragment of 'about:blank#hash' should be 'about:blank'. 503 503 PASS: Removing fragment of 'invalid' should be 'invalid'. 504 504 -
trunk/LayoutTests/inspector/unit-tests/url-utilities.html
r249504 r266748 574 574 test("http://example.com/path/?#", "http://example.com/path/?"); 575 575 576 test( "#hash", "about:blank");576 test(new URL("#hash", "about:blank"), "about:blank"); 577 577 test("invalid", "invalid"); 578 578 -
trunk/Source/WebCore/ChangeLog
r266746 r266748 1 2020-09-08 Alex Christensen <achristensen@webkit.org> 2 3 new URL("#") should throw an error 4 https://bugs.webkit.org/show_bug.cgi?id=216115 5 6 Reviewed by Yusuke Suzuki and Darin Adler. 7 8 This aligns the DOM URL object with the specification and Firefox. 9 Covered by adding to fast/dom/DOMURL/url-constructor.html. 10 11 * html/DOMURL.cpp: 12 (WebCore::DOMURL::create): 13 * html/DOMURL.h: 14 1 15 2020-09-08 Chris Dumez <cdumez@apple.com> 2 16 -
trunk/Source/WebCore/html/DOMURL.cpp
r266010 r266748 48 48 ExceptionOr<Ref<DOMURL>> DOMURL::create(const String& url, const URL& base) 49 49 { 50 if (!base.isValid()) 51 return Exception { TypeError }; 50 ASSERT(base.isValid() || base.isNull()); 52 51 URL completeURL { base, url }; 53 52 if (!completeURL.isValid()) … … 58 57 ExceptionOr<Ref<DOMURL>> DOMURL::create(const String& url, const String& base) 59 58 { 60 return create(url, base.isNull() ? aboutBlankURL() : URL { URL { }, base }); 59 URL baseURL { URL { }, base }; 60 if (!base.isNull() && !baseURL.isValid()) 61 return Exception { TypeError }; 62 return create(url, baseURL); 61 63 } 62 64 -
trunk/Source/WebCore/html/DOMURL.h
r266010 r266748 42 42 static ExceptionOr<Ref<DOMURL>> create(const String& url, const String& base); 43 43 static ExceptionOr<Ref<DOMURL>> create(const String& url, const DOMURL& base); 44 static ExceptionOr<Ref<DOMURL>> create(const String& url, const URL& base);45 44 ~DOMURL(); 46 45 … … 59 58 60 59 private: 60 static ExceptionOr<Ref<DOMURL>> create(const String& url, const URL& base); 61 61 DOMURL(URL&& completeURL, const URL& baseURL); 62 62
Note: See TracChangeset
for help on using the changeset viewer.