Bug 223304 - RenderImage::updateInnerContentRect() pays the cost of constructing a full image URL, but only SVG images need this
Summary: RenderImage::updateInnerContentRect() pays the cost of constructing a full im...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-16 21:48 PDT by Simon Fraser (smfr)
Modified: 2021-03-23 21:48 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2021-03-16 21:48:02 PDT
RenderImage::updateInnerContentRect() does:

        URL imageSourceURL;
        if (HTMLImageElement* imageElement = is<HTMLImageElement>(element()) ? downcast<HTMLImageElement>(element()) : nullptr)
            imageSourceURL = document().completeURL(imageElement->imageSourceURL());
        imageResource().setContainerContext(containerSize, imageSourceURL);

but CachedImage::setContainerContextForClient() only uses the URL for SVG images.

We should avoid paying the cost when it's not needed. That cost is 0.1% on the MM leaves subtest.
Comment 1 Radar WebKit Bug Importer 2021-03-23 21:48:13 PDT
<rdar://problem/75769980>