summaryrefslogtreecommitdiff
path: root/layout
diff options
context:
space:
mode:
authorFranklinDM <mrmineshafter17@gmail.com>2023-02-25 02:02:59 +0800
committerFranklinDM <mrmineshafter17@gmail.com>2023-02-25 11:27:53 +0800
commita28ce48a161f421d8c39b7acbbe1f2a820db18a7 (patch)
tree9a6b4b674530e3c585e60d4c287b904d227da676 /layout
parentfc408bf1e2574e0ec651450756699e855ce75309 (diff)
downloaduxp-a28ce48a161f421d8c39b7acbbe1f2a820db18a7.tar.gz
Issue #1382 - Part 1: Remove assertion that GetPreEffectsVisualOverflowRect is called only by frames whose parent is an anonymous block
This is always hit if an SVG effect is applied on other frame types. Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1340257
Diffstat (limited to 'layout')
-rw-r--r--layout/svg/nsSVGIntegrationUtils.cpp50
1 files changed, 14 insertions, 36 deletions
diff --git a/layout/svg/nsSVGIntegrationUtils.cpp b/layout/svg/nsSVGIntegrationUtils.cpp
index 4ce2941d49..b8440cc455 100644
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -79,42 +79,20 @@ private:
if (r) {
return *r;
}
- // Despite the fact that we're invoked for frames with SVG effects applied,
- // we can actually get here. All continuations and IB split siblings of a
- // frame with SVG effects applied will have the PreEffectsBBoxProperty
- // property set on them. Therefore, the frames that are passed to us will
- // always have that property set...well, with one exception. If the frames
- // for an element with SVG effects applied have been subject to an "IB
- // split", then the block frame(s) that caused the split will have been
- // wrapped in anonymous, inline-block, nsBlockFrames of pseudo-type
- // nsCSSAnonBoxes::mozAnonymousBlock. These "IB split sibling" anonymous
- // blocks will have the PreEffectsBBoxProperty property set on them, but
- // they will never be passed to us. Instead, we'll be passed the block
- // children that they wrap, which don't have the PreEffectsBBoxProperty
- // property set on them. This is actually okay. What we care about is
- // collecting the _pre_ effects visual overflow rects of the frames to
- // which the SVG effects have been applied. Since the IB split results in
- // any overflow rect adjustments for transforms, effects, etc. taking
- // place on the anonymous block wrappers, the wrapped children are left
- // with their overflow rects unaffected. In other words, calling
- // GetVisualOverflowRect() on the children will return their pre-effects
- // visual overflow rects, just as we need.
- //
- // A couple of tests that demonstrate the IB split and cause us to get here
- // are:
- //
- // * reftests/svg/svg-integration/clipPath-html-06.xhtml
- // * reftests/svg/svg-integration/clipPath-html-06-extref.xhtml
- //
- // If we ever got passed a frame with the PreTransformOverflowAreasProperty
- // property set, that would be bad, since then our GetVisualOverflowRect()
- // call would give us the post-effects, and post-transform, overflow rect.
- //
- NS_ASSERTION(aFrame->GetParent()->StyleContext()->GetPseudo() ==
- nsCSSAnonBoxes::mozAnonymousBlock,
- "How did we getting here, then?");
- NS_ASSERTION(!aFrame->GetProperty(aFrame->PreTransformOverflowAreasProperty()),
- "GetVisualOverflowRect() won't return the pre-effects rect!");
+#ifdef DEBUG
+ // Having PreTransformOverflowAreasProperty cached means
+ // GetVisualOverflowRect() will return post-effect rect, which is not what
+ // we want. This function intentional reports pre-effect rect. But it does
+ // not matter if there is no SVG effect on this frame, since no effect
+ // means post-effect rect matches pre-effect rect.
+ if (nsSVGIntegrationUtils::UsingEffectsForFrame(aFrame)) {
+ nsOverflowAreas* preTransformOverflows =
+ aFrame->GetProperty(aFrame->PreTransformOverflowAreasProperty());
+
+ NS_ASSERTION(!preTransformOverflows,
+ "GetVisualOverflowRect() won't return the pre-effects rect!");
+ }
+#endif
return aFrame->GetVisualOverflowRect();
}