Commit Graph

1293 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
02bed897c9 Bug 1831850 - Remove force_inline_alttext pref. r=karlt
It's not really web compatible nor turned on by default anywhere.

Differential Revision: https://phabricator.services.mozilla.com/D177373
2023-05-08 21:38:33 +00:00
Timothy Nikkel
a3f478867e Bug 1827318. Restore hunk from bug 1820709 that accidentally got rebased away in bug 1817360. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175086
2023-04-11 01:03:41 +00:00
Emilio Cobos Álvarez
be5f3d7254 Bug 1817360 - Lazily load broken image icon. r=tnikkel
With the patches of bug 1815229, these errors appear:

browser/base/content/test/performance/browser_startup_images.js | Loaded image resource://gre-resources/loading-image.png should have been shown

It's a real issue, where we eagerly load the broken image icon and so on
even though we don't use them.

This fixes it by lazily-loading the icon once, only when needed.

Differential Revision: https://phabricator.services.mozilla.com/D170159
2023-03-24 14:56:34 +00:00
Emilio Cobos Álvarez
8dabbf6590 Bug 1823686 - Share URLExtraData between SVG attribute mapping and style attribute. r=smaug
I don't think there's ever a way these should differ.

Got some include hell from removing ReferrerInfo.h from Document.h but
hopefully should be straight-forward to review.

Depends on D173154

Differential Revision: https://phabricator.services.mozilla.com/D173155
2023-03-22 14:54:43 +00:00
Emilio Cobos Álvarez
4511290c2a Bug 1823764 - Use HasNonEmptyAttr to choose between XUL src and list-style-image. r=tnikkel,layout-reviewers
This preserves the previous behavior more exactly and fixes the display
of the icons, which have src="" but expect list-style-image to take
effect.

Depends on D173265

Differential Revision: https://phabricator.services.mozilla.com/D173266
2023-03-22 11:50:06 +00:00
Emilio Cobos Álvarez
3bbeaf0241 Bug 1684958 - Support rendering content: <gradient> images. r=dholbert,devtools-reviewers
We implemented support for list-style-image anyways.

Differential Revision: https://phabricator.services.mozilla.com/D172343
2023-03-14 12:11:34 +00:00
Emilio Cobos Álvarez
293d6ce17a Bug 1817219 - Remove ContentUrlOnImageContent telemetry. r=layout-reviewers,tnikkel
Bug 1484928 is fixed, we should've removed this then.

Differential Revision: https://phabricator.services.mozilla.com/D172106
2023-03-09 11:43:41 +00:00
Timothy Nikkel
a48bd874ff Bug 1820709. Make nsImageFrame use nsDisplayListBuilder::GetImageDecodeFlags. r=emilio
This will mean we always pass FLAG_SYNC_DECODE_IF_FAST (unless we are already passing the sync decode flag). The fact that we weren't doing this already is an oversight, we want to do this for all images we paint on the normal painting path. However what makes this more important is that we folded nsImageBoxFrame into nsImageFrame recently (bug 1815229), and nsImageBoxFrame eagerly decodes all its images and keeps them decoded, and also uses FLAG_SYNC_DECODE_IF_FAST (because with multiple sized decodes eager decodes don't cover everything). So this should help us avoid regressing visually with xul images.

Differential Revision: https://phabricator.services.mozilla.com/D171828
2023-03-07 10:16:46 +00:00
Timothy Nikkel
4b057ee794 Bug 1820709. Make nsDisplayAltFeedback::CreateWebRenderCommands sync decode just like nsDisplayAltFeedback::Paint. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171827
2023-03-07 10:16:02 +00:00
Emilio Cobos Álvarez
1782a23c1a Bug 1818432 - Provide intrinsic size from theme for xul images that are themed but don't have any images. r=tnikkel,layout-reviewers
This restores previous behavior of <xul:image>.

Differential Revision: https://phabricator.services.mozilla.com/D170743
2023-02-23 12:49:12 +00:00
Emilio Cobos Álvarez
1215d4d48d Bug 1818141 - Update image when going from non-null to null XUL image request. r=tnikkel
Otherwise we end up with a stale intrinsic size.

Differential Revision: https://phabricator.services.mozilla.com/D170594
2023-02-22 12:50:23 +00:00
Emilio Cobos Álvarez
2cc340aa0a Bug 1815229 - Remove nsImageBoxFrame. r=tnikkel,layout-reviewers
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.

Differential Revision: https://phabricator.services.mozilla.com/D168958
2023-02-21 17:36:11 +00:00
Jonathan Kew
e2c069db1f Bug 1815404 - Replace most uses of gfxContext::CreateOrNull with stack-allocated contexts. r=gfx-reviewers,lsalzman
Depends on D170370

