OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 25 matching lines...) Expand all Loading... | |
36 #include "core/animation/KeyframeEffectModel.h" | 36 #include "core/animation/KeyframeEffectModel.h" |
37 #include "core/animation/StringKeyframe.h" | 37 #include "core/animation/StringKeyframe.h" |
38 #include "core/css/parser/BisonCSSParser.h" | 38 #include "core/css/parser/BisonCSSParser.h" |
39 #include "core/css/resolver/StyleResolver.h" | 39 #include "core/css/resolver/StyleResolver.h" |
40 #include "core/dom/Element.h" | 40 #include "core/dom/Element.h" |
41 #include "wtf/NonCopyingSort.h" | 41 #include "wtf/NonCopyingSort.h" |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
45 // FIXME: Remove this once we've removed the dependency on Element. | 45 // FIXME: Remove this once we've removed the dependency on Element. |
46 static bool checkDocumentAndRenderer(Element* element) | 46 static bool checkDocument(Element* element) |
47 { | 47 { |
48 if (!element || !element->inActiveDocument()) | 48 return (element && element->inActiveDocument()); |
49 return false; | |
50 element->document().updateRenderTreeIfNeeded(); | |
51 return element->renderer(); | |
alancutter (OOO until 2018)
2014/05/23 07:01:36
I think we still need to check for renderer() in c
dstockwell
2014/05/23 07:40:58
But, we won't know whether or not there should be
dstockwell
2014/05/23 07:42:25
Wait, why do we care if it's display: none?
dstockwell
2014/05/23 07:44:29
Ahh, because of forceConversions... Hmm, I'm not s
| |
52 } | 49 } |
53 | 50 |
54 PassRefPtrWillBeRawPtr<AnimationEffect> EffectInput::convert(Element* element, c onst Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionStat e, bool unsafe) | 51 PassRefPtrWillBeRawPtr<AnimationEffect> EffectInput::convert(Element* element, c onst Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionStat e, bool unsafe) |
55 { | 52 { |
56 // FIXME: This test will not be neccessary once resolution of keyframe value s occurs at | 53 // FIXME: This test will not be neccessary once resolution of keyframe value s occurs at |
57 // animation application time. | 54 // animation application time. |
58 if (!unsafe && !checkDocumentAndRenderer(element)) | 55 if (!unsafe && !checkDocument(element)) |
59 return nullptr; | 56 return nullptr; |
60 | 57 |
61 StyleSheetContents* styleSheetContents = element->document().elementSheet(). contents(); | 58 StyleSheetContents* styleSheetContents = element->document().elementSheet(). contents(); |
62 StringKeyframeVector keyframes; | 59 StringKeyframeVector keyframes; |
63 bool everyFrameHasOffset = true; | 60 bool everyFrameHasOffset = true; |
64 bool looselySortedByOffset = true; | 61 bool looselySortedByOffset = true; |
65 double lastOffset = -std::numeric_limits<double>::infinity(); | 62 double lastOffset = -std::numeric_limits<double>::infinity(); |
66 | 63 |
67 for (size_t i = 0; i < keyframeDictionaryVector.size(); ++i) { | 64 for (size_t i = 0; i < keyframeDictionaryVector.size(); ++i) { |
68 RefPtrWillBeRawPtr<StringKeyframe> keyframe = StringKeyframe::create(); | 65 RefPtrWillBeRawPtr<StringKeyframe> keyframe = StringKeyframe::create(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 if (!keyframeEffectModel->isReplaceOnly()) { | 126 if (!keyframeEffectModel->isReplaceOnly()) { |
130 exceptionState.throwDOMException(NotSupportedError, "Partial keyframes a re not supported."); | 127 exceptionState.throwDOMException(NotSupportedError, "Partial keyframes a re not supported."); |
131 return nullptr; | 128 return nullptr; |
132 } | 129 } |
133 keyframeEffectModel->forceConversionsToAnimatableValues(element); | 130 keyframeEffectModel->forceConversionsToAnimatableValues(element); |
134 | 131 |
135 return keyframeEffectModel; | 132 return keyframeEffectModel; |
136 } | 133 } |
137 | 134 |
138 } // namespace WebCore | 135 } // namespace WebCore |
OLD | NEW |