Граф коммитов

1311 Коммитов

Автор SHA1 Сообщение Дата
Ting-Yu Lin 1055b1302e Bug 1875600 - Use nsIFrame::PresShell() to simply some callers. r=layout-reviewers,emilio
Those callers who using the pointer immediately after getting from
`GetPresShell()` can be replaced with `PresShell()`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D199164
2024-01-23 00:30:53 +00:00
Emilio Cobos Álvarez 9a23481b1c Bug 1861726 - Make StyleImage::GetResolution account for CSS zoom. r=layout-reviewers,jfkthame
This fixes rendering of background-image when CSS zoom is in effect.

Note that we want to scale the resolution by the _inverse_ of the
zoom, since having a higher image resolution means that the CSS
size gets shrunk and viceversa.

Differential Revision: https://phabricator.services.mozilla.com/D192130
2023-11-06 10:24:53 +00:00
Sean Feng 539e32202b Bug 1722322 - Implement LargestContentfulPaint r=emilio
Spec: https://w3c.github.io/largest-contentful-paint

Differential Revision: https://phabricator.services.mozilla.com/D151079
2023-11-02 20:53:36 +00:00
Sandor Molnar a4163792c6 Backed out 7 changesets (bug 1722322) for causing bp-nu bustages
Backed out changeset 0ebd32e273b8 (bug 1722322)
Backed out changeset 7a75717f127c (bug 1722322)
Backed out changeset c2a6440a83d7 (bug 1722322)
Backed out changeset 9955756855bd (bug 1722322)
Backed out changeset 37fccb407777 (bug 1722322)
Backed out changeset f52b1f28f753 (bug 1722322)
Backed out changeset 0121c8cf5d2f (bug 1722322)
2023-11-02 21:27:24 +02:00
Sean Feng 611093989e Bug 1722322 - Implement LargestContentfulPaint r=emilio
Spec: https://w3c.github.io/largest-contentful-paint

Differential Revision: https://phabricator.services.mozilla.com/D151079
2023-11-02 17:04:47 +00:00
Timothy Nikkel a26b77250a Bug 1857503. Avoid QI and addref when checking if an img has an imagemap. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D190286
2023-10-07 04:46:14 +00:00
Emilio Cobos Álvarez 52d097c513 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-07 11:46:30 +00:00
Narcis Beleuzu 77ba6cde90 Backed out changeset 55052ae7d067 (bug 1851868) for reftest failure on 1153695.html . CLOSED TREE 2023-09-07 02:42:25 +03:00
Emilio Cobos Álvarez 59766eeba4 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-06 22:34:35 +00:00
Tiaan Louw bc45488c4e Bug 1847509 - Remove colors with static initializers r=emilio
This fixes a regression where the size of the binaries were increased.

Differential Revision: https://phabricator.services.mozilla.com/D185849
2023-08-10 05:57:17 +00:00
Tiaan Louw 6798545271 Bug 1846249 - Change color functions to constants r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D184929
2023-08-01 13:14:32 +00:00
Cristian Tuns df732c7c7c Backed out changeset 9763c9244933 (bug 1846249) for causing build bustages in StyleColorInlines.h CLOSED TREE 2023-08-01 07:16:19 -04:00
Tiaan Louw cfd3c0c4e5 Bug 1846249 - Change color functions to constants r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D184929
2023-08-01 10:35:38 +00:00
Iulian Moraru 9b86bfb258 Backed out changeset 2c6e9abd5c86 (bug 1846249) for causing build bustages on ServoStyleConsts.h. CLOSED TREE 2023-07-31 22:06:34 +03:00
Tiaan Louw 54b0405222 Bug 1846249 - Change color functions to constants r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D184929
2023-07-31 18:22:46 +00:00
Emilio Cobos Álvarez b5d6ad43a2 Bug 1844832 - Share document-independent struct allocations. r=boris
In bug 1844755, a bunch of the time is spent allocating initial values.

There used to be more document-dependent initial values before
bug 1834487, but now that's only about default-font and direction.

This improves the situation by sharing initial structs that don't depend
on the document.

Differential Revision: https://phabricator.services.mozilla.com/D184256
2023-07-26 09:16:26 +00:00
Cristina Horotan 360049e026 Backed out changeset ade350a1d864 (bug 1818141) for causing multiple failures at RestyleManager.cpp 2023-05-18 01:49:46 +03:00
Emilio Cobos Álvarez e8ac6a8503 Bug 1818141 - Clean up a bit image updates. r=tnikkel
This shouldn't change behavior but reduces the amount of code paths
where we update the internal image state.

Depends on D170594

Differential Revision: https://phabricator.services.mozilla.com/D170595
2023-05-17 21:13:07 +00:00
Emilio Cobos Álvarez d0ceb7d44f 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 515fd0c083 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 93a0510070 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 91e6e4c5d4 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 5c659eb4ed 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 8d249fa588 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 77551e3034 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 b340c8b127 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 4b73051e3b 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 0179d6715f 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 4238513610 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 a228002bd2 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 4594ae314a 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 1b3e69f8aa 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 5514dadfb2 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 631d4770aa 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 d957332938 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 45abd683e8 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 19336bc7fa 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 c55000c6b8 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 fb091b8e13 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 d75756ca11 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 2ec308723b 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 8f0d50d3c1 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 7b9b08a5ed 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 a91a861e4b 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 17df5816aa 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 abb5044ca7 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 5a260d61a4 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 e4a53f90d5 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 1629218702 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 a8037fdc9b 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