Prefer aspect-ratio to the tentative BSize if we have both tentative
ISize and BSize.
Also make auto aspect-ratio handling a bit more explicit.
To prevent some regressions, we need to:
* Fix size-containment aspect ratio for <embed> (nsSubDocumentFrame).
* Fix RasterImage::GetIntrinsicRatio with uneven ratios.
* Avoid SVG root from using the aspect ratio from the viewbox, see
bug 2035918.
Differential Revision: https://phabricator.services.mozilla.com/D296982
These prefs were made toggle-able dynamically so that we could test the feature in CI before the feature was enabled by default, but now that the feature has been enabled for a long time we are not likely to disable these prefs in the codebase so that is no longer important. We have a lot of code to handle these prefs being dynamic and it results in bugs where not all callers are passing these flags meaning animated avif images can get disabled in those call sites.
Differential Revision: https://phabricator.services.mozilla.com/D281712
These prefs were made toggle-able dynamically so that we could test the feature in CI before the feature was enabled by default, but now that the feature has been enabled for a long time we are not likely to disable these prefs in the codebase so that is no longer important. We have a lot of code to handle these prefs being dynamic and it results in bugs where not all callers are passing these flags meaning animated avif images can get disabled in those call sites.
Differential Revision: https://phabricator.services.mozilla.com/D281712
If a consumer has an imgIContainer it's possible that they could call RequestDecodeWithResult before a metadata decode has completed, so it returns DECODE_REQUESTED, but then the metadata decode fails and we'll call RasterImage::DoError
https://searchfox.org/firefox-main/rev/ad97131360471d36dfd9cf85695dde35914843bc/image/RasterImage.cpp#1549
and we'll call NotifyProgress(NoProgress, dirtyRect) where dirtyRect is mSize, and mSize is empty, so that will send no notifications out (the rect being non-empty is the condition to send a FRAME_UPDATE notification). So the consumer will get no notification and it will still be waiting for the decode it was told was requested.
Differential Revision: https://phabricator.services.mozilla.com/D265919
This is mostly just a convenience shorthand to avoid running the same
boilerplate/error-checking code in the implementation of the 'width' and
'height' attributes, for the benefit of callers that need both sizes. But,
beyond that convenience: this also lets us elegantly express the case where an
image simply lacks an intrinsic width and/or height (not due to any error, but
simply because it's e.g. an SVG that has no preferred size in either or both of
its axes). This is a state we'll need to be able to detect and give special
treatment to in a forthcoming patch for bug 1935269.
Differential Revision: https://phabricator.services.mozilla.com/D248526
This patch doesn't change behavior; it's just a rename.
Without this, it's easy to get confused and assume that img.intrinsicSize would
just be a shorthand for img.width and img.height -- but it's not. (It has
different units from the 'width' and 'height' attributes, and in some cases --
e.g. the VectorImage implementation -- it queries for its answer in a different
way from how 'width' and 'height' do.
(I'm doing this partly because I'll soon be adding a new attribute that *does*
just represent img.width and img.height, and that new attribute will also be
named something like "intrinsicSize"; and I want to minimize confusion between
that new attribute and this existing one.)
Differential Revision: https://phabricator.services.mozilla.com/D248492
AspectRatio already has a way of representing a null / invalid ratio,
and there are some cases (broken sizes or invalid SVGOuterSVGFrame
ratio) where we might get Some(AspectRatio()).
It's not a meaningfully different state, and IMO we shouldn't treat it
differently.
Differential Revision: https://phabricator.services.mozilla.com/D224212
AspectRatio already has a way of representing a null / invalid ratio,
and there are some cases (broken sizes or invalid SVGOuterSVGFrame
ratio) where we might get Some(AspectRatio()).
It's not a meaningfully different state, and IMO we shouldn't treat it
differently.
Differential Revision: https://phabricator.services.mozilla.com/D224212
A number of public APIs in Skia have changed since the update to m125,
so various places in Gecko need to be updated to track it.
Differential Revision: https://phabricator.services.mozilla.com/D209821
A number of public APIs in Skia have changed since the update to m125,
so various places in Gecko need to be updated to track it.
Differential Revision: https://phabricator.services.mozilla.com/D209821
This code was added before we decided to do fission, when we wanted to separate out different sites that were in the same process so we could prioritize them better. We are not going down that path so we can simplify this code. There should be no change in functionality with this patch, just simpler code.
Differential Revision: https://phabricator.services.mozilla.com/D201705
This prevents a crash that would occur if a redecode of an animated AVIF happened after changing the `sequences.enabled` pref from `true` to `false`.
Differential Revision: https://phabricator.services.mozilla.com/D170190
[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
All its members are optional, so we can just use it as a plain struct
rather than Maybe<> all around, which simplifies the code and prevents
silly bugs like bug 1779592.
Mostly automatic via:
rg -l 'SVGImageContext' . | xargs sed -i 's/Maybe<SVGImageContext>/SVGImageContext/g'
With trivial build fixes.
Not intended to change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D151846
We'll probably want to do something more accurate in the future with a
custom clang static analysis pass which validates that XPIDL interfaces
have the expected vtable and struct layout, however doing so would be
more involved than the string matching done in this patch.
In addition to checking for extra virtual methods, we'll likely also
want to check for data members on interfaces, and reject them unless the
class is marked as `[builtinclass]` in addition to some other attribute
which we'll need to add to prevent them from being implemented in Rust
(as c++ data members will not be reflected by the rust macro).
There were 2 instances of a comment which contained the word 'virtual'
within a CDATA block. These comments were moved out of the CDATA block
to avoid triggering the error.
Differential Revision: https://phabricator.services.mozilla.com/D151068
When we request a sync decode, if there is an outstanding pending
async decode, but we don't have all the network data, we would end up
triggering an extra async decode. This patch ensures that we only
trigger sync decodes if they will actually execute as sync.
Differential Revision: https://phabricator.services.mozilla.com/D150008
We're checking animation consumers, not locked status. We don't care
about animation consumer count of non-animated images.
Depends on D137765
Differential Revision: https://phabricator.services.mozilla.com/D137766
Previously with ImageContainers, we would put the new preferred surface
into the ImageContainer. When we check if we should invalidate, it would
have a different image key, and hence invalidate the image frame and
schedule a paint.
With ImageProviders, it returns the same key in this case, because the
ImageProvider represents a particular surface. As such, we need to
actually track when we get a substituted ImageProvider, and invalidate
the image frame more aggressively to ensure we get the preferred size.
Differential Revision: https://phabricator.services.mozilla.com/D132583
This will be used by layers as a replacement for ImageContainer's
ContainerProducerID for tracking if the same imgIRequest/imgIContainer
own the cached WebRenderImageProvider.
Differential Revision: https://phabricator.services.mozilla.com/D126598
In later parts in this series, GetImageProvider will replace
GetImageContainerAtSize. This will be a more specialized and lower
overhead means to get a wr::ImageKey for a particular surface.
Differential Revision: https://phabricator.services.mozilla.com/D126596