Bug 223304
| Summary: | RenderImage::updateInnerContentRect() pays the cost of constructing a full image URL, but only SVG images need this | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> |
| Component: | Images | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | sabouhallawa, simon.fraser, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Simon Fraser (smfr)
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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/75769980>