Factor out the nsIconChannel symbolic lookup, and expose it to
nsImageRenderer to do the icon look-ups with the right CSS color.
Differential Revision: https://phabricator.services.mozilla.com/D252791
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 just refactors out some commont logic
into a helper (so that we can add another call to this same helper in a later
patch in this series).
Differential Revision: https://phabricator.services.mozilla.com/D248525
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
In modern C++, static constexpr member variables are automatically
inline (aka weak) so the template trick is not needed. This also avoid
duplication and reduces the amount of parsed code. No impact on
generated binary (actually: smaller debuginfo, close to identical
binary).
Differential Revision: https://phabricator.services.mozilla.com/D247825
An SVG image document might declare a negative value for `width` and/or
`height` on the root <svg> node, but we clamp that to be nonnegative for actual
layout purposes, and we should similarly clamp it in the imagelib size getters.
Otherwise we potentially expose bogus values via the web-exposed naturalWidth
and naturalHeight APIs.
Differential Revision: https://phabricator.services.mozilla.com/D248149
In previous editions of the spec, out-of-range values were not
considered. As this is now specified, we should let libpng do the right
thing and not inject non-compliant behavior.
Differential Revision: https://phabricator.services.mozilla.com/D211677
This diff was generated as follows:
List all toml files in the tree:
`find * -name '*.toml' > /tmp/toml`
Manually edited /tmp/toml to drop non-relevant entries (objdir).
Ran the toml linter for all files:
`cat /tmp/toml | xargs ./mach lint -l test-manifest-toml --fix`
Differential Revision: https://phabricator.services.mozilla.com/D240948
This looks like a fairly mild update with some of our local patches
being upstreamed and otherwise reasonably small amounts of code churn.
Differential Revision: https://phabricator.services.mozilla.com/D244290
In bug 1862059 we ensured that every (vector) part of a multipart image got load complete before it was made the current part. This missed the first part because it was never the next part, it just become the current part immediately. This was good enough to fix all cases except where the multipart image reached a finite end point (which would then send the final part load complete and hit the same duplicate final part load complete bug).
Differential Revision: https://phabricator.services.mozilla.com/D241816
In order to clear cache from ChromeUtils.clearResourceCache with variuos
filtering, imgLoader needs a method that are adaptive to the current process,
where in the parent process, clear all processes' cache,
and in the content process, clear the cache in the process.
Refactored the cache methods based on single static method and single IPC
method, this is also necessary to extend the ChromeUtils.clearResourceCache in
bug 1947158.
Differential Revision: https://phabricator.services.mozilla.com/D239138
While much of this is simply converting code (and removing extraneous
`size` parameters), toolkit/xre/GeckoArgs.{h,cpp} has some significant
changes to support sending read-only handles (which is all we need!).
Differential Revision: https://phabricator.services.mozilla.com/D236750
While much of this is simply converting code (and removing extraneous
`size` parameters), toolkit/xre/GeckoArgs.{h,cpp} has some significant
changes to support sending read-only handles (which is all we need!).
Differential Revision: https://phabricator.services.mozilla.com/D236750