Differential Revision: https://phabricator.services.mozilla.com/D170371
2023-02-21 07:28:25 +00:00
Jonathan Kew
e998377ebb Bug 1815404 - Remove refcounting from gfxContext. r=gfx-reviewers,lsalzman
Depends on D170367

Differential Revision: https://phabricator.services.mozilla.com/D170369
2023-02-21 07:28:24 +00:00
Emilio Cobos Álvarez
1aa775c8d4 Bug 1817360 - Remove browser.display.show_loading_image_placeholder. r=tnikkel
This pref has been false since forever, completely untested, and I see
no references to it anywhere. I'm pretty sure having a loading image
placeholder wouldn't be web compatible, particularly in the current days
with all the lazy-loading shenanigans etc.

I propose just removing this code, and simplifying surrounding code for
clarity.

Differential Revision: https://phabricator.services.mozilla.com/D170158
2023-02-17 09:25:20 +00:00
Emilio Cobos Álvarez
d20111ab0a Bug 1817360 - Clean-up image icon loading code. r=tnikkel
* Use static prefs.
 * Move IconLoad to the cpp file since it's only used in one translation
   unit.

This is in preparation to make the image loads lazy.

Differential Revision: https://phabricator.services.mozilla.com/D170157
2023-02-17 09:25:19 +00:00
Emilio Cobos Álvarez
7e52d51001 Bug 1815229 - Factor out owned request clean-up into its own method. r=tnikkel,layout-reviewers
We're about to use it a bit more.

Switch to CancelAndForgetObserver, since we will call it in the future from
other places that aren't frame destruction. This doesn't change behavior of the
existing caller because we call mListener->SetFrame(nullptr), which effectively
no-ops the listener

Differential Revision: https://phabricator.services.mozilla.com/D169985
2023-02-17 01:53:24 +00:00
Emilio Cobos Álvarez
ed82ad57ad Bug 1815229 - Use member initializers a bit more in nsImageFrame. r=tnikkel,layout-reviewers
Depends on D169985

Differential Revision: https://phabricator.services.mozilla.com/D169986
2023-02-16 22:40:46 +00:00
Emilio Cobos Álvarez
4bf2bdc2da Bug 1815229 - Factor out a few PresContext() calls in nsImageFrame::Init. r=tnikkel,layout-reviewers
Depends on D169983

Differential Revision: https://phabricator.services.mozilla.com/D169984
2023-02-16 12:10:09 +00:00
Emilio Cobos Álvarez
8890df8558 Bug 1815229 - Implement nsImageFrame::GetImageFromStyle with a switch statement. r=tnikkel,layout-reviewers
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

Differential Revision: https://phabricator.services.mozilla.com/D169983
2023-02-16 12:10:09 +00:00
Emilio Cobos Álvarez
f180dc9c90 Bug 1815229 - Rename nsImageFrame::mContentURLRequest and related members. r=tnikkel,layout-reviewers
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

Differential Revision: https://phabricator.services.mozilla.com/D169982
2023-02-16 12:10:09 +00:00
Emilio Cobos Álvarez
22aca06380 Bug 1815229 - Rename nsImageFrame::Kind::ImageElement to ImageLoadingContent. r=tnikkel,layout-reviewers
We are about to introduce a kind for <xul:image> elements, so this makes
the naming less confusing.

Differential Revision: https://phabricator.services.mozilla.com/D169981
2023-02-16 12:10:08 +00:00
Robert Longson
099b2e87d0 Bug 1651129 - Convert uses of mState to various StateBits methods and make mState private r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D169943
2023-02-15 21:35:46 +00:00
Sean Feng
48ab2faa5d Bug 1815913 - Init nsImageMap more eagerly r=emilio
Since we are initializing nsImageMap lazily, it's possible for area elements
stays non-focusable when autofocus code tries to focus it. So to fix
this, we need to ensure nsImageMap is initialized early enough.

Differential Revision: https://phabricator.services.mozilla.com/D168166
2023-02-13 15:52:40 +00:00
Noemi Erli
6e4b3ac323 Backed out changeset b7c94e151005 (bug 1815913) for causing failures in test_HTMLSpec.html CLOSED TREE 2023-02-09 23:52:01 +02:00
Sean Feng
329686565b Bug 1815913 - Init nsImageMap more eagerly r=emilio
Since we are initializing nsImageMap lazily, it's possible for area elements
stays non-focusable when autofocus code tries to focus it. So to fix
this, we need to ensure nsImageMap is initialized early enough.

