Bug 1688293 - SVGUseFrame shouldn't invalidate rendering observers from DidSetComputedStyle. r=longsonr

This is unsound. We're restyling, so you're not supposed to post more
restyles and such until we start processing changes. We could make this
specific case work I suppose (because we only post change hints, not
restyles), though turns out this is unneeded because it's redundant, as
nsStyleSVGReset::CalcDifference already returns the right hint when
these properties differ:

  https://searchfox.org/mozilla-central/rev/851bbbd9d9a38c2785a24c13b6412751be8d3253/layout/style/nsStyleStruct.cpp#1022

Differential Revision: https://phabricator.services.mozilla.com/D102976
This commit is contained in:
Emilio Cobos Álvarez 2021-01-25 22:33:41 +00:00
parent ab03cf02dc
commit 504af80ba6
2 changed files with 25 additions and 1 deletions

View File

@ -67,7 +67,6 @@ void SVGUseFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle) {
newSVGReset->mY != oldSVGReset->mY) {
// make sure our cached transform matrix gets (lazily) updated
mCanvasTM = nullptr;
SVGObserverUtils::InvalidateRenderingObservers(this);
SVGUtils::ScheduleReflowSVG(this);
SVGUtils::NotifyChildrenOfSVGChange(this, TRANSFORM_CHANGED);
}

View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<script>
window.addEventListener('load', () => {
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg')
const clip = document.createElementNS('http://www.w3.org/2000/svg', 'clipPath')
const use = document.createElementNS('http://www.w3.org/2000/svg', 'use')
const style = document.createElementNS('http://www.w3.org/2000/svg', 'style')
document.documentElement.appendChild(svg)
svg.setAttribute('id', 'id_0')
clip.appendChild(use)
svg.appendChild(clip)
document.documentElement.appendChild(style)
style.textContent = `
@import url(dom--23104-J7UdNQ5SQ5Rv-.css);
@namespace url(http://www.w3.org/1999/xhtml);
@namespace svg url(http://www.w3.org/2000/svg);
* {
filter: url(#id_0);
}
svg|* {
transition: 352ms ! important;
y: 29%;
}`
})
</script>