Changeset 273764 in webkit
- Timestamp:
- Mar 2, 2021, 3:22:20 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/background-svg-image-loading-expected.html (added)
-
LayoutTests/fast/css/background-svg-image-loading.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/loader/cache/CachedImage.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderBox.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r273761 r273764 1 2021-03-02 Said Abou-Hallawa <said@apple.com> 2 3 The layout of SVGImage should force the layout for its clients 4 https://bugs.webkit.org/show_bug.cgi?id=221253 5 <rdar://problem/74138641> 6 7 Reviewed by Simon Fraser. 8 9 * fast/css/background-svg-image-loading-expected.html: Added. 10 * fast/css/background-svg-image-loading.html: Added. 11 1 12 2021-03-02 Lauro Moura <lmoura@igalia.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r273758 r273764 1 2021-03-02 Said Abou-Hallawa <said@apple.com> 2 3 The layout of SVGImage should force the layout for its clients 4 https://bugs.webkit.org/show_bug.cgi?id=221253 5 <rdar://problem/74138641> 6 7 Reviewed by Simon Fraser. 8 9 Unlike the bitmap image, the intrinsic size of SVGImage can only be known 10 after running its layout. Because SVGImage can be used by multiple clients, 11 CachedImage maintains an SVGImageCache which maps a client to an 12 SVGImageForContainer. SVGImageForContainer is just a wrapper of SVGImage 13 with the intrinsic size of the client. Because we may set an entry for 14 the renderer in SVGImageCache early before running a layout for SVGImage 15 and because the renderer intrinsic size depends on the intrinsic size of 16 SVGImage, SVGImageForContainer may have an empty intrinsic size. 17 18 So basically it is a race condition: knowing the intrinsic size of the 19 SVGImage client depends on the intrinsic size of SVGImage itself. And the 20 intrinsic size of SVGImageForContainer depends on the intrinsic size of 21 the client. This may lead to not rendering the clients because their sizes 22 are empty. To fix this issue we need to force calculateBackgroundImageGeometry() 23 once we finish the layout of the SVGImage which happens after receiving all 24 its data and calling RenderBox::imageChanged(). 25 26 Test: fast/css/background-svg-image-loading.html 27 28 * loader/cache/CachedImage.cpp: 29 (WebCore::CachedImage::finishLoading): 30 * rendering/RenderBox.cpp: 31 (WebCore::RenderBox::repaintLayerRectsForImage): 32 1 33 2021-03-02 Simon Fraser <simon.fraser@apple.com> 2 34 -
trunk/Source/WebCore/loader/cache/CachedImage.cpp
r271638 r273764 585 585 } 586 586 587 setLoading(false); 587 588 notifyObservers(); 588 589 CachedResource::finishLoading(data, metrics); -
trunk/Source/WebCore/rendering/RenderBox.cpp
r273753 r273764 1851 1851 1852 1852 for (auto* layer = &layers; layer; layer = layer->next()) { 1853 if (layer->image() && image == layer->image()->data() && layer->image()->canRender(this, style().effectiveZoom())) {1853 if (layer->image() && image == layer->image()->data() && (layer->image()->isLoaded() || layer->image()->canRender(this, style().effectiveZoom()))) { 1854 1854 // Now that we know this image is being used, compute the renderer and the rect if we haven't already. 1855 1855 bool drawingRootBackground = drawingBackground && (isDocumentElementRenderer() || (isBody() && !document().documentElement()->renderer()->hasBackground()));
Note:
See TracChangeset
for help on using the changeset viewer.