Differential Revision: https://phabricator.services.mozilla.com/D168166
2023-02-09 17:05:34 +00:00
Manuel Bucher
211015d6f1 Bug 1771867 - Early Hints Phase 2 - Part 7: Pass early hint preload to image preloader r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D161177
2022-12-02 16:15:55 +00:00
Martin Robinson
62878408df Bug 1803377 - Rename the values of the IntrinsicDirty enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163607
2022-12-02 12:27:31 +00:00
Csoregi Natalia
51f523d872 Backed out 13 changesets (bug 1771867) for causing CanonicalBrowsingContext crashes. CLOSED TREE
Backed out changeset 120838b58449 (bug 1771867)
Backed out changeset aea7ca0bbd17 (bug 1771867)
Backed out changeset 2fe2afdee09d (bug 1771867)
Backed out changeset 8bdb1f682d22 (bug 1771867)
Backed out changeset a9f3158ed688 (bug 1771867)
Backed out changeset 1177913e1edf (bug 1771867)
Backed out changeset d33ccbbf407d (bug 1771867)
Backed out changeset 110ac12e16f5 (bug 1771867)
Backed out changeset 7f20525f5e94 (bug 1771867)
Backed out changeset b3d65b1aa872 (bug 1771867)
Backed out changeset 7cdf3cef2773 (bug 1771867)
Backed out changeset 5090eae24a5c (bug 1771867)
Backed out changeset f8a03d226c73 (bug 1771867)
2022-12-02 13:44:55 +02:00
Manuel Bucher
bb8505a5e4 Bug 1771867 - Early Hints Phase 2 - Part 7: Pass early hint preload to image preloader r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D161177
2022-12-02 09:45:26 +00:00
Razvan Cojocaru
363946e17f Bug 1060421 - Change the type of [Int]PointTyped::[x|y] back to [Int]CoordTyped. r=botond
[Int]CoordTyped no longer inherits Units because otherwise
instances of [Int]IntPointTyped may get one Base subobject because
it inherits Units, and others because of BasePoint's Coord members,
which end up increasing the [Int]CoordTyped's objects size (since
according to the ISO C++ standard, different Base subobject are
required to have different addresses).

Differential Revision: https://phabricator.services.mozilla.com/D160713
2022-11-04 18:29:35 +00:00
Timothy Nikkel
cc22864ec5 Bug 1795990. Remove unused nsImageFrame/nsImageBoxFrame::RestartAnimation/StopAnimation. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D159630
2022-10-21 06:03:52 +00:00
Dan Robertson
130ee7fffe Bug 1655598 - Cross origin image request should not respect image orientation. r=emilio
A cross origin image request should not respect the given style image
orientation, but should use any image orientation provided by the image.

Differential Revision: https://phabricator.services.mozilla.com/D156919
2022-09-28 03:56:57 +00:00
Dan Robertson
4388738024 Bug 1655598 - The imgIRequest uri attribute should be infallible. r=emilio
The implementation of GetURI always returns NS_OK, and therefore the URI can
be marked as infallible.

Differential Revision: https://phabricator.services.mozilla.com/D157009
2022-09-28 03:56:57 +00:00
Butkovits Atila
fd6ff06db9 Backed out 2 changesets (bug 1655598) for causing Bug 1792435. a=backout
Backed out changeset 9eb3b3e7295b (bug 1655598)
Backed out changeset 052c6f05c623 (bug 1655598)
2022-09-27 12:37:10 +03:00
Dan Robertson
337ae55b7b Bug 1655598 - Cross origin image request should not respect image orientation. r=emilio
A cross origin image request should not respect the given style image
orientation, but should use any image orientation provided by the image.

Differential Revision: https://phabricator.services.mozilla.com/D156919
2022-09-25 00:07:56 +00:00
Dan Robertson
30176ee5f2 Bug 1655598 - The imgIRequest uri attribute should be infallible. r=emilio
The implementation of GetURI always returns NS_OK, and therefore the URI can
be marked as infallible.

Differential Revision: https://phabricator.services.mozilla.com/D157009
2022-09-25 00:07:55 +00:00
Martin Robinson
009354aed9 Bug 1791760 - Move GetContainSizeAxes to nsIFrame r=emilio
This will allow this function to eventually return an appropriate value
depending on whether or not content is skipped via `content-visibility:
auto`. This change also starts looking directly at whether
content-visibility is skipping content or not, which should make it
compatible with a future `content-visibility: auto` implementation.

