Report CSS as initiator instead of elements, except body
authorsimonjam@chromium.org <simonjam@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2012 19:19:46 +0000 (19:19 +0000)
committersimonjam@chromium.org <simonjam@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2012 19:19:46 +0000 (19:19 +0000)
commitd8ccdfc19ba7771dabf88f7957f4827b43dfaa08
treea9b137a4ee1734e24ae06922af95ec71f69e6b60
parent24e925698feec1409f1daa29f1ab93f218fa2dac
Report CSS as initiator instead of elements, except body
https://bugs.webkit.org/show_bug.cgi?id=103546

Reviewed by Tony Gentilcore.

Source/WebCore:

The Resource Timing spec says the initiator should be "css" when the the load comes from a
url() rule in a stylesheet. Separately, WebKit reports <body background> as a CSS load, we
need to override that to match the spec.

Tests: http/tests/w3c/webperf/submission/resource-timing

* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::cachedImage):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::cachedImage): By default, the initiator is "css".
* css/CSSImageValue.h:
(CSSImageValue):
(WebCore::CSSImageValue::setInitiator): Allow users to manually override it (see body).
* css/StyleResolver.cpp:
(WebCore::StyleResolver::loadPendingImage):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::collectStyleForPresentationAttribute): Record "body" as the initiator.

LayoutTests:

* platform/chromium/fast/loader/resource-request-callbacks-expected.txt: Rebaseline to match new behavior.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136256 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/chromium/fast/loader/resource-request-callbacks-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/CSSCursorImageValue.cpp
Source/WebCore/css/CSSImageValue.cpp
Source/WebCore/css/CSSImageValue.h
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/html/HTMLBodyElement.cpp