Bug 179982

Summary: Style resolution spin due to calc() values in animations always comparing inequal (seen on arstechnica.com)
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, dino, graouts, malendariel, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
reduction
none
reduction
none
patch none

Antti Koivisto
Reported 2017-11-23 13:08:48 PST
Reduction attached.
Attachments
reduction (249 bytes, text/html)
2017-11-23 13:09 PST, Antti Koivisto
no flags
reduction (363 bytes, text/html)
2017-11-23 13:27 PST, Antti Koivisto
no flags
patch (5.26 KB, patch)
2017-11-24 03:49 PST, Antti Koivisto
no flags
Antti Koivisto
Comment 1 2017-11-23 13:09:36 PST
Created attachment 327513 [details] reduction
Radar WebKit Bug Importer
Comment 2 2017-11-23 13:10:07 PST
Antti Koivisto
Comment 3 2017-11-23 13:27:09 PST
Created attachment 327514 [details] reduction
Antti Koivisto
Comment 4 2017-11-23 13:36:47 PST
Basically something like calc(100% - 10px) compares inequal to itself. This causes the implicit animation engine think that there is a new value after style recalc and restart the transition. Starting the transition triggers style recalc on zero duration timer which restarts the transition and so on.
Antti Koivisto
Comment 5 2017-11-24 03:49:21 PST
Darin Adler
Comment 6 2017-11-24 11:22:30 PST
Comment on attachment 327538 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=327538&action=review > Source/WebCore/platform/CalculationValue.cpp:130 > + // Maybe Vectors of unique_ptrs should always do deep compare? VectorTypeOperations exists so that we can do that kind of thing. It looks like we never specialized VectorTypeOperations, though, so I’m not entirely sure why we have it! > Source/WebCore/platform/CalculationValue.cpp:134 > + if (!(*a.children()[i] == *b.children()[i])) Could use a != b instead of !(a == b)
Antti Koivisto
Comment 7 2017-11-24 12:56:08 PST
> VectorTypeOperations exists so that we can do that kind of thing. It looks > like we never specialized VectorTypeOperations, though, so I’m not entirely > sure why we have it! This more in the realm of VectorComparer. We could easily add a deep compare vector trait if we think that is a good idea. I can't really see any cases where pointer-comparing unique_ptr vectors would be correct. On the other hand it might be surprising that ptr vector and unique_ptr vector behave differently in default comparisons. > Could use a != b instead of !(a == b) Yes, after adding it. I'll keep this patch minimal for easy integration.
WebKit Commit Bot
Comment 8 2017-11-24 13:15:58 PST
Comment on attachment 327538 [details] patch Clearing flags on attachment: 327538 Committed r225141: <https://trac.webkit.org/changeset/225141>
WebKit Commit Bot
Comment 9 2017-11-24 13:15:59 PST
All reviewed patches have been landed. Closing bug.
Antti Koivisto
Comment 10 2017-12-14 01:58:30 PST
*** Bug 180733 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.