Bug 225366 - Removing the transform CSS property from the SVG element does not cause invalidation
Summary: Removing the transform CSS property from the SVG element does not cause inval...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: Safari 14
Hardware: Mac (Intel) macOS 11
: P2 Minor
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-04 14:29 PDT by Pavel Panchekha
Modified: 2021-05-12 13:14 PDT (History)
17 users (show)

See Also:


Attachments
Minimized test case that reproduces the bug (248 bytes, text/html)
2021-05-04 14:29 PDT, Pavel Panchekha
no flags Details
Patch (3.78 KB, patch)
2021-05-12 00:59 PDT, Said Abou-Hallawa
simon.fraser: review+
Details | Formatted Diff | Diff
Patch (3.92 KB, patch)
2021-05-12 10:54 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].