Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Unified Diff: third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp

Issue 2927123005: Deprecate step timing with position 'middle' (Closed)
Patch Set: Rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp b/third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp
index 5687d25b7db901b996d5390cfb08139ac5df4a79..5b80e0cabc8d2e0996f216edb1c31cef1e99a420 100644
--- a/third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp
@@ -40,6 +40,7 @@
#include "core/css/CSSValuePair.h"
#include "core/css/resolver/StyleBuilderConverter.h"
#include "core/css/resolver/StyleResolverState.h"
+#include "core/frame/Deprecation.h"
#include "core/style/BorderImageLengthBox.h"
#include "core/style/FillLayer.h"
@@ -408,7 +409,8 @@ CSSTransitionData::TransitionProperty CSSToStyleMap::MapAnimationProperty(
PassRefPtr<TimingFunction> CSSToStyleMap::MapAnimationTimingFunction(
const CSSValue& value,
- bool allow_step_middle) {
+ bool allow_step_middle,
+ Document* document) {
// FIXME: We should probably only call into this function with a valid
// single timing function value which isn't initial or inherit. We can
// currently get into here with initial since the parser expands unset
@@ -435,9 +437,15 @@ PassRefPtr<TimingFunction> CSSToStyleMap::MapAnimationTimingFunction(
return StepsTimingFunction::Preset(
StepsTimingFunction::StepPosition::START);
case CSSValueStepMiddle:
- if (allow_step_middle)
+ if (allow_step_middle) {
+ DCHECK(document);
+ if (document) {
+ Deprecation::CountDeprecation(
+ *document, WebFeature::kDeprecatedTimingFunctionStepMiddle);
+ }
return StepsTimingFunction::Preset(
StepsTimingFunction::StepPosition::MIDDLE);
+ }
return CSSTimingData::InitialTimingFunction();
case CSSValueStepEnd:
return StepsTimingFunction::Preset(
@@ -469,9 +477,16 @@ PassRefPtr<TimingFunction> CSSToStyleMap::MapAnimationTimingFunction(
const CSSStepsTimingFunctionValue& steps_timing_function =
ToCSSStepsTimingFunctionValue(value);
if (steps_timing_function.GetStepPosition() ==
- StepsTimingFunction::StepPosition::MIDDLE &&
- !allow_step_middle)
- return CSSTimingData::InitialTimingFunction();
+ StepsTimingFunction::StepPosition::MIDDLE) {
+ if (!allow_step_middle) {
+ return CSSTimingData::InitialTimingFunction();
+ }
+ DCHECK(document);
+ if (document) {
+ Deprecation::CountDeprecation(
+ *document, WebFeature::kDeprecatedTimingFunctionStepMiddle);
+ }
+ }
return StepsTimingFunction::Create(steps_timing_function.NumberOfSteps(),
steps_timing_function.GetStepPosition());
}
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.h ('k') | third_party/WebKit/Source/core/frame/Deprecation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698