DescriptionPrepopulate the memoryCache with data:uri images.
This patch prepopulates the memoryCache for data:uri images, fixing a
long-standing bug where data uri subresources did not load for SVG images
(network loads are still disabled).
The two large changes are the following new methods:
1) resourceFromDataURIRequest has been added which returns a resource from a
data uri request. This function was placed on CachedResource because it needs
to use the createResource helper function. I hope this function can be re-used
in a followup patch to reduce memory in data uri handling.
2) preCacheDataURIImage has been added which simply prefills the memory cache
with a data uri image.
----------------
Update after rollout: Several changes were needed to address test failures:
1) fast/backgrounds/solid-color-context-restore.html
This test was written 7 years ago and no longer tests what it should. The test
relied on a solid color data image being drawn before a selection rect changed
but the image was not actually drawing since data urls loaded and drew
asynchronously.
After this change, the bug in this test was exposed and the image would draw
after the selection changed. This patch removes this test entirely. The bug it
fixed only affected ImageMac which no longer exists. See wkbug.com/10158.
2) fast/forms/basic-buttons.html
This test relied on images not loading synchronously and the image size values
were checked in as 0. This test just needs a rebaseline to correctly set the
image sizes in the expectations.
3) http/tests/inspector/network/image-as-text-loading-data-url.html
This test was for pretty-printing very long data url errors. Because data image
loads no longer touch the network, the error message is no longer printed for
images. I have updated this test to use a long script data url instead of an
image. The test has been renamed "script-as-text-loading-data-url.html".
4) virtual/softwarecompositing/tiling/huge-layer-img.html
This test just needed a rebaseline.
5) I have added two tests to prove synchronicity:
data-uri-images-load-synchronously.html
data-uri-images-reload-synchronously.html
The first is a test for the specific change exposed by
fast/forms/basic-buttons.html: image sizes are now available synchronously. The
second verifies that we do not reload data uris but instead pull them from the
cache.
Lastly, this updated patch no longer checks for incorrect resource types coming
from the cache. This was redundant with a check in determineRevalidationPolicy.
BUG=224317
R=abarth@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=152093
Patch Set 1 #Patch Set 2 : Update for review #Patch Set 3 : Fix LayoutTest crash due to empty data uri #
Total comments: 10
Patch Set 4 : Address reviewer comments #
Total comments: 7
Patch Set 5 : Update per reviewer comments #Patch Set 6 : Assert for wrong cache type #
Total comments: 2
Patch Set 7 : Constification #Patch Set 8 : Update after rollout due to several test failures #Patch Set 9 : Update TestExpectations #
Total comments: 2
Messages
Total messages: 22 (0 generated)
|