This problem was introduced by bug 1756197. The old code checked
for null before setting the path that was implicitly used by the fill.
This null check is retained at the other usage of
CreateClipPathForFrame()
Differential Revision: https://phabricator.services.mozilla.com/D144477
Make Link and SVGAElement agree on XLink handling, and make it more
explicit that SVGAElement needs to be a bit more special for SMIL.
Remove dead MathML XLink code.
Differential Revision: https://phabricator.services.mozilla.com/D142546
In bug 1758942 there was a bit of clipping logic for webrenderized svg images that was removed because we didn't know what it was useful for.
I still don't quite know, other than that it caused layout/reftests/svg/image/image-preserveAspectRatio-01-raster.svg and layout/reftests/svg/image/image-preserveAspectRatio-02-raster.svg to start failing when the gfx.webrender.svg-images pref is enabled, so let's revert it.
Depends on D141847
Differential Revision: https://phabricator.services.mozilla.com/D141848
The missing line is consistently called after ImageContainer::GetWidth/GetHeight (see TransformContextForPainting for example which would be the equivalent code path for the non-webrenderized case).
This fixes the wptest /density-size-correction/density-corrected-image-svg.html when active svg images are enabled.
Depends on D141846
Differential Revision: https://phabricator.services.mozilla.com/D141847
I wrote the previous code via trial and error by copying similar code without understanding much what the different values represent.
The result looks about right but I suspect it may be only right because of simplifying assumptions.
Differential Revision: https://phabricator.services.mozilla.com/D140726
We don't currently check whether the geometry has markers, nor do we try to render them properly with WebRender display items.
This is caught by the reftest paint-order-001.svg when active SVG images and rects are enabled.
Differential Revision: https://phabricator.services.mozilla.com/D140808
Previously, if ctx->GetDrawTarget() != maskTarget we end up adjusting the
matrix on ctx and not on the maskTarget.
Also, now that we're doing the correct adjustment of the maskTarget transform
we can remove code to set maskTarget's transform to identity.
Differential Revision: https://phabricator.services.mozilla.com/D139133
This avoids having to rasterize the path twice. Once for the clip path and once for
the fill. It will also give us correct antialiasing on the edges.
Differential Revision: https://phabricator.services.mozilla.com/D139137
We need them for SVG primitives.
This patch adds a bit of plumbing to disable snapping some of the primitives and forcing the antialiasing shader feature where needed, and uses it for SVG solid rectangles and images.
Differential Revision: https://phabricator.services.mozilla.com/D139024
Previously, we mostly went to the effort of setting the extra tranform to the
inverse of the context transform except for a case in PaintMask which really
didn't make any sense.
Differential Revision: https://phabricator.services.mozilla.com/D139148
This avoids creating a very large intermediate target if we're using
a RecordingDrawTarget and will properly add an offset if the underlying
DrawTarget has one.
Differential Revision: https://phabricator.services.mozilla.com/D137358
Below are the build errors fixed here.
layout/svg/SVGFEUnstyledLeafFrame.cpp:75:33: error: no type named 'SVGFEUnstyledElement' in namespace 'mozilla::dom'
* Fixed this by including SVGFilters.h (which defines this type).
layout/svg/SVGFEContainerFrame.cpp:83:12: error: unknown type name 'SVGFE'; did you mean 'dom::SVGFE'?
layout/svg/SVGFELeafFrame.cpp:80:12: error: unknown type name 'SVGFE'; did you mean 'dom::SVGFE'?
* Fixed these with a 'using' statement for the namespace.
layout/svg/SVGGFrame.cpp:34:32: error: unknown type name 'SVGElement'
* Fixed by including this type's header.
layout/svg/FilterInstance.cpp:873:9: error: use of undeclared identifier 'nsLayoutUtils'
layout/svg/SVGOuterSVGFrame.cpp:623:29: error: incomplete type 'nsLayoutUtils' named in nested name specifier
layout/svg/SVGUseFrame.cpp:84:5: error: use of undeclared identifier 'nsLayoutUtils
layout/svg/SVGViewportFrame.cpp:207:9: error: use of undeclared identifier 'nsLayoutUtils'
* Fixed these by including this header.
layout/svg/SVGOuterSVGFrame.cpp:88:20: error: unused function 'DependsOnIntrinsicSize' [-Werror,-Wunused-function]
* Fixed by removing the unused function.
layout/svg/SVGStopFrame.cpp:86:21: error: unknown type name 'SVGGradientFrame'
* Fixed this by including this header.
Differential Revision: https://phabricator.services.mozilla.com/D138187
Previously, we would get the wrong bounds on HiDPI displays.
This matches what's done in ComputeClipForMaskItem and makes things a bit
more explicit by using typed units.
Differential Revision: https://phabricator.services.mozilla.com/D137880
This makes TransformPoint and TransformRect deal with SVG text
correctly. We need TransformPoint support so that GeometryUtils works as
expected, since we need to transform the points individually so that
stuff like transforms report the expected result (a rect doesn't cut it
for those).
Differential Revision: https://phabricator.services.mozilla.com/D135152
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
Annotating each test individually lets us avoid introducing new failing tests
while we go through the backlog of failing tests.
Depends on D129162
Differential Revision: https://phabricator.services.mozilla.com/D129163
Annotating each test individually lets us avoid introducing new failing tests
while we go through the backlog of failing tests.
Depends on D129162
Differential Revision: https://phabricator.services.mozilla.com/D129163
Currently we're falling back when hitting an uninitialized filter (e.g. a bad
url) and the fallback path just draws nothing. We can do that just as well by
drawing nothing ourselves.
Differential Revision: https://phabricator.services.mozilla.com/D130281
In SVGImageFrame::PaintSVG, we may attempt to draw an incomplete image.
In that case it will draw what it can, and display more as we
invalidate. We should do the same on the ::CreateWebRenderCommands path.
Differential Revision: https://phabricator.services.mozilla.com/D129264