Closed Bug 1535040 Opened 1 year ago Closed 1 year ago

SVG Text is still painted, with dynamically-assigned attribute `opacity='0'`

Categories

(Core :: Web Painting, defect, P3)

67 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla68
Tracking Status
firefox-esr60 --- unaffected
firefox66 --- wontfix
firefox67 --- verified
firefox68 --- verified

People

(Reporter: aswiseman, Assigned: miko)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0

Steps to reproduce:

Visit https://625.uk.com/tv_logos/svg/stv_74.asp
Click on the main image (black rectangle) to pause animation
Click again to resume animation

Actual results:

When clicking on image to pause, the message "PAUSED - click or tap to resume playback" appears. When clicking again, the message remains on screen.

Expected results:

When clicking on image to pause, the message "PAUSED - click or tap to resume playback" appears. But in all other browsers (including standard Firefox) when clicking again, the message disappears.

I can reproduce the bug with this test case (just click on the green square):

<html>
  <svg width="400" height="300">
    <text id="paused" opacity="0" x="0" y="150" fill="black">PAUSED - click or tap to resume playback</text>
    <rect id="rect" width="100" height="100" fill="green" x="0" y="0"/>
  </svg>

  <script>
    paused = false;
    window.onload = function() {
        document.getElementById("rect").addEventListener("click", click_handler, false);
    }

    function click_handler() {
        var elt = document.getElementById("paused");
        paused = !paused;
        var opacity = paused ? 1 : 0;
        elt.setAttribute("opacity", opacity);
    }

  </script>
</html>

In using mozregression, I get:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=87219897a280cfc756aa1cf883324512285fdd74&tochange=35dc9703f35828c01e960e5d1e52fc96620afd85

:miko, could you investigate please ?

Blocks: 1512244
Has Regression Range: --- → yes
Has STR: --- → yes
Component: Untriaged → Web Painting
Flags: needinfo?(mikokm)
Keywords: regression
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Summary: [Win10 x64] [Developer Edition] SVG Text isn't removed in Firefox Developer Edition → SVG Text is still painted, with dynamically-assigned attribute `opacity='0'`

I can reproduce in latest Linux Nightly, BTW.

OS: Unspecified → All
Hardware: Unspecified → All
Assignee: nobody → mikokm
Status: NEW → ASSIGNED
Flags: needinfo?(mikokm)

It seems this bug is caused by removal of (child->GetStateBits() & NS_FRAME_MAY_BE_TRANSFORMED) && child->IsFrameOfType(nsIFrame::eSVG)
condition that was returning AGR_MAYBE from AutoBuildingDisplayList::MaybeAnimatedGeometryRoot(), before I removed this requirement for fast-path in bug 1512244 (and removed the function in bug 1526957).

The root cause seems to be that opacity change does not invalidate the SVGText frame.

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68

This is a recent (66) regression that affects 67, Miko would that patch be safe to uplift to beta?

Flags: needinfo?(mikokm)

(In reply to Pascal Chevrel:pascalc from comment #6)

This is a recent (66) regression that affects 67, Miko would that patch be safe to uplift to beta?

Yes, it should be safe. I actually meant to request this but forgot, thank you for the reminder.

Flags: needinfo?(mikokm)

Comment on attachment 9051570 [details]
Bug 1535040 - Exclude some SVG frames from DL building fast-path r=mattwoodrow

Beta/Release Uplift Approval Request

  • Feature/Bug causing the regression: Bug 1512244
  • User impact if declined: SVG elements on web page might not update correctly, if their opacity or transform changes dynamically.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The patch restores the previous behavior for SVG frames, which has been around for years.
  • String changes made/needed:
Attachment #9051570 - Flags: approval-mozilla-beta?
No longer blocks: 1512244
Regressed by: 1512244

Comment on attachment 9051570 [details]
Bug 1535040 - Exclude some SVG frames from DL building fast-path r=mattwoodrow

Low risk patch for a recent SVG regression affecting 67, approved for 67 beta 8, thanks.

Attachment #9051570 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

Issue was reproduced on 68.0a1 Nightly build from (2019-03-19).
Verified as fixed on Beta 67.0b8-build2 and Nightly 68.0a1 (2019-04-04) with Windows 10x64, MacOS 13.0.6 and Ubuntu 14.04.

Flags: qe-verify+
Blocks: 1547371
You need to log in before you can comment on or make changes to this bug.