Changeset 181602 in webkit
- Timestamp:
- Mar 16, 2015, 5:33:00 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 16 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/animations/script-tests/trigger-computed-style.js (added)
-
LayoutTests/animations/script-tests/trigger-parsing.js (added)
-
LayoutTests/animations/trigger-computed-style-expected.txt (added)
-
LayoutTests/animations/trigger-computed-style.html (added)
-
LayoutTests/animations/trigger-parsing-expected.txt (added)
-
LayoutTests/animations/trigger-parsing.html (added)
-
LayoutTests/platform/efl/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/gtk/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/win/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (10 diffs)
-
Source/WebCore/css/CSSAnimationTriggerScrollValue.cpp (added)
-
Source/WebCore/css/CSSAnimationTriggerScrollValue.h (added)
-
Source/WebCore/css/CSSComputedStyleDeclaration.cpp (modified) (4 diffs)
-
Source/WebCore/css/CSSParser.cpp (modified) (4 diffs)
-
Source/WebCore/css/CSSParser.h (modified) (1 diff)
-
Source/WebCore/css/CSSPropertyNames.in (modified) (1 diff)
-
Source/WebCore/css/CSSToStyleMap.cpp (modified) (2 diffs)
-
Source/WebCore/css/CSSToStyleMap.h (modified) (1 diff)
-
Source/WebCore/css/CSSValue.cpp (modified) (4 diffs)
-
Source/WebCore/css/CSSValue.h (modified) (2 diffs)
-
Source/WebCore/platform/animation/Animation.cpp (modified) (8 diffs)
-
Source/WebCore/platform/animation/Animation.h (modified) (10 diffs)
-
Source/WebCore/platform/animation/AnimationTrigger.h (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r181600 r181602 1 2015-03-16 Dean Jackson <dino@apple.com> 2 3 Parsing and Style Resolution of Container-based Animation Triggers 4 https://bugs.webkit.org/show_bug.cgi?id=142687 5 <rdar://problem/20170007> 6 7 Reviewed by Simon Fraser. 8 9 Take 2. 10 11 New tests that exercise the parser and computed style 12 of -webkit-animation-trigger. 13 14 * animations/script-tests/trigger-computed-style.js: Added. 15 (testComputedTriggerRule): 16 * animations/script-tests/trigger-parsing.js: Added. 17 (testTriggerRule): 18 * animations/trigger-computed-style-expected.txt: Added. 19 * animations/trigger-computed-style.html: Added. 20 * animations/trigger-parsing-expected.txt: Added. 21 * animations/trigger-parsing.html: Added. 22 1 23 2015-03-16 Joanmarie Diggs <jdiggs@igalia.com> 2 24 -
trunk/LayoutTests/platform/efl/TestExpectations
r181593 r181602 62 62 # Need a scroll snap point implementation 63 63 css3/scroll-snap [ Skip ] 64 65 # TODO Animation triggers not supported 66 animations/trigger-computed-style.html [ Skip ] 67 animations/trigger-parsing.html [ Skip ] 64 68 65 69 # ---------------------------------------- -
trunk/LayoutTests/platform/gtk/TestExpectations
r181593 r181602 460 460 # ENABLE(CSS_SCROLL_SNAP) is disabled. 461 461 css3/scroll-snap 462 463 # TODO Animation triggers not supported 464 animations/trigger-computed-style.html [ Skip ] 465 animations/trigger-parsing.html [ Skip ] 462 466 463 467 # ENABLE(SHADOW_DOM) is disabled. -
trunk/LayoutTests/platform/win/TestExpectations
r181593 r181602 595 595 # TODO APNG is not supported 596 596 webkit.org/b/142731 fast/images/animated-png.html [ Skip ] 597 598 # TODO Animation triggers not supported 599 animations/trigger-computed-style.html [ Skip ] 600 animations/trigger-parsing.html [ Skip ] 601 597 602 ################################################################################ 598 603 ########### End Missing Functionality Prevents Testing ############## -
trunk/Source/WebCore/ChangeLog
r181601 r181602 1 2015-03-16 Dean Jackson <dino@apple.com> 2 3 Parsing and Style Resolution of Container-based Animation Triggers 4 https://bugs.webkit.org/show_bug.cgi?id=142687 5 <rdar://problem/20170007> 6 7 Reviewed by Simon Fraser. 8 9 Take 2 after the previous patch was rolled out. 10 11 This is the beginning of a prototype implementation of 12 CSS Animation Triggers, as described by 13 https://lists.w3.org/Archives/Public/www-style/2014Sep/0135.html 14 15 In this patch we parse and resolve the value of a new 16 CSS property "-webkit-animation-trigger". At the moment it 17 only accepts one function value "container-scroll", which 18 will trigger the animation at an absolute position within 19 an element's scrolling container. We expect the syntax to 20 change in the near future, as the spec is written. 21 22 Tests: animations/trigger-computed-style.html 23 animations/trigger-parsing.html 24 25 * WebCore.xcodeproj/project.pbxproj: Add the new files. 26 27 * css/CSSAnimationTriggerScrollValue.cpp: Added. 28 (WebCore::CSSAnimationTriggerScrollValue::customCSSText): Output text for computed style. 29 (WebCore::CSSAnimationTriggerScrollValue::equals): Compare two values. 30 * css/CSSAnimationTriggerScrollValue.h: Added. This holds the CSS side of the 31 scroll trigger. This name may change in the future to better represent the 32 type of trigger, but it is good enough for now. 33 (WebCore::CSSAnimationTriggerScrollValue::create): 34 (WebCore::CSSAnimationTriggerScrollValue::startValue): 35 (WebCore::CSSAnimationTriggerScrollValue::endValue): 36 (WebCore::CSSAnimationTriggerScrollValue::CSSAnimationTriggerScrollValue): 37 38 * css/CSSComputedStyleDeclaration.cpp: 39 (WebCore::createAnimationTriggerValue): Maps an AnimationTrigger into a CSSValue. 40 (WebCore::getAnimationTriggerValue): Gets the current computed style. 41 (WebCore::ComputedStyleExtractor::propertyValue): 42 43 * css/CSSParser.cpp: 44 (WebCore::CSSParser::parseValue): 45 (WebCore::CSSParser::parseAnimationTrigger): Parse the "container-scroll" function 46 and record the value as a CSSAnimationTriggerScrollValue. 47 (WebCore::CSSParser::parseAnimationProperty): Handle the new property. 48 * css/CSSParser.h: 49 50 * css/CSSPropertyNames.in: Add "-webkit-animation-trigger". 51 52 * css/CSSToStyleMap.cpp: 53 (WebCore::CSSToStyleMap::mapAnimationTrigger): Map a CSSValue into a trigger value on 54 an Animation object. 55 * css/CSSToStyleMap.h: 56 57 * css/CSSValue.cpp: Handle the new CSSValue type. 58 (WebCore::CSSValue::equals): 59 (WebCore::CSSValue::cssText): 60 (WebCore::CSSValue::destroy): 61 * css/CSSValue.h: 62 (WebCore::CSSValue::isAnimationTriggerScrollValue): 63 64 * platform/animation/Animation.cpp: Make sure to initialise m_trigger and m_triggerSet, 65 and use them in the operator==. 66 * platform/animation/Animation.h: Add AnimationTrigger as a new field. 67 (WebCore::Animation::isTriggerSet): 68 (WebCore::Animation::isEmpty): 69 70 * platform/animation/AnimationTrigger.h: Added. New base class and subclasses for 71 "auto" and the scrolling trigger. 72 (WebCore::AnimationTrigger::~AnimationTrigger): 73 (WebCore::AnimationTrigger::type): 74 (WebCore::AnimationTrigger::isAutoAnimationTrigger): 75 (WebCore::AnimationTrigger::isScrollAnimationTrigger): 76 (WebCore::AnimationTrigger::AnimationTrigger): 77 (WebCore::AutoAnimationTrigger::create): 78 (WebCore::AutoAnimationTrigger::~AutoAnimationTrigger): 79 (WebCore::AutoAnimationTrigger::AutoAnimationTrigger): 80 (WebCore::ScrollAnimationTrigger::create): 81 (WebCore::ScrollAnimationTrigger::~ScrollAnimationTrigger): 82 (WebCore::ScrollAnimationTrigger::startValue): 83 (WebCore::ScrollAnimationTrigger::setStartValue): 84 (WebCore::ScrollAnimationTrigger::endValue): 85 (WebCore::ScrollAnimationTrigger::setEndValue): 86 (WebCore::ScrollAnimationTrigger::hasEndValue): 87 (WebCore::ScrollAnimationTrigger::setHasEndValue): 88 (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger): 89 1 90 2015-03-16 Alex Christensen <achristensen@webkit.org> 2 91 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r181593 r181602 1281 1281 31A795C81888BCB500382F90 /* ANGLEInstancedArrays.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A795C11888B72400382F90 /* ANGLEInstancedArrays.cpp */; }; 1282 1282 31AB5000122878A2001A7DB0 /* GraphicsContext3DIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 31AB4FFF122878A2001A7DB0 /* GraphicsContext3DIOS.h */; }; 1283 31BC742D1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31BC742B1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.cpp */; }; 1284 31BC742E1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 31BC742C1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.h */; }; 1283 1285 31C0FF210E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31C0FF1B0E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp */; }; 1284 1286 31C0FF220E4CEB6E007D6FE5 /* WebKitAnimationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF1C0E4CEB6E007D6FE5 /* WebKitAnimationEvent.h */; }; … … 1296 1298 31C0FF4E0E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF480E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h */; }; 1297 1299 31D591B316697A6C00E6BF02 /* PlugInClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31D591B116697A6C00E6BF02 /* PlugInClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1300 31DCD29D1AB4FBDE0072E817 /* AnimationTrigger.h in Headers */ = {isa = PBXBuildFile; fileRef = 31DCD29C1AB4FBDE0072E817 /* AnimationTrigger.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1298 1301 31EAF97E121435A400E7C1BF /* DeviceMotionClientIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 31EAF97C121435A400E7C1BF /* DeviceMotionClientIOS.h */; }; 1299 1302 31EAF97F121435A400E7C1BF /* DeviceMotionClientIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31EAF97D121435A400E7C1BF /* DeviceMotionClientIOS.mm */; }; … … 8378 8381 31A795C51888BAD100382F90 /* JSANGLEInstancedArrays.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSANGLEInstancedArrays.h; sourceTree = "<group>"; }; 8379 8382 31AB4FFF122878A2001A7DB0 /* GraphicsContext3DIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContext3DIOS.h; sourceTree = "<group>"; }; 8383 31BC742B1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSAnimationTriggerScrollValue.cpp; sourceTree = "<group>"; }; 8384 31BC742C1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSAnimationTriggerScrollValue.h; sourceTree = "<group>"; }; 8380 8385 31C0FF1B0E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitAnimationEvent.cpp; sourceTree = "<group>"; }; 8381 8386 31C0FF1C0E4CEB6E007D6FE5 /* WebKitAnimationEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitAnimationEvent.h; sourceTree = "<group>"; }; … … 8395 8400 31C0FF480E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitTransitionEventInternal.h; sourceTree = "<group>"; }; 8396 8401 31D591B116697A6C00E6BF02 /* PlugInClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlugInClient.h; sourceTree = "<group>"; }; 8402 31DCD29C1AB4FBDE0072E817 /* AnimationTrigger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationTrigger.h; path = animation/AnimationTrigger.h; sourceTree = "<group>"; }; 8397 8403 31E8D8BA160BC94B004CE8F5 /* RenderSnapshottedPlugIn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSnapshottedPlugIn.cpp; sourceTree = "<group>"; }; 8398 8404 31E8D8BB160BC94C004CE8F5 /* RenderSnapshottedPlugIn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSnapshottedPlugIn.h; sourceTree = "<group>"; }; … … 16071 16077 isa = PBXGroup; 16072 16078 children = ( 16073 498771161242CD7F002226BA /* mac */,16074 16079 498770D71242C535002226BA /* Texture.cpp */, 16075 16080 498770D81242C535002226BA /* Texture.h */, … … 16146 16151 49E912A70EFAC906009D0CAF /* AnimationList.cpp */, 16147 16152 49E912A80EFAC906009D0CAF /* AnimationList.h */, 16153 31DCD29C1AB4FBDE0072E817 /* AnimationTrigger.h */, 16148 16154 0F580FAE149800D400FB5BD8 /* AnimationUtilities.h */, 16149 16155 49E912A90EFAC906009D0CAF /* TimingFunction.h */, … … 22186 22192 isa = PBXGroup; 22187 22193 children = ( 22194 31BC742B1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.cpp */, 22195 31BC742C1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.h */, 22188 22196 83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */, 22189 22197 FBD6AF8415EF21D4008B7110 /* BasicShapeFunctions.cpp */, … … 24190 24198 85E711A10AC5D5350053270F /* DOMHTMLButtonElementInternal.h in Headers */, 24191 24199 93D3C1590F97A9D70053C013 /* DOMHTMLCanvasElement.h in Headers */, 24200 31DCD29D1AB4FBDE0072E817 /* AnimationTrigger.h in Headers */, 24192 24201 93F9B6580BA0F35E00854064 /* DOMHTMLCanvasElementInternal.h in Headers */, 24193 24202 85DF2F8E0AA3C88100AD64C5 /* DOMHTMLCollection.h in Headers */, … … 24322 24331 85E711D20AC5D5350053270F /* DOMNamedNodeMapInternal.h in Headers */, 24323 24332 853BF4DB0ABB6B55008647BB /* DOMNode.h in Headers */, 24333 31BC742E1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.h in Headers */, 24324 24334 854075260AD6C66700620C57 /* DOMNodeFilter.h in Headers */, 24325 24335 85B498FB0ADB340200925CBB /* DOMNodeInternal.h in Headers */, … … 29901 29911 B2227A2F0D00BF220071B782 /* SVGLangSpace.cpp in Sources */, 29902 29912 B2227A320D00BF220071B782 /* SVGLength.cpp in Sources */, 29913 31BC742D1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.cpp in Sources */, 29903 29914 7134496D146941B300720312 /* SVGLengthContext.cpp in Sources */, 29904 29915 B2227A350D00BF220071B782 /* SVGLengthList.cpp in Sources */, -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r181593 r181602 29 29 #include "BasicShapeFunctions.h" 30 30 #include "BasicShapes.h" 31 #include "CSSAnimationTriggerScrollValue.h" 31 32 #include "CSSAspectRatioValue.h" 32 33 #include "CSSBasicShapes.h" … … 86 87 #include "LengthRepeat.h" 87 88 #include "StyleScrollSnapPoints.h" 89 #endif 90 91 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 92 #include "AnimationTrigger.h" 88 93 #endif 89 94 … … 1221 1226 return list; 1222 1227 } 1228 1229 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 1230 static Ref<CSSValue> createAnimationTriggerValue(const AnimationTrigger* trigger, const RenderStyle* style) 1231 { 1232 switch (trigger->type()) { 1233 case AnimationTrigger::AnimationTriggerType::ScrollAnimationTriggerType: { 1234 const ScrollAnimationTrigger* scrollAnimationTrigger = static_cast<const ScrollAnimationTrigger*>(trigger); 1235 if (scrollAnimationTrigger->endValue().isAuto()) 1236 return CSSAnimationTriggerScrollValue::create(zoomAdjustedPixelValueForLength(scrollAnimationTrigger->startValue(), style)); 1237 else 1238 return CSSAnimationTriggerScrollValue::create(zoomAdjustedPixelValueForLength(scrollAnimationTrigger->startValue(), style), 1239 zoomAdjustedPixelValueForLength(scrollAnimationTrigger->endValue(), style)); 1240 } 1241 default: 1242 ASSERT(trigger->type() == AnimationTrigger::AnimationTriggerType::AutoAnimationTriggerType); 1243 return cssValuePool().createIdentifierValue(CSSValueAuto); 1244 } 1245 } 1246 1247 static Ref<CSSValueList> getAnimationTriggerValue(const AnimationList* animList, const RenderStyle* style) 1248 { 1249 auto list = CSSValueList::createCommaSeparated(); 1250 if (animList) { 1251 for (size_t i = 0; i < animList->size(); ++i) 1252 list.get().append(createAnimationTriggerValue(animList->animation(i).trigger().get(), style)); 1253 } else 1254 list.get().append(createAnimationTriggerValue(Animation::initialTrigger().get(), style)); 1255 1256 return list; 1257 } 1258 #endif 1223 1259 1224 1260 static Ref<CSSValue> createLineBoxContainValue(unsigned lineBoxContain) … … 2721 2757 case CSSPropertyWebkitAnimationTimingFunction: 2722 2758 return getTimingFunctionValue(style->animations()); 2759 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 2760 case CSSPropertyWebkitAnimationTrigger: 2761 return getAnimationTriggerValue(style->animations(), style.get()); 2762 #endif 2723 2763 case CSSPropertyWebkitAppearance: 2724 2764 return cssValuePool().createValue(style->appearance()); -
trunk/Source/WebCore/css/CSSParser.cpp
r181593 r181602 29 29 #include "CSSParser.h" 30 30 31 #include "CSSAnimationTriggerScrollValue.h" 31 32 #include "CSSAspectRatioValue.h" 32 33 #include "CSSBasicShapes.h" … … 2690 2691 case CSSPropertyWebkitAnimationIterationCount: 2691 2692 case CSSPropertyWebkitAnimationTimingFunction: 2693 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 2694 case CSSPropertyWebkitAnimationTrigger: 2695 #endif 2692 2696 case CSSPropertyTransitionDelay: 2693 2697 case CSSPropertyTransitionDuration: … … 4744 4748 } 4745 4749 4750 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 4751 PassRefPtr<CSSValue> CSSParser::parseAnimationTrigger() 4752 { 4753 CSSParserValue* value = m_valueList->current(); 4754 if (value->id == CSSValueAuto) 4755 return cssValuePool().createIdentifierValue(CSSValueAuto); 4756 4757 if (value->unit != CSSParserValue::Function) 4758 return nullptr; 4759 4760 CSSParserValueList* args = value->function->args.get(); 4761 4762 if (equalIgnoringCase(value->function->name, "container-scroll(")) { 4763 if (!args || (args->size() != 1 && args->size() != 3)) 4764 return nullptr; 4765 4766 CSSParserValue* argument = args->current(); 4767 ValueWithCalculation firstArgumentWithCalculation(*argument); 4768 if (!validateUnit(firstArgumentWithCalculation, FLength)) 4769 return nullptr; 4770 4771 RefPtr<CSSValue> startValue = createPrimitiveNumericValue(firstArgumentWithCalculation); 4772 4773 argument = args->next(); 4774 4775 if (!argument) 4776 return CSSAnimationTriggerScrollValue::create(startValue.release()); 4777 4778 if (!isComma(argument)) 4779 return nullptr; 4780 4781 argument = args->next(); 4782 ValueWithCalculation secondArgumentWithCalculation(*argument); 4783 if (!validateUnit(secondArgumentWithCalculation, FLength)) 4784 return nullptr; 4785 4786 RefPtr<CSSValue> endValue = createPrimitiveNumericValue(secondArgumentWithCalculation); 4787 4788 return CSSAnimationTriggerScrollValue::create(startValue.release(), endValue.release()); 4789 } 4790 4791 return 0; 4792 } 4793 #endif 4794 4746 4795 PassRefPtr<CSSValue> CSSParser::parseAnimationProperty(AnimationParseContext& context) 4747 4796 { … … 4981 5030 m_valueList->next(); 4982 5031 break; 5032 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 5033 case CSSPropertyWebkitAnimationTrigger: 5034 currValue = parseAnimationTrigger(); 5035 if (currValue) 5036 m_valueList->next(); 5037 break; 5038 #endif 4983 5039 default: 4984 5040 ASSERT_NOT_REACHED(); -
trunk/Source/WebCore/css/CSSParser.h
r181593 r181602 182 182 PassRefPtr<CSSValue> parseAnimationProperty(AnimationParseContext&); 183 183 PassRefPtr<CSSValue> parseAnimationTimingFunction(); 184 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 185 PassRefPtr<CSSValue> parseAnimationTrigger(); 186 #endif 184 187 static Vector<double> parseKeyframeSelector(const String&); 185 188 -
trunk/Source/WebCore/css/CSSPropertyNames.in
r181593 r181602 368 368 -webkit-animation-play-state [AnimationProperty, NameForMethods=PlayState] 369 369 -webkit-animation-timing-function [AnimationProperty, NameForMethods=TimingFunction] 370 #if defined(ENABLE_CSS_ANIMATIONS_LEVEL_2) && ENABLE_CSS_ANIMATIONS_LEVEL_2 371 -webkit-animation-trigger [AnimationProperty, NameForMethods=Trigger] 372 #endif 370 373 -webkit-appearance 371 374 -webkit-aspect-ratio [Inherited, Custom=All] -
trunk/Source/WebCore/css/CSSToStyleMap.cpp
r181593 r181602 30 30 31 31 #include "Animation.h" 32 #include "CSSAnimationTriggerScrollValue.h" 32 33 #include "CSSBorderImageSliceValue.h" 33 34 #include "CSSImageGeneratorValue.h" … … 514 515 } 515 516 517 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 518 void CSSToStyleMap::mapAnimationTrigger(Animation& animation, CSSValue& value) 519 { 520 if (value.isInitialValue()) { 521 animation.setTrigger(Animation::initialTrigger()); 522 return; 523 } 524 525 if (value.isPrimitiveValue()) { 526 auto& primitiveValue = downcast<CSSPrimitiveValue>(value); 527 if (primitiveValue.getValueID() == CSSValueAuto) 528 animation.setTrigger(AutoAnimationTrigger::create()); 529 return; 530 } 531 532 if (value.isAnimationTriggerScrollValue()) { 533 auto& scrollTrigger = downcast<CSSAnimationTriggerScrollValue>(value); 534 535 const CSSPrimitiveValue* startValue = downcast<CSSPrimitiveValue>(scrollTrigger.startValue()); 536 Length startLength = startValue->computeLength<Length>(m_resolver->state().cssToLengthConversionData()); 537 538 Length endLength; 539 if (scrollTrigger.hasEndValue()) { 540 const CSSPrimitiveValue* endValue = downcast<CSSPrimitiveValue>(scrollTrigger.endValue()); 541 endLength = endValue->computeLength<Length>(m_resolver->state().cssToLengthConversionData()); 542 } 543 544 animation.setTrigger(ScrollAnimationTrigger::create(startLength, endLength)); 545 } 546 } 547 #endif 548 516 549 void CSSToStyleMap::mapNinePieceImage(CSSPropertyID property, CSSValue* value, NinePieceImage& image) 517 550 { -
trunk/Source/WebCore/css/CSSToStyleMap.h
r181593 r181602 68 68 void mapAnimationProperty(Animation&, CSSValue&); 69 69 void mapAnimationTimingFunction(Animation&, CSSValue&); 70 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 71 void mapAnimationTrigger(Animation&, CSSValue&); 72 #endif 70 73 71 74 void mapNinePieceImage(CSSPropertyID, CSSValue*, NinePieceImage&); -
trunk/Source/WebCore/css/CSSValue.cpp
r181593 r181602 29 29 #include "CSSValue.h" 30 30 31 #include "CSSAnimationTriggerScrollValue.h" 31 32 #include "CSSAspectRatioValue.h" 32 33 #include "CSSBorderImageSliceValue.h" … … 227 228 case SVGPaintClass: 228 229 return compareCSSValues<SVGPaint>(*this, other); 230 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 231 case AnimationTriggerScrollClass: 232 return compareCSSValues<CSSAnimationTriggerScrollValue>(*this, other); 233 #endif 229 234 default: 230 235 ASSERT_NOT_REACHED(); … … 313 318 case SVGPaintClass: 314 319 return downcast<SVGPaint>(*this).customCSSText(); 320 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 321 case AnimationTriggerScrollClass: 322 return downcast<CSSAnimationTriggerScrollValue>(*this).customCSSText(); 323 #endif 315 324 case WebKitCSSResourceClass: 316 325 return downcast<WebKitCSSResourceValue>(*this).customCSSText(); … … 427 436 delete downcast<SVGPaint>(this); 428 437 return; 438 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 439 case AnimationTriggerScrollClass: 440 delete downcast<CSSAnimationTriggerScrollValue>(this); 441 return; 442 #endif 429 443 case WebKitCSSResourceClass: 430 444 delete downcast<WebKitCSSResourceValue>(this); -
trunk/Source/WebCore/css/CSSValue.h
r181593 r181602 106 106 bool isWebKitCSSResourceValue() const { return m_classType == WebKitCSSResourceClass; } 107 107 108 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 109 bool isAnimationTriggerScrollValue() const { return m_classType == AnimationTriggerScrollClass; } 110 #endif 111 108 112 bool isCSSOMSafe() const { return m_isCSSOMSafe; } 109 113 bool isSubtypeExposedToCSSOM() const … … 165 169 SVGPaintClass, 166 170 WebKitCSSResourceClass, 171 172 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 173 AnimationTriggerScrollClass, 174 #endif 167 175 168 176 // List class types must appear after ValueListClass. -
trunk/Source/WebCore/platform/animation/Animation.cpp
r177821 r181602 33 33 , m_duration(initialDuration()) 34 34 , m_timingFunction(initialTimingFunction()) 35 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 36 , m_trigger(initialTrigger()) 37 #endif 35 38 , m_direction(initialDirection()) 36 39 , m_fillMode(initialFillMode()) … … 45 48 , m_propertySet(false) 46 49 , m_timingFunctionSet(false) 50 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 51 , m_triggerSet(false) 52 #endif 47 53 , m_isNone(false) 48 54 { … … 58 64 , m_duration(o.m_duration) 59 65 , m_timingFunction(o.m_timingFunction) 66 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 67 , m_trigger(o.m_trigger) 68 #endif 60 69 , m_direction(o.m_direction) 61 70 , m_fillMode(o.m_fillMode) … … 70 79 , m_propertySet(o.m_propertySet) 71 80 , m_timingFunctionSet(o.m_timingFunctionSet) 81 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 82 , m_triggerSet(o.m_triggerSet) 83 #endif 72 84 , m_isNone(o.m_isNone) 73 85 { … … 86 98 m_fillMode = o.m_fillMode; 87 99 m_playState = o.m_playState; 100 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 101 m_trigger = o.m_trigger; 102 #endif 88 103 89 104 m_delaySet = o.m_delaySet; … … 96 111 m_propertySet = o.m_propertySet; 97 112 m_timingFunctionSet = o.m_timingFunctionSet; 113 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 114 m_triggerSet = o.m_triggerSet; 115 #endif 98 116 m_isNone = o.m_isNone; 99 117 … … 117 135 && m_duration == o->m_duration 118 136 && *(m_timingFunction.get()) == *(o->m_timingFunction.get()) 137 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 138 && *(m_trigger.get()) == *(o->m_trigger.get()) 139 #endif 119 140 && m_direction == o->m_direction 120 141 && m_fillMode == o->m_fillMode … … 127 148 && m_propertySet == o->m_propertySet 128 149 && m_timingFunctionSet == o->m_timingFunctionSet 150 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 151 && m_triggerSet == o->m_triggerSet 152 #endif 129 153 && m_isNone == o->m_isNone; 130 154 -
trunk/Source/WebCore/platform/animation/Animation.h
r181593 r181602 26 26 #define Animation_h 27 27 28 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 29 #include "AnimationTrigger.h" 30 #endif 28 31 #include "CSSPropertyNames.h" 29 32 #include "RenderStyleConstants.h" … … 51 54 bool isPropertySet() const { return m_propertySet; } 52 55 bool isTimingFunctionSet() const { return m_timingFunctionSet; } 56 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 57 bool isTriggerSet() const { return m_triggerSet; } 58 #endif 53 59 54 60 // Flags this to be the special "none" animation (animation-name: none) … … 62 68 return (!m_directionSet && !m_durationSet && !m_fillModeSet 63 69 && !m_nameSet && !m_playStateSet && !m_iterationCountSet 64 && !m_delaySet && !m_timingFunctionSet && !m_propertySet); 70 && !m_delaySet && !m_timingFunctionSet && !m_propertySet 71 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 72 && !m_triggerSet); 73 #else 74 ); 75 #endif 65 76 } 66 77 … … 79 90 void clearProperty() { m_propertySet = false; } 80 91 void clearTimingFunction() { m_timingFunctionSet = false; } 92 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 93 void clearTrigger() { m_triggerSet = false; } 94 #endif 81 95 82 96 void clearAll() … … 91 105 clearProperty(); 92 106 clearTimingFunction(); 107 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 108 clearTrigger(); 109 #endif 93 110 } 94 111 … … 119 136 EAnimPlayState playState() const { return static_cast<EAnimPlayState>(m_playState); } 120 137 CSSPropertyID property() const { return m_property; } 121 constPassRefPtr<TimingFunction> timingFunction() const { return m_timingFunction; }138 PassRefPtr<TimingFunction> timingFunction() const { return m_timingFunction; } 122 139 AnimationMode animationMode() const { return m_mode; } 140 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 141 PassRefPtr<AnimationTrigger> trigger() const { return m_trigger; } 142 #endif 123 143 124 144 void setDelay(double c) { m_delay = c; m_delaySet = true; } … … 132 152 void setTimingFunction(PassRefPtr<TimingFunction> f) { m_timingFunction = f; m_timingFunctionSet = true; } 133 153 void setAnimationMode(AnimationMode mode) { m_mode = mode; } 154 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 155 void setTrigger(PassRefPtr<AnimationTrigger> t) { m_trigger = t; m_triggerSet = true; } 156 #endif 134 157 135 158 void setIsNoneAnimation(bool n) { m_isNone = n; } … … 158 181 double m_duration; 159 182 RefPtr<TimingFunction> m_timingFunction; 183 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 184 RefPtr<AnimationTrigger> m_trigger; 185 #endif 160 186 unsigned m_direction : 2; // AnimationDirection 161 187 unsigned m_fillMode : 2; 188 162 189 163 190 unsigned m_playState : 2; … … 172 199 bool m_propertySet : 1; 173 200 bool m_timingFunctionSet : 1; 174 201 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 202 bool m_triggerSet : 1; 203 #endif 204 175 205 bool m_isNone : 1; 176 206 … … 185 215 static CSSPropertyID initialProperty() { return CSSPropertyInvalid; } 186 216 static const PassRefPtr<TimingFunction> initialTimingFunction() { return CubicBezierTimingFunction::create(); } 217 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 218 static const PassRefPtr<AnimationTrigger> initialTrigger() { return AutoAnimationTrigger::create(); } 219 #endif 187 220 }; 188 221
Note:
See TracChangeset
for help on using the changeset viewer.