Closed Bug 1815229 Opened 2 years ago Closed 2 years ago

Remove nsImageBoxFrame.

Categories

(Core :: XUL, task)

task

Tracking

()

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(8 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
No description provided.

nsImageFrame has support for displaying style URIs / an owned image
request, so use it.

The main behavior difference is that we don't fire load / error
events for those images anymore, but I don't see any event listener for
those around, so I think they can go.

We are about to introduce a kind for <xul:image> elements, so this makes
the naming less confusing.

It's not for content: url() only anymore (we also use it for
list-style-image, and soon for XUL images too). The difference is that
the frame owns that request (vs. the image content).

Depends on D169981

We're about to add a new Kind, so this makes it a bit easier to follow
once that's done, IMO. Also prevents people from forgetting to update
that method in the future.

Depends on D169982

We're about to use it a bit more.

Depends on D169984

Attachment #9316125 - Attachment description: Bug 1815229 - Remove nsImageBoxFrame. r=Gijs!,#layout!,tnikkel,dholbert → Bug 1815229 - Remove nsImageBoxFrame. r=tnikkel,dholbert,#layout
Depends on: 1817071
Depends on: 1817077
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a7de34d8b5e4 Rename nsImageFrame::Kind::ImageElement to ImageLoadingContent. r=tnikkel,layout-reviewers https://hg.mozilla.org/integration/autoland/rev/c6ad17d05cf3 Rename nsImageFrame::mContentURLRequest and related members. r=tnikkel,layout-reviewers https://hg.mozilla.org/integration/autoland/rev/b2a134c60491 Implement nsImageFrame::GetImageFromStyle with a switch statement. r=tnikkel,layout-reviewers https://hg.mozilla.org/integration/autoland/rev/d5853101eec5 Factor out a few PresContext() calls in nsImageFrame::Init. r=tnikkel,layout-reviewers
Keywords: leave-open
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/60ebe844b93b Use member initializers a bit more in nsImageFrame. r=tnikkel,layout-reviewers

UL doesn't have visibility tracking nor discarding of images, and they
were always eagerly decoded. Switching to the <img> model causes
browser_startup_flicker.js to fail due to flickering on the FF view
button, which is a lazily-async-decoded chrome:// PNG image.

Given the other benefits that async-decoding has, and the other benefits
that we get from the switch to nsImageFrame, this seems worth
annotating.

We could do some of these alternatives instead:

  • Always sync-decode <xul:image> (what my initial version of D168958
    did). The easiest to implement, maybe more behavior-preserving
    option.

  • Always sync-decode chrome:// or resource:// images. Maybe worth it?
    Though some of them could be rather big.

  • Add an heuristic to sync-decode small-ish images (maybe only for
    <xul:image>). I think if we needed to work around this, this would be
    slightly preferable, but it's a bit unclear what the heuristic should
    be and whether it's worth it.

  • Add a chrome-only CSS property to opt-in to image sync-decoding of
    content/etc images. I'd rather not, seems too complicated for the
    rather small benefit that we'd get.

Given that, I tend to think I'd rather land the patch as is and address
this later if it becomes a problem for other images or if it's a visible
regression in practice. But happy to do something else instead.

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fbea219ac81c Factor out owned request clean-up into its own method. r=tnikkel,layout-reviewers
Depends on: 1817360
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7c7ff0a3cc4e Remove nsImageBoxFrame. r=tnikkel,layout-reviewers https://hg.mozilla.org/integration/autoland/rev/07438d7c2372 Fix a test failure due to async-decoding of XUL images. r=Gijs
Keywords: leave-open
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
Regressions: 1818141
Regressions: 1818236
Regressions: 1818282
Regressions: 1818432
Regressions: 1818620
Regressions: 1819084
See Also: → 1820709
Regressions: 1818230
Regressions: 1818737
Regressions: 1851001
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: