Changeset 94213 in webkit
- Timestamp:
- Aug 31, 2011 12:01:08 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 32 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r94212 r94213 1 2011-08-31 Nate Chapin <japhet@chromium.org> 2 3 Test updates for https://bugs.webkit.org/show_bug.cgi?id=30303. 4 5 Reviewed by Darin Adler. 6 7 * fast/images/load-img-with-empty-src-expected.txt: 8 * fast/images/load-img-with-empty-src.html: Expect the same behavior whether or not an empty src 9 is in a local file document. 10 * fast/tokenizer/002-expected.txt: Added. 11 * fast/tokenizer/002.html: Make dumpAsText(). 12 * fast/tokenizer/external-script-document-write_2-expected.txt: Added. 13 * fast/tokenizer/external-script-document-write_2.html:: Make dumpAsText(). 14 * fast/tokenizer/script_extra_close-expected.txt: Added. 15 * fast/tokenizer/script_extra_close.html:: Make dumpAsText(). 16 * http/tests/loading/empty-urls-expected.txt: Added. 17 * http/tests/loading/empty-urls.html: Added. Test empty urls with a bunch of subresource types 18 and ensure their error event behavior matches the spec. 19 * platform/chromium-cg-mac/fast/tokenizer/002-expected.txt: Removed. 20 * platform/chromium-cg-mac/fast/tokenizer/external-script-document-write_2-expected.txt: Removed. 21 * platform/chromium-linux/fast/tokenizer/002-expected.png: Removed. 22 * platform/chromium-linux/fast/tokenizer/external-script-document-write_2-expected.png: Removed. 23 * platform/chromium-linux/fast/tokenizer/script_extra_close-expected.png: Removed. 24 * platform/chromium-win/fast/tokenizer/002-expected.png: Removed. 25 * platform/chromium-win/fast/tokenizer/002-expected.txt: Removed. 26 * platform/chromium-win/fast/tokenizer/external-script-document-write_2-expected.png: Removed. 27 * platform/chromium-win/fast/tokenizer/external-script-document-write_2-expected.txt: Removed. 28 * platform/chromium-win/fast/tokenizer/script_extra_close-expected.png: Removed. 29 * platform/chromium-win/fast/tokenizer/script_extra_close-expected.txt: Removed. 30 * platform/gtk/fast/tokenizer/002-expected.png: Removed. 31 * platform/gtk/fast/tokenizer/002-expected.txt: Removed. 32 * platform/gtk/fast/tokenizer/external-script-document-write_2-expected.png: Removed. 33 * platform/gtk/fast/tokenizer/external-script-document-write_2-expected.txt: Removed. 34 * platform/gtk/fast/tokenizer/script_extra_close-expected.png: Removed. 35 * platform/gtk/fast/tokenizer/script_extra_close-expected.txt: Removed. 36 * platform/mac-leopard/fast/tokenizer/002-expected.png: Removed. 37 * platform/mac-leopard/fast/tokenizer/external-script-document-write_2-expected.png: Removed. 38 * platform/mac-leopard/fast/tokenizer/script_extra_close-expected.png: Removed. 39 * platform/mac/fast/tokenizer/002-expected.png: Removed. 40 * platform/mac/fast/tokenizer/002-expected.txt: Removed. 41 * platform/mac/fast/tokenizer/external-script-document-write_2-expected.png: Removed. 42 * platform/mac/fast/tokenizer/external-script-document-write_2-expected.txt: Removed. 43 * platform/mac/fast/tokenizer/script_extra_close-expected.png: Removed. 44 * platform/mac/fast/tokenizer/script_extra_close-expected.txt: Removed. 45 * platform/qt/fast/tokenizer/002-expected.png: Removed. 46 * platform/qt/fast/tokenizer/002-expected.txt: Removed. 47 * platform/qt/fast/tokenizer/external-script-document-write_2-expected.png: Removed. 48 * platform/qt/fast/tokenizer/external-script-document-write_2-expected.txt: Removed. 49 * platform/qt/fast/tokenizer/script_extra_close-expected.png: Removed. 50 * platform/qt/fast/tokenizer/script_extra_close-expected.txt: Removed. 51 1 52 2011-08-31 Simon Fraser <simon.fraser@apple.com> 2 53 -
trunk/LayoutTests/fast/images/load-img-with-empty-src-expected.txt
r34853 r94213 7 7 [2] define a <img> with src='' to see whether it gets loaded. (It should NOT be loaded, because the base URI is a local file.) 8 8 PASS 9 [3] change the base URI to an http: URL and define a <img> with src='' to see whether it gets loaded. (It should be loaded.)9 [3] change the base URI to an http: URL and define a <img> with src='' to see whether it gets loaded. (It should NOT be loaded.) 10 10 PASS -
trunk/LayoutTests/fast/images/load-img-with-empty-src.html
r34853 r94213 15 15 } 16 16 17 var results = [true, true, true, false];17 var results = [true, true, false, false]; 18 18 var description = ["remove src attribute of an <img> to see whether it gets loaded. (It should NOT be loaded.)", 19 19 "define an <img> with no src specified to see whether it gets loaded. (It should NOT be loaded.)", 20 20 "define a <img> with src='' to see whether it gets loaded. (It should NOT be loaded, because the base URI is a local file.)", 21 "change the base URI to an http: URL and define a <img> with src='' to see whether it gets loaded. (It should be loaded.)" ]21 "change the base URI to an http: URL and define a <img> with src='' to see whether it gets loaded. (It should NOT be loaded.)" ] 22 22 23 23 function outputResults() { … … 38 38 <img id="image1" style="display:none" src="resources/test-load.jpg" onerror="results[0] = false;" /> 39 39 <img id="image2" style="display:none" onerror="results[1] = false;" /> 40 <img id="image3" style="display:none" src="" onerror="results[2] = false;" />40 <img id="image3" style="display:none" src="" onerror="results[2] = true;" /> 41 41 <script type="text/javascript"> 42 42 var imgNode1 = document.getElementById("image1"); -
trunk/LayoutTests/fast/tokenizer/002.html
r11995 r94213 1 1 <script> 2 if (window.layoutTestController) 3 layoutTestController.dumpAsText(); 2 4 document.write("<script src>"); 3 5 document.writeln("</scr" + "ipt>"); -
trunk/LayoutTests/fast/tokenizer/external-script-document-write_2.html
r11995 r94213 1 1 <html> 2 <script> 3 if (window.layoutTestController) 4 layoutTestController.dumpAsText(); 5 </script> 2 6 <body> 3 7 <script> -
trunk/LayoutTests/fast/tokenizer/script_extra_close.html
r11995 r94213 1 1 <html> 2 <script> 3 if (window.layoutTestController) 4 layoutTestController.dumpAsText(); 5 </script> 2 6 <body> 3 7 TEST... -
trunk/Source/WebCore/ChangeLog
r94211 r94213 1 2011-08-31 Nate Chapin <japhet@chromium.org> 2 3 Don't load resources with empty urls, since this 4 will resolve to the current document. 5 https://bugs.webkit.org/show_bug.cgi?id=30303 6 7 Reviewed by Darin Adler. 8 9 Test: http/tests/loading/empty-urls.html 10 11 * dom/ScriptElement.cpp: 12 (WebCore::ScriptElement::requestScript): If src="", fail through 13 to the error event case. 14 * html/HTMLLinkElement.cpp: 15 (WebCore::HTMLLinkElement::parseMappedAttribute): Ensure the url 16 stays empty if we try to resolve an empty href. 17 * loader/ImageLoader.cpp: 18 (WebCore::ImageLoader::updateFromElement): Throw an error instead of 19 loading if the src is empty in all cases, not just local files. 20 1 21 2011-08-28 Robert Hogan <robert@webkit.org> 2 22 -
trunk/Source/WebCore/dom/ScriptElement.cpp
r93871 r94213 33 33 #include "FrameLoader.h" 34 34 #include "HTMLNames.h" 35 #include "HTMLParserIdioms.h" 35 36 #include "HTMLScriptElement.h" 36 37 #include "IgnoreDestructiveWriteCountIncrementer.h" … … 255 256 256 257 ASSERT(!m_cachedScript); 257 // FIXME: If sourceUrl is empty, we should dispatchErrorEvent(). 258 ResourceRequest request(m_element->document()->completeURL(sourceUrl)); 259 m_cachedScript = m_element->document()->cachedResourceLoader()->requestScript(request, scriptCharset()); 260 m_isExternalScript = true; 258 if (!stripLeadingAndTrailingHTMLSpaces(sourceUrl).isEmpty()) { 259 ResourceRequest request(m_element->document()->completeURL(sourceUrl)); 260 m_cachedScript = m_element->document()->cachedResourceLoader()->requestScript(request, scriptCharset()); 261 m_isExternalScript = true; 262 } 261 263 262 264 if (m_cachedScript) { -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r93439 r94213 134 134 process(); 135 135 } else if (attr->name() == hrefAttr) { 136 m_url = document()->completeURL(stripLeadingAndTrailingHTMLSpaces(attr->value())); 136 String url = stripLeadingAndTrailingHTMLSpaces(attr->value()); 137 m_url = url.isEmpty() ? KURL() : document()->completeURL(url); 137 138 process(); 138 139 } else if (attr->name() == typeAttr) { -
trunk/Source/WebCore/loader/ImageLoader.cpp
r93886 r94213 28 28 #include "Document.h" 29 29 #include "Element.h" 30 #include "Event.h" 30 31 #include "HTMLNames.h" 31 32 #include "HTMLObjectElement.h" 33 #include "HTMLParserIdioms.h" 32 34 #include "RenderImage.h" 33 35 … … 160 162 161 163 // Do not load any image if the 'src' attribute is missing or if it is 162 // an empty string referring to a local file. The latter condition is 163 // a quirk that preserves old behavior that Dashboard widgets 164 // need (<rdar://problem/5994621>). 164 // an empty string. 165 165 CachedImage* newImage = 0; 166 if (! (attr.isNull() || (attr.isEmpty() && document->baseURI().isLocalFile()))) {166 if (!attr.isNull() && !stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) { 167 167 ResourceRequest request = ResourceRequest(document->completeURL(sourceURI(attr))); 168 168 … … 187 187 // violation occurred. 188 188 m_failedLoadURL = !newImage ? attr : AtomicString(); 189 } 189 } else if (!attr.isNull()) // Fire an error event if the url is empty. 190 m_element->dispatchEvent(Event::create(eventNames().errorEvent, false, false)); 190 191 191 192 CachedImage* oldImage = m_image.get();
Note: See TracChangeset
for help on using the changeset viewer.