Changeset 89503 in webkit
- Timestamp:
- Jun 22, 2011 5:28:56 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r89426 r89503 1 2011-06-22 Nate Chapin <japhet@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 Add symbols required for window.internals. 6 https://bugs.webkit.org/show_bug.cgi?id=62066 7 8 * Source/autotools/symbols.filter: 9 1 10 2011-06-22 Martin Robinson <mrobinson@igalia.com> 2 11 -
trunk/LayoutTests/ChangeLog
r89500 r89503 1 2011-06-22 Nate Chapin <japhet@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 Test updates for https://bugs.webkit.org/show_bug.cgi?id=62066. 6 7 * fast/preloader/scan-body-from-head-import.html: Use window.internals. 8 * fast/preloader/scan-body-from-head-script.html: Use window.internals. 9 * http/tests/loading/cross-origin-XHR-willLoadRequest-expected.txt: 10 * http/tests/loading/cross-origin-XHR-willLoadRequest.html: 11 * http/tests/loading/preload-append-scan-expected.txt: 12 * http/tests/loading/preload-append-scan.php: Use window.internals. 13 * http/tests/misc/favicon-loads-with-icon-loading-override-expected.txt: 14 * http/tests/misc/link-rel-icon-beforeload-expected.txt: 15 * platform/chromium-linux/fast/preloader/scan-body-from-head-script-expected.txt: Removed. 16 1 17 2011-06-22 Jessie Berlin <jberlin@apple.com> 2 18 -
trunk/LayoutTests/fast/preloader/scan-body-from-head-import-expected.txt
r82658 r89503 1 style1.css has MIME type text/css2 image1.png has MIME type image/png3 1 4 2 This tests that resources in the body which block parsing (script, css) are preloaded … … 11 9 </body> 12 10 </html> 13 11 PASS -
trunk/LayoutTests/fast/preloader/scan-body-from-head-import.html
r82658 r89503 2 2 <head> 3 3 <script> 4 if (window.layoutTestController) {4 if (window.layoutTestController) 5 5 layoutTestController.dumpAsText(); 6 layoutTestController.dumpResourceResponseMIMETypes(); 6 7 function checkForPreload() { 8 var result; 9 if (internals.isPreloaded(document, "resources/image1.png") && internals.isPreloaded(document, "resources/style1.css")) 10 result = "PASS"; 11 else 12 result = "FAIL"; 13 document.getElementsByTagName("body")[0].appendChild(document.createTextNode(result)); 7 14 } 15 16 window.addEventListener("DOMContentLoaded", checkForPreload, false); 8 17 </script> 9 18 <script src=resources/non-existant.js></script> -
trunk/LayoutTests/fast/preloader/scan-body-from-head-script-expected.txt
r82658 r89503 1 script1.js has MIME type application/x-javascript2 image1.png has MIME type image/png3 1 4 2 This tests that resources in the body which block parsing (script, css) are preloaded … … 9 7 </body> 10 8 </html> 11 9 PASS -
trunk/LayoutTests/fast/preloader/scan-body-from-head-script.html
r82658 r89503 2 2 <head> 3 3 <script> 4 if (window.layoutTestController) {4 if (window.layoutTestController) 5 5 layoutTestController.dumpAsText(); 6 layoutTestController.dumpResourceResponseMIMETypes(); 6 7 function checkForPreload() { 8 var result; 9 if (internals.isPreloaded(document, "resources/image1.png") && internals.isPreloaded(document, "resources/script1.js")) 10 result = "PASS"; 11 else 12 result = "FAIL"; 13 document.getElementsByTagName("body")[0].appendChild(document.createTextNode(result)); 7 14 } 15 16 window.addEventListener("DOMContentLoaded", checkForPreload, false); 8 17 </script> 9 18 <script src=resources/non-existant.js></script> -
trunk/LayoutTests/http/tests/loading/cross-origin-XHR-willLoadRequest-expected.txt
r75768 r89503 3 3 main frame - didFinishDocumentLoadForFrame 4 4 main frame - didHandleOnloadEventsForFrame 5 main frame - didFinishLoadForFrame 5 6 CONSOLE MESSAGE: line 1: XMLHttpRequest cannot load http://localhost:8000/loading/resources/foo.txt. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin. 6 main frame - didFinishLoadForFrame7 7 The console message above should report failure to load foo.txt due to cross-origin access, not a network error. -
trunk/LayoutTests/http/tests/loading/cross-origin-XHR-willLoadRequest.html
r84770 r89503 1 1 <script> 2 2 layoutTestController.dumpAsText(); 3 layoutTestController.waitUntilDone(); 3 4 layoutTestController.addURLToRedirect("http://localhost:8000/loading/resources/bar.txt", "http://localhost:8000/loading/resources/foo.txt"); 4 5 5 6 var request = new XMLHttpRequest(); 7 request.onreadystatechange = function() { 8 if (request.readyState == 4) 9 layoutTestController.notifyDone(); 10 } 6 11 request.open("GET", "http://localhost:8000/loading/resources/bar.txt"); 7 12 request.send(); -
trunk/LayoutTests/http/tests/loading/preload-append-scan-expected.txt
r83321 r89503 1 1 main frame - didStartProvisionalLoadForFrame 2 2 main frame - didCommitLoadForFrame 3 slow-script.pl has MIME type application/javascript4 3 main frame - didFinishDocumentLoadForFrame 5 4 main frame - didHandleOnloadEventsForFrame 6 preload-test.jpg has MIME type image/jpeg7 5 main frame - didFinishLoadForFrame 8 6 9 7 This test needs to be run in DRT. Preload scanner should see the image resource. 10 8 <img src="resources/preload-test.jpg"> 11 9 PASS -
trunk/LayoutTests/http/tests/loading/preload-append-scan.php
r83321 r89503 6 6 print str_repeat("A", 2048); 7 7 ?> --> 8 <body> 8 9 <script> 9 if (window.layoutTestController) {10 if (window.layoutTestController) 10 11 layoutTestController.dumpAsText(); 11 layoutTestController.dumpResourceResponseMIMETypes(); 12 13 function checkForPreload() { 14 var result; 15 if (internals.isPreloaded(document, "resources/preload-test.jpg")) 16 result = "PASS"; 17 else 18 result = "FAIL"; 19 document.getElementsByTagName("body")[0].appendChild(document.createTextNode(result)); 12 20 } 21 22 window.addEventListener("DOMContentLoaded", checkForPreload, false); 23 13 24 function debug(x) {} 14 25 </script> -
trunk/LayoutTests/http/tests/misc/favicon-loads-with-icon-loading-override-expected.txt
r83628 r89503 3 3 http://127.0.0.1:8000/misc/favicon-loads-with-icon-loading-override.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/misc/favicon-loads-with-icon-loading-override.html, http status code 200> 4 4 http://127.0.0.1:8000/misc/resources/favicon.ico - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/misc/resources/favicon.ico, main document URL http://127.0.0.1:8000/misc/favicon-loads-with-icon-loading-override.html, http method GET> redirectResponse (null) 5 http://127.0.0.1:8000/misc/favicon-loads-with-icon-loading-override.html - didFinishLoading6 http://127.0.0.1:8000/misc/resources/favicon.ico - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/misc/resources/favicon.ico, http status code 200>7 5 https://bugs.webkit.org/show_bug.cgi?id=58292 - Provide new setting to allow site icon loading despite disabling automatic image loading in general. 8 6 Resource load callbacks will reveal if the favicon still gets loaded if automatic image loading is disabled, but site icon image loading override is enabled. -
trunk/LayoutTests/http/tests/misc/link-rel-icon-beforeload-expected.txt
r82342 r89503 3 3 http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html, http status code 200> 4 4 http://127.0.0.1:8000/favicon.ico - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/favicon.ico, main document URL http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html, http method GET> redirectResponse (null) 5 http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html - didFinishLoading6 http://127.0.0.1:8000/favicon.ico - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/favicon.ico, http status code 200>7 5 This test should not show a request for the favicon dont-load-this.ico, since the beforeload handler on the favicon link returns false. Therefore, if the resource request list below shows a request for dont-load-this.ico, then this test has failed. -
trunk/Source/WebCore/ChangeLog
r89499 r89503 1 2011-06-22 Nate Chapin <japhet@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 Don't let all subresources keep isLoadingInAPISense() from 6 returning false, only requests that affect 7 CachedResourceRequest::requestCount(). 8 9 Also, add a callback to Internals to determine whether 10 a resource has been preloaded. 11 12 https://bugs.webkit.org/show_bug.cgi?id=62066 13 14 * WebCore.exp.in: 15 * dom/Document.cpp: Add m_loadEventFinished. 16 * dom/Document.h: 17 * loader/DocumentLoader.cpp: 18 (WebCore::DocumentLoader::isLoadingInAPISense): 19 * loader/cache/CachedResourceLoader.cpp: 20 (WebCore::CachedResourceLoader::isPreloaded): 21 * loader/cache/CachedResourceLoader.h: 22 * testing/Internals.cpp: 23 (WebCore::Internals::isPreloaded): 24 * testing/Internals.h: 25 * testing/Internals.idl: 26 1 27 2011-06-22 Chris Rogers <crogers@google.com> 2 28 -
trunk/Source/WebCore/WebCore.exp.in
r89440 r89503 1180 1180 __ZNK7WebCore19ResourceRequestBase6isNullEv 1181 1181 __ZNK7WebCore19ResourceRequestBase7isEmptyEv 1182 __ZNK7WebCore20CachedResourceLoader11isPreloadedERKN3WTF6StringE 1182 1183 __ZNK7WebCore20HTMLTableCellElement9cellAboveEv 1183 1184 __ZNK7WebCore20ResourceResponseBase14httpStatusCodeEv -
trunk/Source/WebCore/dom/Document.cpp
r89283 r89503 388 388 , m_titleSetExplicitly(false) 389 389 , m_updateFocusAppearanceTimer(this, &Document::updateFocusAppearanceTimerFired) 390 , m_loadEventFinished(false) 390 391 , m_startTime(currentTime()) 391 392 , m_overMinimumLayoutThreshold(false) … … 3401 3402 return; 3402 3403 domWindow->dispatchLoadEvent(); 3404 m_loadEventFinished = true; 3403 3405 } 3404 3406 -
trunk/Source/WebCore/dom/Document.h
r89212 r89503 998 998 999 999 bool processingLoadEvent() const { return m_processingLoadEvent; } 1000 bool loadEventFinished() const { return m_loadEventFinished; } 1000 1001 1001 1002 #if ENABLE(DATABASE) … … 1279 1280 1280 1281 Element* m_cssTarget; 1281 1282 1283 // FIXME: Merge these 2 variables into an enum. Also, FrameLoader::m_didCallImplicitClose 1284 // is almost a duplication of this data, so that should probably get merged in too. 1282 1285 bool m_processingLoadEvent; 1286 bool m_loadEventFinished; 1287 1283 1288 RefPtr<SerializedScriptValue> m_pendingStateObject; 1284 1289 double m_startTime; -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r89312 r89503 442 442 // but we still need to consider subframes. 443 443 if (frameLoader()->state() != FrameStateComplete) { 444 if (!m_primaryLoadComplete && isLoading()) 444 Document* doc = m_frame->document(); 445 if ((!m_primaryLoadComplete || !m_frame->document()->loadEventFinished()) && isLoading()) 445 446 return true; 446 if (!m_subresourceLoaders.isEmpty())447 return true;448 Document* doc = m_frame->document();449 447 if (doc->cachedResourceLoader()->requestCount()) 450 448 return true; -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r89155 r89503 651 651 printf("PRELOADING %s\n", resource->url().latin1().data()); 652 652 #endif 653 } 654 655 bool CachedResourceLoader::isPreloaded(const String& urlString) const 656 { 657 const KURL& url = m_document->completeURL(urlString); 658 659 if (m_preloads) { 660 ListHashSet<CachedResource*>::iterator end = m_preloads->end(); 661 for (ListHashSet<CachedResource*>::iterator it = m_preloads->begin(); it != end; ++it) { 662 CachedResource* resource = *it; 663 if (resource->url() == url) 664 return true; 665 } 666 } 667 668 Deque<PendingPreload>::const_iterator dequeEnd = m_pendingPreloads.end(); 669 for (Deque<PendingPreload>::const_iterator it = m_pendingPreloads.begin(); it != dequeEnd; ++it) { 670 PendingPreload pendingPreload = *it; 671 if (pendingPreload.m_request.url() == url) 672 return true; 673 } 674 return false; 653 675 } 654 676 -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.h
r89155 r89503 97 97 void decrementRequestCount(const CachedResource*); 98 98 int requestCount(); 99 99 100 bool isPreloaded(const String& urlString) const; 100 101 void clearPreloads(); 101 102 void clearPendingPreloads(); -
trunk/Source/WebCore/testing/Internals.cpp
r89230 r89503 27 27 #include "Internals.h" 28 28 29 #include "CachedResourceLoader.h" 30 #include "Document.h" 29 31 #include "RenderTreeAsText.h" 30 32 #include "ShadowContentElement.h" … … 43 45 Internals::Internals() 44 46 { 47 } 48 49 bool Internals::isPreloaded(Document* document, const String& url) 50 { 51 if (!document) 52 return false; 53 54 return document->cachedResourceLoader()->isPreloaded(url); 45 55 } 46 56 -
trunk/Source/WebCore/testing/Internals.h
r89230 r89503 28 28 29 29 #include "ExceptionCode.h" 30 #include "PlatformString.h" 30 31 #include <wtf/PassRefPtr.h> 31 32 #include <wtf/RefCounted.h> … … 41 42 static PassRefPtr<Internals> create(); 42 43 virtual ~Internals(); 44 45 bool isPreloaded(Document*, const String& url); 43 46 44 47 PassRefPtr<Element> createShadowContentElement(Document*, ExceptionCode&); -
trunk/Source/WebCore/testing/Internals.idl
r89269 r89503 30 30 Element createShadowContentElement(in Document document) raises(DOMException); 31 31 DOMString elementRenderTreeAsText(in Element element) raises(DOMException); 32 boolean isPreloaded(in Document document, in DOMString url); 32 33 }; 33 34 } -
trunk/Source/WebKit2/ChangeLog
r89482 r89503 1 2011-06-22 Nate Chapin <japhet@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 Add win symbols for new window.internals functionality. 6 https://bugs.webkit.org/show_bug.cgi?id=62066 7 8 * win/WebKit2.def: 9 1 10 2011-06-22 Balazs Kelemen <kbalazs@webkit.org> 2 11 -
trunk/Source/WebKit2/win/WebKit2.def
r89230 r89503 137 137 ; Re-exports from WebCore for WebCoreTestSupport 138 138 ?getCachedDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PBUClassInfo@3@@Z 139 ?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z 139 140 ?cacheDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PAV23@PBUClassInfo@3@@Z 140 141 ?virtualFunctionToPreventWeakVtable@JSDOMWrapper@WebCore@@MAEXXZ -
trunk/Source/autotools/symbols.filter
r89234 r89503 46 46 _ZN7WebCore9JSElement6s_infoE; 47 47 _ZN7WebCore9toElementEN3JSC7JSValueE; 48 _ZNK7WebCore20CachedResourceLoader11isPreloadedERKN3WTF6StringE; 48 49 _ZNK7WebCore6JSNode21pushEventHandlerScopeEPN3JSC9ExecStateEPNS1_14ScopeChainNodeE; 49 50 local: -
trunk/Tools/ChangeLog
r89502 r89503 1 2011-06-22 Nate Chapin <japhet@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 Add libsoup to libWebCoreInternals build. 6 https://bugs.webkit.org/show_bug.cgi?id=62066 7 8 * GNUmakefile.am: 9 1 10 2011-06-22 Dirk Pranke <dpranke@chromium.org> 2 11 -
trunk/Tools/GNUmakefile.am
r89426 r89503 112 112 libWebCoreInternals_la_CFLAGS = \ 113 113 -fno-strict-aliasing \ 114 $(javascriptcore_cflags) 114 $(javascriptcore_cflags) \ 115 $(LIBSOUP_CFLAGS) 115 116 116 117 # DumpRenderTree
Note: See TracChangeset
for help on using the changeset viewer.