forked from mirrors/gecko-dev
Bug 1696505 - stop SVG text reflows triggering other reflows r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D158912
This commit is contained in:
parent
96027ba774
commit
61f0b7afb7
4 changed files with 13 additions and 6 deletions
|
|
@ -530,6 +530,9 @@ void SVGMarkerObserver::OnRenderingChange() {
|
||||||
MOZ_ASSERT(frame->IsFrameOfType(nsIFrame::eSVG), "SVG frame expected");
|
MOZ_ASSERT(frame->IsFrameOfType(nsIFrame::eSVG), "SVG frame expected");
|
||||||
|
|
||||||
// Don't need to request ReflowFrame if we're being reflowed.
|
// Don't need to request ReflowFrame if we're being reflowed.
|
||||||
|
// Because mRect for SVG frames includes the bounds of any markers
|
||||||
|
// (see the comment for nsIFrame::GetRect), the referencing frame must be
|
||||||
|
// reflowed for any marker changes.
|
||||||
if (!frame->HasAnyStateBits(NS_FRAME_IN_REFLOW)) {
|
if (!frame->HasAnyStateBits(NS_FRAME_IN_REFLOW)) {
|
||||||
// XXXjwatt: We need to unify SVG into standard reflow so we can just use
|
// XXXjwatt: We need to unify SVG into standard reflow so we can just use
|
||||||
// nsChangeHint_NeedReflow | nsChangeHint_NeedDirtyReflow here.
|
// nsChangeHint_NeedReflow | nsChangeHint_NeedDirtyReflow here.
|
||||||
|
|
|
||||||
|
|
@ -2848,12 +2848,6 @@ void SVGTextFrame::ReflowSVGNonDisplayText() {
|
||||||
// time it is painted, we reflow the anonymous block frame.
|
// time it is painted, we reflow the anonymous block frame.
|
||||||
this->MarkSubtreeDirty();
|
this->MarkSubtreeDirty();
|
||||||
|
|
||||||
// We also need to call InvalidateRenderingObservers, so that if the <text>
|
|
||||||
// element is within a <mask>, say, the element referencing the <mask> will
|
|
||||||
// be updated, which will then cause this SVGTextFrame to be painted and
|
|
||||||
// in doing so cause the anonymous block frame to be reflowed.
|
|
||||||
SVGObserverUtils::InvalidateRenderingObservers(this);
|
|
||||||
|
|
||||||
// Finally, we need to actually reflow the anonymous block frame and update
|
// Finally, we need to actually reflow the anonymous block frame and update
|
||||||
// mPositions, in case we are being reflowed immediately after a DOM
|
// mPositions, in case we are being reflowed immediately after a DOM
|
||||||
// mutation that needs frame reconstruction.
|
// mutation that needs frame reconstruction.
|
||||||
|
|
|
||||||
9
layout/svg/crashtests/1696505.html
Normal file
9
layout/svg/crashtests/1696505.html
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
document.getElementById('a').style.cssText += "grid-row-end:auto"
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<svg>
|
||||||
|
<polyline marker-mid='url(#a)'/>
|
||||||
|
<marker id='a'>
|
||||||
|
<text/>
|
||||||
|
|
@ -239,6 +239,7 @@ load 1609663.html
|
||||||
skip-if(Android) load 1671950.html # No print-preview support on android
|
skip-if(Android) load 1671950.html # No print-preview support on android
|
||||||
load 1678947.html
|
load 1678947.html
|
||||||
load 1693032.html
|
load 1693032.html
|
||||||
|
load 1696505.html
|
||||||
load 1758029-1.html
|
load 1758029-1.html
|
||||||
HTTP load 1755770-1.html
|
HTTP load 1755770-1.html
|
||||||
HTTP load 1755770-2.html
|
HTTP load 1755770-2.html
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue