Closed Bug 908880 Opened 11 years ago Closed 11 years ago

Overflow rect is not updated when assigning a filter dynamically

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(3 files, 1 obsolete file)

Attached image testcase
Similar to bug 879682, but with a filter that's added dynamically to an already existing element.
Attachment #794863 - Attachment mime type: text/html → image/svg+xml
Attached patch v1Splinter Review
FinishAndStoreOverflow wasn't called on the frame. Sending nsChangeHint_UpdateOverflow calls it.
Attachment #794866 - Flags: review?(jwatt)
Comment on attachment 794866 [details] [diff] [review]
v1

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

Thanks!

::: layout/style/nsStyleStruct.cpp
@@ +1153,5 @@
>    if (!EqualURIs(mClipPath, aOther.mClipPath) ||
>        !EqualURIs(mMask, aOther.mMask) ||
>        mFilters != aOther.mFilters) {
>      NS_UpdateHint(hint, nsChangeHint_UpdateEffects);
> +    NS_UpdateHint(hint, nsChangeHint_UpdateOverflow);

Can you tack on:

 // for filters only

to this new line?
Attachment #794866 - Flags: review?(jwatt) → review+
If we have a hint for filters only then it should be for filters only shouldn't it i.e.

if (mFilters != aOther.mFilters) {
    NS_UpdateHint(hint, nsChangeHint_UpdateOverflow);
}

if (!EqualURIs(mClipPath, aOther.mClipPath) ||
    !EqualURIs(mMask, aOther.mMask) ||
    mFilters != aOther.mFilters) {
    NS_UpdateHint(hint, nsChangeHint_UpdateEffects);
    NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
}
I agree, I'll make that change when I land again.
The assertion is:

###!!! ASSERTION: CalcDifference() returned bigger hint than MaxDifference(): 'NS_IsHintSubset( thisSVGReset->CalcDifference(*otherSVGReset), nsStyleSVGReset::MaxDifference())', file e:/builds/moz2_slave/m-in-w32-d-0000000000000000000/build/layout/style/nsStyleContext.cpp, line 483
You need to update this line:

http://mxr.mozilla.org/mozilla-central/source/layout/style/nsStyleStruct.h#2348

So that nsChangeHint_UpdateOverflow is allowed.
Depends on: 908993
So it turns out that this failure was not an issue with the patch but with the build which did not recompile nsStyleContext.cpp. I filed bug 908993 on that.
Attached patch v2 (obsolete) — Splinter Review
New patch with the change requested in comment 5.
Attachment #794866 - Attachment is obsolete: true
Comment on attachment 795025 [details] [diff] [review]
v2

I'll open a new bug for this.
Attachment #795025 - Attachment is obsolete: true
This did land on central as part of https://hg.mozilla.org/mozilla-central/rev/48a3aeb26ed6
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Depends on: 911310
This fixed bug 886883.
Blocks: 886883
Requesting approval for beta (v25) based on the fact that this fixed tracking-25+ bug 886883.

This is a minimal version of the patch for this bug, plus the tweak made as a follow-up in bug 911310.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 875037 
User impact if declined: Firebug needs to keep their workaround for bug 886883.
Testing completed (on m-c, etc.): baked on nightly and aurora
Risk to taking this patch (and alternatives if risky): very low
String or IDL/UUID changes made by this patch: none
Attachment #816870 - Flags: review+
Attachment #816870 - Flags: approval-mozilla-beta?
Comment on attachment 816870 [details] [diff] [review]
patch for beta (v25)

Sadly, too late in the cycle to take a non-critical fix.
Attachment #816870 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: