Bug 109271

Summary: Keyframe rule should be ignored if keyframe selector has invalid value
Product: WebKit Reporter: Alexander Shalamov <alexander.shalamov>
Component: CSSAssignee: Alexander Shalamov <alexander.shalamov>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: allan.jensen, bfulgham, buildbot, commit-queue, dglazkov, dino, esprehn+autocc, heejin.r.chung, macpherson, menard, ojan.autocc, peter+ews, rego+ews, rniwa, simon.fraser, webkit.review.bot, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch 1
none
Patch 2
webkit-ews: commit-queue-
Patch 3
none
Patch 4
simon.fraser: review-
Patch 5 dino: review-

Alexander Shalamov
Reported 2013-02-08 01:04:51 PST
Whenever keyframe selector has invalid value (negative or more than 100%), keyframe rule should be ignored.
Attachments
Patch 1 (11.91 KB, patch)
2013-02-08 05:24 PST, Alexander Shalamov
no flags
Patch 2 (11.88 KB, patch)
2013-02-08 05:32 PST, Alexander Shalamov
webkit-ews: commit-queue-
Patch 3 (11.85 KB, patch)
2013-02-11 05:17 PST, Alexander Shalamov
no flags
Patch 4 (11.77 KB, patch)
2013-04-12 04:44 PDT, Alexander Shalamov
simon.fraser: review-
Patch 5 (11.90 KB, patch)
2013-04-16 06:27 PDT, Alexander Shalamov
dino: review-
Alexander Shalamov
Comment 1 2013-02-08 05:24:59 PST
Created attachment 187297 [details] Patch 1 Patch for initial review.
Alexander Shalamov
Comment 2 2013-02-08 05:32:40 PST
Created attachment 187299 [details] Patch 2 - remove unnecessary rule.release() in CSSParser::createKeyframesRule
Early Warning System Bot
Comment 3 2013-02-08 05:42:09 PST
Early Warning System Bot
Comment 4 2013-02-08 05:43:51 PST
WebKit Review Bot
Comment 5 2013-02-08 05:55:22 PST
Comment on attachment 187299 [details] Patch 2 Attachment 187299 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/16408747
EFL EWS Bot
Comment 6 2013-02-08 06:09:35 PST
Peter Beverloo (cr-android ews)
Comment 7 2013-02-08 06:11:27 PST
Comment on attachment 187299 [details] Patch 2 Attachment 187299 [details] did not pass cr-android-ews (chromium-android): Output: http://queues.webkit.org/results/16418649
WebKit Review Bot
Comment 8 2013-02-08 06:17:09 PST
Comment on attachment 187299 [details] Patch 2 Attachment 187299 [details] did not pass cr-linux-debug-ews (chromium-xvfb): Output: http://queues.webkit.org/results/16432666
Build Bot
Comment 9 2013-02-08 06:29:25 PST
Comment on attachment 187299 [details] Patch 2 Attachment 187299 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://queues.webkit.org/results/16445707
Build Bot
Comment 10 2013-02-08 07:19:39 PST
Alexander Shalamov
Comment 11 2013-02-11 05:17:43 PST
Created attachment 187550 [details] Patch 3 fix for linking issue
Alexander Shalamov
Comment 12 2013-04-12 04:44:12 PDT
Created attachment 197744 [details] Patch 4 rebased to master
Simon Fraser (smfr)
Comment 13 2013-04-12 09:15:01 PDT
Comment on attachment 197744 [details] Patch 4 View in context: https://bugs.webkit.org/attachment.cgi?id=197744&action=review > LayoutTests/animations/keyframe-rule-negative-selector-percentage.html:6 > + -100% { What about comma-separate keyframe selectors, like 10%, -20%? Please test those.
Alexander Shalamov
Comment 14 2013-04-16 06:27:47 PDT
Created attachment 198324 [details] Patch 5 Added comma separated keyframe selectors to layout test.
Dean Jackson
Comment 15 2013-04-18 22:18:44 PDT
Comment on attachment 198324 [details] Patch 5 View in context: https://bugs.webkit.org/attachment.cgi?id=198324&action=review Nearly there! You might want to test -0% as well. > Source/WebCore/ChangeLog:7 > + Keyframe rule should be ignored if keyframe selector has invalid value > + https://bugs.webkit.org/show_bug.cgi?id=109271 > + > + Reviewed by NOBODY (OOPS!). > + Please outline what you changed. You updated the CSS grammar - it's important to describe why you did that. > Source/WebCore/ChangeLog:26 > + * css/CSSGrammar.y.in: > + * css/CSSParser.cpp: > + (WebCore::CSSParser::createKeyframesRule): > + (WebCore::CSSParser::updateSpecifiers): > + * css/StyleResolver.cpp: > + (WebCore::StyleResolver::keyframeStylesForAnimation): > + * css/WebKitCSSKeyframeRule.cpp: > + (WebCore::StyleKeyframe::keyText): > + (WebCore): > + (WebCore::StyleKeyframe::setKeyText): > + (WebCore::StyleKeyframe::setKeys): > + (WebCore::StyleKeyframe::parseKeyString): > + (WebCore::StyleKeyframe::reportMemoryUsage): > + * css/WebKitCSSKeyframeRule.h: > + (StyleKeyframe): > + (WebCore::StyleKeyframe::isValid): > + (WebCore::StyleKeyframe::getKeys): And provide some details here too. > Source/WebCore/css/CSSParser.cpp:11351 > + if (keyframe->isValid()) { > + rule->parserAppendKeyframe(keyframe); > + continue; > + } > + return 0; You should do this the other way around. if (!keyframe->isValid()) return 0; rule->parserAppendKeyframe(keyframe); > Source/WebCore/css/CSSParser.cpp:11630 > + if (value && value->unit == CSSPrimitiveValue::CSS_NUMBER) { > + keyframeKeys.append(static_cast<float>(value->fValue / 100)); > + continue; > + } > + keyframeKeys.clear(); > + break; Same here. Early break/return in the invalid case.
Brent Fulgham
Comment 16 2022-07-13 14:04:01 PDT
I believe keyframe animation works properly now. Could you REOPEN if you believe a specific case is still not handled properly?
Note You need to log in before you can comment on or make changes to this bug.