Changeset 265098 in webkit
- Timestamp:
- Jul 30, 2020 2:51:39 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r265093 r265098 1 2020-07-30 Antoine Quint <graouts@webkit.org> 2 3 [ iOS ] webanimations/accelerated-animation-with-easing.html is still flaky 4 https://bugs.webkit.org/show_bug.cgi?id=214327 5 <rdar://problem/65569237> 6 7 Reviewed by Dean Jackson. 8 9 Remove the flaky expectation and remove the extra tolerance added in r263761 when it was thought that 10 this test was merely flaky and not completely broken on iOS as it turned out to be. 11 12 * platform/ios-wk2/TestExpectations: 13 * webanimations/accelerated-animation-with-easing.html: 14 1 15 2020-07-30 Kenneth Russell <kbr@chromium.org> 2 16 -
trunk/LayoutTests/platform/ios-wk2/TestExpectations
r265063 r265098 1773 1773 webkit.org/b/214322 [ Debug ] http/tests/workers/worker-importScripts-banned-mimetype.html [ Pass Crash ] 1774 1774 1775 webkit.org/b/214327 webanimations/accelerated-animation-with-easing.html [ Pass ImageOnlyFailure ]1776 1777 1775 webkit.org/b/214363 [ Debug ] fast/text-indicator/text-indicator-empty-link.html [ Pass Crash ] 1778 1776 -
trunk/LayoutTests/webanimations/accelerated-animation-with-easing.html
r263761 r265098 17 17 /* Allow for a 1px error on either side */ 18 18 #easing-on-keyframe { 19 left: - 2px;20 width: 10 4px;19 left: -1px; 20 width: 102px; 21 21 background-color: green; 22 22 } -
trunk/Source/WebKit/ChangeLog
r265095 r265098 1 2020-07-30 Antoine Quint <graouts@webkit.org> 2 3 [ iOS ] webanimations/accelerated-animation-with-easing.html is still flaky 4 https://bugs.webkit.org/show_bug.cgi?id=214327 5 <rdar://problem/65569237> 6 7 Reviewed by Dean Jackson. 8 9 When we fixed bug 213495 in r263506, we started calling PlatformCAAnimation::setTimingFunction() 10 to set the animation-wide timing function of CSS Animations and JS-originated animations alike. 11 However, we neglected to update PlatformCAAnimationRemote, used on iOS, to be able to handle 12 both animation-wide timing functions as well as keyframe-specific timing functions. This patch 13 adds a new "timingFunction" member to PlatformCAAnimationRemote::Properties to allow for this 14 and this new member is used in setTimingFunction() and copyTimingFunctionFrom(). Finally, after 15 the animation is decoded in the UI process, we call -[CAKeyframeAnimation setTimingFunction:] 16 inside addAnimationToLayer() to use this animation-wide timing function. 17 18 This fixes the test added originally in r263506 which would only work flakily, a symptom of this 19 missing implementation on iOS. 20 21 * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h: 22 * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: 23 (WebKit::encodeTimingFunction): 24 (WebKit::decodeTimingFunction): 25 (WebKit::PlatformCAAnimationRemote::Properties::encode const): 26 (WebKit::PlatformCAAnimationRemote::Properties::decode): 27 (WebKit::PlatformCAAnimationRemote::setTimingFunction): 28 (WebKit::PlatformCAAnimationRemote::copyTimingFunctionFrom): 29 (WebKit::addAnimationToLayer): 30 (WebKit::operator<<): 31 1 32 2020-07-30 Jer Noble <jer.noble@apple.com> 2 33 -
trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h
r262933 r265098 277 277 PlatformCAAnimation::FillModeType fillMode; 278 278 PlatformCAAnimation::ValueFunctionType valueFunction; 279 RefPtr<WebCore::TimingFunction> timingFunction; 279 280 280 281 bool autoReverses; -
trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm
r264006 r265098 154 154 } 155 155 156 static void encodeTimingFunction(IPC::Encoder& encoder, TimingFunction* timingFunction) 157 { 158 switch (timingFunction->type()) { 159 case TimingFunction::LinearFunction: 160 encoder << *static_cast<LinearTimingFunction*>(timingFunction); 161 break; 162 163 case TimingFunction::CubicBezierFunction: 164 encoder << *static_cast<CubicBezierTimingFunction*>(timingFunction); 165 break; 166 167 case TimingFunction::StepsFunction: 168 encoder << *static_cast<StepsTimingFunction*>(timingFunction); 169 break; 170 171 case TimingFunction::SpringFunction: 172 encoder << *static_cast<SpringTimingFunction*>(timingFunction); 173 break; 174 } 175 } 176 177 static Optional<RefPtr<TimingFunction>> decodeTimingFunction(IPC::Decoder& decoder) 178 { 179 TimingFunction::TimingFunctionType type; 180 if (!decoder.decode(type)) 181 return WTF::nullopt; 182 183 RefPtr<TimingFunction> timingFunction; 184 switch (type) { 185 case TimingFunction::LinearFunction: 186 timingFunction = LinearTimingFunction::create(); 187 if (!decoder.decode(*static_cast<LinearTimingFunction*>(timingFunction.get()))) 188 return WTF::nullopt; 189 break; 190 191 case TimingFunction::CubicBezierFunction: 192 timingFunction = CubicBezierTimingFunction::create(); 193 if (!decoder.decode(*static_cast<CubicBezierTimingFunction*>(timingFunction.get()))) 194 return WTF::nullopt; 195 break; 196 197 case TimingFunction::StepsFunction: 198 timingFunction = StepsTimingFunction::create(); 199 if (!decoder.decode(*static_cast<StepsTimingFunction*>(timingFunction.get()))) 200 return WTF::nullopt; 201 break; 202 203 case TimingFunction::SpringFunction: 204 timingFunction = SpringTimingFunction::create(); 205 if (!decoder.decode(*static_cast<SpringTimingFunction*>(timingFunction.get()))) 206 return WTF::nullopt; 207 break; 208 } 209 210 return timingFunction; 211 } 212 156 213 void PlatformCAAnimationRemote::Properties::encode(IPC::Encoder& encoder) const 157 214 { … … 167 224 encoder << fillMode; 168 225 encoder << valueFunction; 226 encodeTimingFunction(encoder, timingFunction.get()); 169 227 170 228 encoder << autoReverses; … … 178 236 179 237 encoder << static_cast<uint64_t>(timingFunctions.size()); 180 for (const auto& timingFunction : timingFunctions) { 181 switch (timingFunction->type()) { 182 case TimingFunction::LinearFunction: 183 encoder << *static_cast<LinearTimingFunction*>(timingFunction.get()); 184 break; 185 186 case TimingFunction::CubicBezierFunction: 187 encoder << *static_cast<CubicBezierTimingFunction*>(timingFunction.get()); 188 break; 189 190 case TimingFunction::StepsFunction: 191 encoder << *static_cast<StepsTimingFunction*>(timingFunction.get()); 192 break; 193 194 case TimingFunction::SpringFunction: 195 encoder << *static_cast<SpringTimingFunction*>(timingFunction.get()); 196 break; 197 } 198 } 238 for (const auto& timingFunction : timingFunctions) 239 encodeTimingFunction(encoder, timingFunction.get()); 199 240 } 200 241 … … 229 270 return WTF::nullopt; 230 271 272 if (auto timingFunction = decodeTimingFunction(decoder)) 273 properties.timingFunction = WTFMove(*timingFunction); 274 else 275 return WTF::nullopt; 276 231 277 if (!decoder.decode(properties.autoReverses)) 232 278 return WTF::nullopt; … … 258 304 259 305 for (size_t i = 0; i < numTimingFunctions; ++i) { 260 261 TimingFunction::TimingFunctionType type;262 if (!decoder.decode(type))306 if (auto timingFunction = decodeTimingFunction(decoder)) 307 properties.timingFunctions.uncheckedAppend(WTFMove(*timingFunction)); 308 else 263 309 return WTF::nullopt; 264 265 RefPtr<TimingFunction> timingFunction;266 switch (type) {267 case TimingFunction::LinearFunction:268 timingFunction = LinearTimingFunction::create();269 if (!decoder.decode(*static_cast<LinearTimingFunction*>(timingFunction.get())))270 return WTF::nullopt;271 break;272 273 case TimingFunction::CubicBezierFunction:274 timingFunction = CubicBezierTimingFunction::create();275 if (!decoder.decode(*static_cast<CubicBezierTimingFunction*>(timingFunction.get())))276 return WTF::nullopt;277 break;278 279 case TimingFunction::StepsFunction:280 timingFunction = StepsTimingFunction::create();281 if (!decoder.decode(*static_cast<StepsTimingFunction*>(timingFunction.get())))282 return WTF::nullopt;283 break;284 285 case TimingFunction::SpringFunction:286 timingFunction = SpringTimingFunction::create();287 if (!decoder.decode(*static_cast<SpringTimingFunction*>(timingFunction.get())))288 return WTF::nullopt;289 break;290 }291 292 properties.timingFunctions.uncheckedAppend(WTFMove(timingFunction));293 310 } 294 311 } … … 422 439 } 423 440 424 void PlatformCAAnimationRemote::setTimingFunction(const TimingFunction* value, bool reverse) 425 { 426 Vector<RefPtr<TimingFunction>> timingFunctions; 427 timingFunctions.append(value->clone()); 428 429 m_properties.timingFunctions = WTFMove(timingFunctions); 430 m_properties.reverseTimingFunctions = reverse; 441 void PlatformCAAnimationRemote::setTimingFunction(const TimingFunction* value, bool) 442 { 443 RefPtr<TimingFunction> timingFunction = value->clone(); 444 m_properties.timingFunction = WTFMove(timingFunction); 431 445 } 432 446 433 447 void PlatformCAAnimationRemote::copyTimingFunctionFrom(const PlatformCAAnimation& value) 434 448 { 435 copyTimingFunctionsFrom(value); 449 const PlatformCAAnimationRemote& other = downcast<PlatformCAAnimationRemote>(value); 450 m_properties.timingFunction = other.m_properties.timingFunction; 436 451 } 437 452 … … 721 736 [basicAnimation setToValue:animationValueFromKeyframeValue(properties.keyValues[1])]; 722 737 } 723 738 724 739 if (properties.timingFunctions.size()) 725 740 [basicAnimation setTimingFunction:toCAMediaTimingFunction(properties.timingFunctions[0].get(), properties.reverseTimingFunctions)]; 726 741 727 742 caAnimation = basicAnimation; 728 743 break; … … 742 757 }).get()]; 743 758 } 759 760 if (properties.timingFunction) 761 [keyframeAnimation setTimingFunction:toCAMediaTimingFunction(properties.timingFunction.get(), false)]; // FIXME: handle reverse. 744 762 745 763 if (properties.timingFunctions.size()) { … … 871 889 ts.dumpProperty("fillMode", animation.fillMode); 872 890 ts.dumpProperty("valueFunction", animation.valueFunction); 891 ts.dumpProperty<const TimingFunction&>("timing function", *animation.timingFunction); 873 892 874 893 if (animation.autoReverses)
Note: See TracChangeset
for help on using the changeset viewer.