RESOLVED FIXED 227745
Use setBooleanAttribute instead of setAttributeWithoutSynchronization(X, Y ? emptyAtom() : nullAtom());
https://bugs.webkit.org/show_bug.cgi?id=227745
Summary Use setBooleanAttribute instead of setAttributeWithoutSynchronization(X, Y ? ...
Tim Nguyen (:ntim)
Reported 2021-07-07 07:54:16 PDT
https://webkit-search.igalia.com/webkit/search?q=emptyAtom%28%29+%3A+nullAtom%28%29%29&path=&case=false&regexp=false In these 2 cases, attribute sync doesn't really add value here. SetBooleanAttribute() is easier to read.
Attachments
Patch (4.11 KB, patch)
2021-07-07 08:19 PDT, Tim Nguyen (:ntim)
no flags
Radar WebKit Bug Importer
Comment 1 2021-07-07 07:54:28 PDT
Radar WebKit Bug Importer
Comment 2 2021-07-07 07:56:30 PDT
Radar WebKit Bug Importer
Comment 3 2021-07-07 07:56:49 PDT
Tim Nguyen (:ntim)
Comment 4 2021-07-07 08:19:33 PDT
EWS
Comment 5 2021-07-07 09:14:24 PDT
Committed r279643 (239456@main): <https://commits.webkit.org/239456@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 433030 [details].
Darin Adler
Comment 6 2021-07-07 12:42:44 PDT
Comment on attachment 433030 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433030&action=review > Source/WebCore/ChangeLog:8 > + It's easier to read and attribute sync doesn't make a difference here (it only does for style & SVG attributes). This comment shows a slight misunderstanding of "without synchronization". The function does not exist so that we can bypass synchronization. It’s an optimized case that saves work when we know the attribute we are setting is not something that can have SVG animation applied to it, nor is the attribute "style". By calling the plain old setAttribute, we are just forgoing a micro-optimization. So a more accurate comment would be more like, "we can do without the slight optimization that we get by calling setAttributeWithoutSynchronization".
Note You need to log in before you can comment on or make changes to this bug.