Bug 225366

Summary: Removing the transform CSS property from the SVG element does not cause invalidation
Product: WebKit Reporter: Pavel Panchekha <me>
Component: SVGAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Minor CC: bfulgham, changseok, dino, esprehn+autocc, ews-watchlist, fmalita, glenn, gyuyoung.kim, kondapallykalyan, pdr, sabouhallawa, schenney, sergio, simon.fraser, webkit-bug-importer, zalan, zimmermann
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Mac (Intel)   
OS: macOS 11   
Attachments:
Description Flags
Minimized test case that reproduces the bug
none
Patch
simon.fraser: review+
Patch none

Description Pavel Panchekha 2021-05-04 14:29:05 PDT
Created attachment 427700 [details]
Minimized test case that reproduces the bug

When an SVG "transform" property is changed on two tested SVG elements, the Webkit layout engine (in Safari 14.1) does not fully update the layout.

Consider the attached test file. It uses a CSS `max-width` media query to trigger a change to the `transform` property of an SVG `text` element; in a window narrow than 800px, part of the `text` is offscreen, while in a wider window none of it is. If you start with a wide window (the whole text is onscreen), resize the screen to narrow it (so that part of it is offscreen), and then widen again, the text stays partially offscreen. The same works in reverse. You can confirm that this is an underinvalidation bug by starting wide, narrowing, and then refreshing. The refresh changes the layout of the page—it triggers a from-scratch layout pass which circumvents underinvalidation bugs.

I've confirmed that the issue is absent in Firefox (88) and Chrome (90) on macOS.
Comment 1 Radar WebKit Bug Importer 2021-05-11 14:30:21 PDT
<rdar://problem/77864563>
Comment 2 Said Abou-Hallawa 2021-05-12 00:59:25 PDT
Created attachment 428355 [details]
Patch
Comment 3 Said Abou-Hallawa 2021-05-12 10:54:23 PDT
Created attachment 428384 [details]
Patch
Comment 4 Said Abou-Hallawa 2021-05-12 10:56:56 PDT
(In reply to Said Abou-Hallawa from comment #3)
> Created attachment 428384 [details]
> Patch

I forgot to add waitUntilDone() and notifyDone() in the layout test. Because the test requires two page updates, this would have made the test flaky.
Comment 5 EWS 2021-05-12 13:14:03 PDT
Committed r277385 (237641@main): <https://commits.webkit.org/237641@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 428384 [details].