Changeset 58064 in webkit
- Timestamp:
- Apr 21, 2010 11:49:50 PM (14 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r58058 r58064 1 2010-04-21 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 URL LayoutTests don't run on Firefox 6 https://bugs.webkit.org/show_bug.cgi?id=37974 7 8 It turns out Firefox doesn't handle base URLs properly if we go through 9 the DOM to create the <base> and <a> elements. If we switch to 10 document.write, we can run the tests in Firefox (even though 11 document.write is lame). 12 13 * fast/url/resources/utilities.js: 14 (canonicalize): 15 (setBaseURL): 16 1 17 2010-04-21 Ben Murdoch <benm@google.com> 2 18 -
trunk/LayoutTests/fast/url/resources/utilities.js
r57635 r58064 1 1 function canonicalize(url) 2 2 { 3 var a = document.createElement("a"); 4 a.href = url; 5 return a.href; 3 // It would be more elegant to use the DOM here, but we use document.write() 4 // so the tests run correctly in Firefox. 5 var id = Math.random(); 6 document.write("<a id='" + id + "' href='" + url + "'></a>"); 7 return document.getElementById(id).href; 6 8 } 7 9 8 10 function setBaseURL(url) 9 11 { 10 var base = document.createElement("base"); 11 base.href = url; 12 document.documentElement.appendChild(base); 12 // According to the HTML5 spec, we're only supposed to honor <base> elements 13 // in the <head>, but we use document.write() here to make the test run in 14 // Firefox. 15 document.write('<base href="' + url + '">'); 13 16 }
Note: See TracChangeset
for help on using the changeset viewer.