-
https://bugs.webkit.org/show_bug.cgi?id=50758antti@apple.com authored
<rdar://problem/8722094> Defer loading print stylesheets Reviewed by Alexey Proskuryakov. - Make preload scanner skip stylesheets with non-screen media types. - Make it possible to specify non-default load priority from the client. - Use this mechanism to load print stylesheets using very low priority so they get loaded after everything else. - Move default priority code from Loader to CachedResource. - Move ResourceLoadScheduler::Priority enum to a separate file (as ResourceLoadPriority). - Add a way to make ResourceLoadScheduler load resources one at the time so the above functionality can be tested reliably. Tests: http/tests/local/link-stylesheet-load-order-preload.html http/tests/local/link-stylesheet-load-order.html * WebCore.exp.in: * WebCore.gypi: * WebCore.pro: * WebCore.vcproj/WebCore.vcproj: * WebCore.xcodeproj/project.pbxproj: * css/CSSImageValue.cpp: (WebCore::CSSImageValue::cachedImage): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::process): * html/parser/HTMLPreloadScanner.cpp: (WebCore::HTMLNames::PreloadTask::PreloadTask): (WebCore::HTMLNames::PreloadTask::processAttributes): (WebCore::HTMLNames::PreloadTask::relAttributeIsStyleSheet): (WebCore::HTMLNames::PreloadTask::linkMediaAttributeIsScreen): (WebCore::HTMLNames::PreloadTask::preload): * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): * loader/ResourceLoadPriority.h: Added. * loader/ResourceLoadScheduler.cpp: (WebCore::ResourceLoadScheduler::ResourceLoadScheduler): (WebCore::ResourceLoadScheduler::scheduleSubresourceLoad): (WebCore::ResourceLoadScheduler::schedulePluginStreamLoad): (WebCore::ResourceLoadScheduler::scheduleLoad): (WebCore::ResourceLoadScheduler::servePendingRequests): (WebCore::ResourceLoadScheduler::HostInformation::~HostInformation): (WebCore::ResourceLoadScheduler::HostInformation::schedule): (WebCore::ResourceLoadScheduler::HostInformation::remove): (WebCore::ResourceLoadScheduler::HostInformation::hasRequests): (WebCore::ResourceLoadScheduler::HostInformation::limitRequests): * loader/ResourceLoadScheduler.h: (WebCore::ResourceLoadScheduler::isSerialLoadingEnabled): (WebCore::ResourceLoadScheduler::setSerialLoadingEnabled): (WebCore::ResourceLoadScheduler::HostInformation::requestsPending): * loader/cache/CachedResource.cpp: (WebCore::defaultPriorityForResourceType): (WebCore::CachedResource::CachedResource): * loader/cache/CachedResource.h: (WebCore::CachedResource::loadPriority): (WebCore::CachedResource::setLoadPriority): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestCSSStyleSheet): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::requestPreload): * loader/cache/CachedResourceLoader.h: * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::requestResource): * loader/cache/MemoryCache.h: * loader/loader.cpp: (WebCore::Loader::load): WebKit/mac: https://bugs.webkit.org/show_bug.cgi?id=50758 <rdar://problem/8722094> Defer loading print stylesheets Reviewed by Alexey Proskuryakov. Expose SPI for DRT for making resources load serially. This is useful for testing resource load order. * WebView/WebView.mm: (+[WebView _setLoadResourcesSerially:forHost:]): * WebView/WebViewPrivate.h: WebKitTools: Add setSerializeHTTPLoads function to allow testing resource load order on OS X. https://bugs.webkit.org/show_bug.cgi?id=50758 Reviewed by Alexey Proskuryakov. * DumpRenderTree/LayoutTestController.cpp: (setSerializeHTTPLoadsCallback): (LayoutTestController::staticFunctions): * DumpRenderTree/LayoutTestController.h: * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: (LayoutTestController::setSerializeHTTPLoads): * DumpRenderTree/mac/DumpRenderTree.mm: (resetDefaultsToConsistentValues): * DumpRenderTree/mac/LayoutTestControllerMac.mm: (LayoutTestController::setSerializeHTTPLoads): * DumpRenderTree/win/LayoutTestControllerWin.cpp: (LayoutTestController::setSerializeHTTPLoads): LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=50758 <rdar://problem/8722094> Defer loading print stylesheets Reviewed by Alexey Proskuryakov. Test load ordering. * http/tests/local/link-stylesheet-load-order-expected.txt: Added. * http/tests/local/link-stylesheet-load-order-preload-expected.txt: Added. * http/tests/local/link-stylesheet-load-order-preload.html: Added. * http/tests/local/link-stylesheet-load-order.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
6f72f782