Bug 20088

Summary: parse CSS Animations
Product: WebKit Reporter: Dean Jackson <dino>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: All   
Bug Depends on:    
Bug Blocks: 19028    
Attachments:
Description Flags
patch to provide parsing for css animation properties
none
updated patch for css parsing
hyatt: review-
Updated patch that adds keyframes correctly hyatt: review+

Dean Jackson
Reported 2008-07-17 16:24:20 PDT
This patch updates the CSS parser to accept the CSS Animation properties, including the keyframe syntax.
Attachments
patch to provide parsing for css animation properties (61.70 KB, patch)
2008-07-17 16:25 PDT, Dean Jackson
no flags
updated patch for css parsing (195.50 KB, patch)
2008-07-20 12:27 PDT, Dean Jackson
hyatt: review-
Updated patch that adds keyframes correctly (65.29 KB, patch)
2008-08-04 17:19 PDT, Dean Jackson
hyatt: review+
Dean Jackson
Comment 1 2008-07-17 16:25:30 PDT
Created attachment 22354 [details] patch to provide parsing for css animation properties
Dean Jackson
Comment 2 2008-07-20 12:27:49 PDT
Created attachment 22395 [details] updated patch for css parsing Removed an old keyframes @rule from the grammar. I'd also left out the keyword in the tokenizer so keyframes were not being noticed.
Dave Hyatt
Comment 3 2008-07-23 15:32:09 PDT
Comment on attachment 22395 [details] updated patch for css parsing CSSComputedStyleDeclaration should not be part of this patch. Need a followup bug that keyframes should support a comma-separated list of percentages and not just a single percentage. The way keyframe rules are added is wrong. You need to add keyframe styles as part of the normal addRulesFromSheet process. You can't add them in a separate walk or you'll miss @import and @media behavior. Make a test with a <style> element that @imports a sheet with keyframes and you'll see that it doesn't work. Similarly try putting a @keyframes rule inside @media print { } and watch it incorrectly apply to screen. You already have the hashtable from name -> keyframes rule held by the CSSStyleSelector. Just build it up during the normal addRulesFromSheet process instead. The code that aggressively constructs RenderStyles at keyframe-buildup time in the style selector is wrong, but that's the part I'm looking the other way on. This patch duplicates stuff from 19938.... the Node/Document/Element changes. Pick one patch to put them in. :)
Dean Jackson
Comment 4 2008-08-04 17:19:37 PDT
Created attachment 22646 [details] Updated patch that adds keyframes correctly This (hopefully) addresses the previous review comments about adding Keyframes at the wrong time during parsing. They should now be picked up within @media rules, for example.
Dave Hyatt
Comment 5 2008-08-05 15:01:41 PDT
Comment on attachment 22646 [details] Updated patch that adds keyframes correctly This looks good. I think we need tests of error recovery from messed up keyframes, since I'm a bit worried that malformed keyframes rules aren't going to error recover properly, but I think that could be a followup bug.
Dean Jackson
Comment 6 2008-08-05 16:02:17 PDT
r35579 = 684ed79bb9f8a782bb5f4d789adef25c161ec0e7 (trunk) M WebCore/GNUmakefile.am M WebCore/WebCore.xcodeproj/project.pbxproj M WebCore/WebCore.pro M WebCore/ChangeLog M WebCore/WebCore.vcproj/WebCore.vcproj M WebCore/css/CSSValueKeywords.in M WebCore/css/CSSStyleSelector.cpp M WebCore/css/CSSStyleSelector.h M WebCore/css/CSSRule.h A WebCore/css/WebKitCSSKeyframesRule.cpp M WebCore/css/CSSParser.cpp M WebCore/css/CSSGrammar.y A WebCore/css/WebKitCSSKeyframeRule.cpp M WebCore/css/tokenizer.flex M WebCore/css/StyleBase.h M WebCore/css/CSSPropertyNames.in A WebCore/css/WebKitCSSKeyframeRule.h A WebCore/css/WebKitCSSKeyframesRule.h M WebCore/css/CSSParser.h M WebCore/WebCoreSources.bkl
Note You need to log in before you can comment on or make changes to this bug.