Differential Revision: https://phabricator.services.mozilla.com/D157831
2022-09-22 12:11:09 +00:00
Martin Robinson
d6b19e86ff Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio
Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.

This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.

In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.

Differential Revision: https://phabricator.services.mozilla.com/D157306
2022-09-15 20:32:27 +00:00
Norisz Fay
59f059dd2d Backed out changeset c3780baf6f24 (bug 1789255) for causing build bustages CLOSED TREE 2022-09-15 21:14:04 +03:00
Martin Robinson
a7d2990285 Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio
Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.

This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.

In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.

Differential Revision: https://phabricator.services.mozilla.com/D157306
2022-09-15 17:56:42 +00:00
Sandor Molnar
12e1fb9746 Backed out changeset 3a5759eabb42 (bug 1789255) for causing wpt failures in netwerk/protocol/http/Http2Session.cpp CLOSED TREE 2022-09-14 02:01:36 +03:00
Martin Robinson
00e3cff6d7 Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio
Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.

This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.

In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.

Differential Revision: https://phabricator.services.mozilla.com/D156473
2022-09-13 20:01:35 +00:00
Emilio Cobos Álvarez
d8341bcf96 Bug 1787072 - Avoid useless reframes setting the src attribute of a broken image that already has an image frame. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D155533
2022-09-02 09:39:38 +00:00
Emilio Cobos Álvarez
10ace3bb6a Bug 1781096 - Fix decoding="sync" when the frame is created after the image attribute. r=tnikkel
The fix is the one line in
nsImageLoadingContent::MaybeForceSyncDecoding, but I added new asserts
that should prevent this from regressing in the future.

Differential Revision: https://phabricator.services.mozilla.com/D154815
2022-08-17 10:10:26 +00:00
Andreas Farre
3cab76dcc7 Bug 1595491 - Part 1: Make <embed> and <object> behave more like <iframe>. r=smaug,emilio
By making image loading in <embed> and <object> behave more like when
an <iframe> loads an image, we can make sure that the synthetic
document generated is process switched if the image is cross
origin. This is done by making image loading in nsObjectLoadingContent
follow the document loading path.

We also make sure that we pass the image size back to the embedder
element to not get stuck with the intrinsic size.

To avoid named targeting being able to target these synthetic
documents, as well as showing up in `Window.frames` and being counted
in `Window.length`, we keep a filtered list of non-synthetic browsing
contexts for that use-case.

This feature is controlled by two prefs:

* browser.opaqueResponseBlocking.syntheticBrowsingContext

  This triggers the creation of synthetic documents for images loaded
  in <object> or embed.

* browser.opaqueResponseBlocking.syntheticBrowsingContext.filter

  This turns on the filtering of synthetic browsing contexts in named
  targeting, `Window.length` and `Window.frames`.

Differential Revision: https://phabricator.services.mozilla.com/D148117
2022-08-16 16:42:58 +00:00
Oriol Brufau
74e98aeabf Bug 1782025 - Obey contain-intrinsic-size in images. r=emilio
Bug 1780475 already covered images with size containment in a single
axis, but images with size containment in both axes were still ignoring
contain-intrinsic-size and just using 0x0.

Note the spec is not completely clear about what to do for replaced
elements with size containment, but what Chromium does seems reasonable:
 - No natural aspect ratio, regardless of contain-intrinsic-size.
 - Natural sizes are provided by contain-intrinsic-size (0x0 for none).

https://github.com/w3c/csswg-drafts/issues/7519#issuecomment-1190780627
can discuss other approaches, but for now this patch brings consistency
and makes some tests pass.

Differential Revision: https://phabricator.services.mozilla.com/D153079
2022-07-28 19:30:58 +00:00
Ting-Yu Lin
06ddbd2b65 Bug 1464761 Part 4 - Remove nsReflowStatus::mTruncated bit. r=dholbert
In the description of the mTruncated bit, its purpose is the same as calling
SetInlineLineBreakBeforeAndReset(). We've removed all its usages in previous
patches, so the bit is no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D151461
2022-07-27 21:55:18 +00:00
Emilio Cobos Álvarez
fe32378bf5 Bug 1781034 - Remove layout debugger's visual debugging. r=layout-reviewers,dshin
Differential Revision: https://phabricator.services.mozilla.com/D152628
2022-07-26 15:06:30 +00:00
Marian-Vasile Laza
e74e7b0a1a Backed out 2 changesets (bug 1781034) for causing bustages on nsImageFrame.cpp. CLOSED TREE
Backed out changeset 6a7a9375987a (bug 1781034)
Backed out changeset 58728270361e (bug 1781034)
2022-07-26 17:45:06 +03:00