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

Unified Diff: Source/core/testing/InternalSettings.cpp

Issue 802143002: AnimationPolicy setting is applied to SVG animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « Source/core/testing/InternalSettings.h ('k') | Source/core/testing/InternalSettings.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/InternalSettings.cpp
diff --git a/Source/core/testing/InternalSettings.cpp b/Source/core/testing/InternalSettings.cpp
index a674cbf080f868364949d54fc180ce8ff908ed3b..7e29c4c43575621663edf201e4610a8e516c1810 100644
--- a/Source/core/testing/InternalSettings.cpp
+++ b/Source/core/testing/InternalSettings.cpp
@@ -75,6 +75,7 @@ InternalSettings::Backup::Backup(Settings* settings)
, m_originalLayerSquashingEnabled(settings->layerSquashingEnabled())
, m_originalPseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled(RuntimeEnabledFeatures::pseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled())
, m_originalImageColorProfilesEnabled(RuntimeEnabledFeatures::imageColorProfilesEnabled())
+ , m_originalImageAnimationPolicy(settings->imageAnimationPolicy())
{
}
@@ -97,6 +98,7 @@ void InternalSettings::Backup::restoreTo(Settings* settings)
settings->genericFontFamilySettings().reset();
RuntimeEnabledFeatures::setPseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled(m_originalPseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled);
RuntimeEnabledFeatures::setImageColorProfilesEnabled(m_originalImageColorProfilesEnabled);
+ settings->setImageAnimationPolicy(m_originalImageAnimationPolicy);
}
#if ENABLE(OILPAN)
@@ -438,4 +440,16 @@ void InternalSettings::setPrimaryHoverType(const String& type, ExceptionState& e
settings()->setPrimaryHoverType(hoverType);
}
+void InternalSettings::setImageAnimationPolicy(const String& policy, ExceptionState& exceptionState)
+{
+ InternalSettingsGuardForSettings();
+ if (equalIgnoringCase(policy, "allowed"))
+ settings()->setImageAnimationPolicy(ImageAnimationPolicyAllowed);
+ else if (equalIgnoringCase(policy, "once"))
+ settings()->setImageAnimationPolicy(ImageAnimationPolicyAnimateOnce);
+ else if (equalIgnoringCase(policy, "none"))
+ settings()->setImageAnimationPolicy(ImageAnimationPolicyNoAnimation);
+ else
+ exceptionState.throwDOMException(SyntaxError, "The image animation policy provided ('" + policy + "') is invalid.");
+}
}
« no previous file with comments | « Source/core/testing/InternalSettings.h ('k') | Source/core/testing/InternalSettings.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698