Closed Bug 1090936 Opened 10 years ago Closed 10 years ago

Make invalidation of rendering observers async

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: longsonr, Assigned: longsonr)

References

Details

Attachments

(1 file)

Attached patch async.txtSplinter Review
Builds on bug 975757 and converts the remaining InvalidateRenderingObservers calls so all tree crawling is done by the restyle manager
Attachment #8513449 - Flags: review?(jwatt)
Attachment #8513449 - Attachment is patch: true
The SVGFE*Frame and SVGStopFrame changes seem wrong, and I don't think they will pass Try. We only add observers to elements that we obtain via nsSVGRenderingObserver::GetReferencedElement(), right? So observers are only added to the <filter> and <linear/radialGradient> elements.
In nsSVGStopFrame I've got nsSVGEffects::InvalidateDirectRenderingObservers(GetParent()); The parent of the stop frame is the gradient on which we have observers. Similar for the FE*Frame changes.
Assignee: nobody → longsonr
Ah, sorry, I failed to notice that part of the change.
Comment on attachment 8513449 [details] [diff] [review]
async.txt

Review of attachment 8513449 [details] [diff] [review]:
-----------------------------------------------------------------

Looks great, thank you Robert.

::: layout/svg/SVGFEContainerFrame.cpp
@@ +100,5 @@
>                                        int32_t  aModType)
>  {
>    nsSVGFE *element = static_cast<nsSVGFE*>(mContent);
>    if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) {
> +    nsSVGEffects::InvalidateDirectRenderingObservers(GetParent());

I think it's worth adding something like:

  MOZ_ASSERT(GetParent()->GetType() == nsGkAtoms::svgFilterFrame,
             "Observers observe the filter, so that's what we must invalidate");

here and equivalents to the other SVGFE* changes in case the spec/implementation changes to make it possible to fail in this way.

::: layout/svg/nsSVGStopFrame.cpp
@@ +97,5 @@
>                                   int32_t         aModType)
>  {
>    if (aNameSpaceID == kNameSpaceID_None &&
>        aAttribute == nsGkAtoms::offset) {
> +    nsSVGEffects::InvalidateDirectRenderingObservers(GetParent());

Add a similar assert here for nsGkAtoms::svgLinearGradientFrame and nsGkAtoms::svgRadialGradientFrame.
Attachment #8513449 - Flags: review?(jwatt) → review+
https://hg.mozilla.org/mozilla-central/rev/7822514901e6
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Depends on: 975757
No longer blocks: 1532444
Depends on: 1532444
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: