Summary:
The implementations of most SVGTextElement methods flush layout when they're
called. Any SVG <text> that is displayed normally will be reflowed by
SVGTextFrame::ReflowSVG, and any <text> that is in displayed SVG but is not
displayed directly (such as <text> under a <defs>) will be reflowed by
SVGTextFrame::ReflowSVGNonDisplayText. Prior to this fix the changed
code always assumed that one of these methods would reflow the text. However,
in the case that the SVG is under an HTML element that isn't itself ever
reflowed (such as if it's under an HTML <caption>) then the SVG text will
not be reflowed either and the invariants of the code are broken.
This patch modifies the functions that implement the SVGTextElement
methods to return an error code if the text has not been reflowed.
Note: I did try to reuse SVGTextFrame::ReflowSVGNonDisplayText in this
case, but I ran into problems. Given that this is an edge case and likely one
than normal authors will never run into I gave up trying to make that work for
now.
Reviewers: heycam
Bug #: 1402109
Differential Revision: https://phabricator.services.mozilla.com/D107
(Path is actually r=froydnj.)
Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.
MozReview-Commit-ID: 91U22X2NydP
--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
After StyleBasicShape is set to StyleShapeSource, it's life cycle never go
beyond StyleShapeSource, so I make StyleBasicShape hold by a UniquePtr in
StyleShapeSource.
Also, replace all raw pointers to StyleBasicShape by UniquePtr in all APIs.
MozReview-Commit-ID: 1MfIFjP8TsQ
--HG--
extra : rebase_source : bdbbd47de57e0bc610e37913752ab8413f62588a
mTargetFrame is not a correct one, we should check the SVGStyle of 'frame'
object.
MozReview-Commit-ID: 3UNfbXkICkz
--HG--
extra : amend_source : 9fa5f095881fc3b92329a7d187f4d5926c43fed7
Now we no longer post InvalidateRenderingObservers change hint during post
traversal.
MozReview-Commit-ID: H3jJ1LKgJyV
--HG--
extra : rebase_source : 96d6bf77e6fc2b4b79882e5c7e5f43e087b56089
If the frame has opacity animation, we can't optimize it at all.
MozReview-Commit-ID: JQYiPvSaxEs
--HG--
extra : rebase_source : b344b56793ba93ac2f763a6cc7f16edcf06e8f7a
Both nsSVGMarkerProperty::DoUpdate and nsSVGPaintingProperty::DoUpdate call
nsSVGRenderingObserverProperty::DoUpdate which takes care of posting the
nsChangeHint_InvalidateRenderingObservers change hint. There is no need for
these methods to do that again.
nsReflowStatus::IsEmpty() assertions are added after DISPLAY_REFLOW in the
beginning of the Reflow().
A few Reflow() implementations have Reset() calls at the end which are left
in place by this patch (with an explanatory comment added to each). These
ending Reset()s are only needed for cases where a non-splittable frame
passes its own nsReflowStatus to a child's reflow method. Just in case the
child leaves a "not fully complete" value in the nsReflowStatus, the
non-splittable parent frame must clear out the nsReflowStatus before
returning, so that its own parent doesn't then try to split it.
MozReview-Commit-ID: 6Jj3jfMAqj4
--HG--
extra : rebase_source : e1fe6a775ad97e16a6d7cc224634ff962ccb0fbf
There are two callers of nsFilterInstance::PaintFilteredFrame:
1. nsSVGUtils::PaintFrameWithEffects at [1]
This function is used while painting a filtered element on a path which
display item painting is not supported yet, such as drawing elements inside a
indirect painted SVG object, such as a mask, a clipPath or a gradient object.
Let's say we have a masked element, which refers to an SVG mask, and there is
a filtered element inside that SVG mask.
Using nsFilterInstance::PaintFilteredFrame to paint that filtered frame in
the mask, we have to pass a gfxContext and a transform matrix to it. The
transform of the gfxContext 'target' that we pass in consists of a transform
from the referenced frame, of the masked frame, to the masked frame. We also
pass in a transform matrix 'aTransform', this matrix contains a transform
from the the masked frame to the filtered frame in *device units*, which
means it contains css-to-dev-px scaling factor.
2. nsSVGIntegrationUtils::PaintFilter at [2]
This function is used by normal display item painting.
The same, we pass a gfxContext 'context' and a transform matrix 'tm' into
nsFilterInstance::PaintFilteredFrame. The transform matrix of 'context'
consists of a transform from the referenced frame, of the filtered frame,
to this filtered frame, but the scale factor was taken out . The transform
matrix 'tm' we pass in contains scale transform from the referenced frame to
the filtered frame in *device unit*.
Inside nsFilterInstance::PaintFilteredFrame, we treat the transform matrix of
'aCtx' and 'aTransform' as parameters we pass in in #2 caller. So it can be
failed in #1. For example, if the filtered frame inside a masked frame has a
translation transform applied, since that translation was put in 'aTransfrom',
but we only use the scale factor of 'aTransform' in
nsFilterInstance::PaintFilteredFrame, translation factor disappears.
In this patch, I unified the definition of parameters of
nsFilterInstance::PaintFilteredFrame:
1. nsFilterInstance::PaintFilteredFrame(aCtx): the transform matrix of aCtx
should be a transform from the referenced frame to the filtered frame in
*css units*. Originally, the aCtx we passed in #1 is in device units, which
should be fixed; the aCtx we passed in #2 does not even include css scaling
factor, need be fixed too.
2. nsFilterInstance::PaintFilteredFrame(aTransform): this transform matrix
should contain only scaling factor in device units. And I removed it in the
end since I found we can get this value easily right inside the callee.
[1]
https://hg.mozilla.org/mozilla-central/file/ef585ac7c476/layout/svg/nsSVGUtils.cpp#l857
[2]
https://hg.mozilla.org/mozilla-central/file/ef585ac7c476/layout/svg/nsSVGIntegrationUtils.cpp#l1114
MozReview-Commit-ID: gRV128NyQv
--HG--
extra : rebase_source : 15d130babd07734c3c36e24e9ea8b5c4e5f7dbbf
This change makes the next patch free of doing Matrix to gfxMatrix conversion.
MozReview-Commit-ID: 8K9RNgjZPTw
--HG--
extra : rebase_source : 190a80c2580622b7866ddb4d80a161311e97a2f5