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

Side by Side 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 5 years, 12 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 unified diff | Download patch
« no previous file with comments | « Source/core/testing/InternalSettings.h ('k') | Source/core/testing/InternalSettings.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 , m_originalAccessibilityFontScaleFactor(settings->accessibilityFontScaleFac tor()) 68 , m_originalAccessibilityFontScaleFactor(settings->accessibilityFontScaleFac tor())
69 , m_originalMediaTypeOverride(settings->mediaTypeOverride()) 69 , m_originalMediaTypeOverride(settings->mediaTypeOverride())
70 , m_originalMockScrollbarsEnabled(settings->mockScrollbarsEnabled()) 70 , m_originalMockScrollbarsEnabled(settings->mockScrollbarsEnabled())
71 , m_originalMockGestureTapHighlightsEnabled(settings->mockGestureTapHighligh tsEnabled()) 71 , m_originalMockGestureTapHighlightsEnabled(settings->mockGestureTapHighligh tsEnabled())
72 , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::langAttri buteAwareFormControlUIEnabled()) 72 , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::langAttri buteAwareFormControlUIEnabled())
73 , m_imagesEnabled(settings->imagesEnabled()) 73 , m_imagesEnabled(settings->imagesEnabled())
74 , m_defaultVideoPosterURL(settings->defaultVideoPosterURL()) 74 , m_defaultVideoPosterURL(settings->defaultVideoPosterURL())
75 , m_originalLayerSquashingEnabled(settings->layerSquashingEnabled()) 75 , m_originalLayerSquashingEnabled(settings->layerSquashingEnabled())
76 , m_originalPseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled(Runtim eEnabledFeatures::pseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled()) 76 , m_originalPseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled(Runtim eEnabledFeatures::pseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled())
77 , m_originalImageColorProfilesEnabled(RuntimeEnabledFeatures::imageColorProf ilesEnabled()) 77 , m_originalImageColorProfilesEnabled(RuntimeEnabledFeatures::imageColorProf ilesEnabled())
78 , m_originalImageAnimationPolicy(settings->imageAnimationPolicy())
78 { 79 {
79 } 80 }
80 81
81 void InternalSettings::Backup::restoreTo(Settings* settings) 82 void InternalSettings::Backup::restoreTo(Settings* settings)
82 { 83 {
83 RuntimeEnabledFeatures::setAuthorShadowDOMForAnyElementEnabled(m_originalAut horShadowDOMForAnyElementEnabled); 84 RuntimeEnabledFeatures::setAuthorShadowDOMForAnyElementEnabled(m_originalAut horShadowDOMForAnyElementEnabled);
84 RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled( m_originalCSP); 85 RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled( m_originalCSP);
85 RuntimeEnabledFeatures::setLaxMixedContentCheckingEnabled(m_originalLaxMixed ContentCheckingEnabled); 86 RuntimeEnabledFeatures::setLaxMixedContentCheckingEnabled(m_originalLaxMixed ContentCheckingEnabled);
86 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(m_originalOverlayScrollb arsEnabled); 87 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(m_originalOverlayScrollb arsEnabled);
87 settings->setEditingBehaviorType(m_originalEditingBehavior); 88 settings->setEditingBehaviorType(m_originalEditingBehavior);
88 settings->setTextAutosizingEnabled(m_originalTextAutosizingEnabled); 89 settings->setTextAutosizingEnabled(m_originalTextAutosizingEnabled);
89 settings->setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindow SizeOverride); 90 settings->setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindow SizeOverride);
90 settings->setAccessibilityFontScaleFactor(m_originalAccessibilityFontScaleFa ctor); 91 settings->setAccessibilityFontScaleFactor(m_originalAccessibilityFontScaleFa ctor);
91 settings->setMediaTypeOverride(m_originalMediaTypeOverride); 92 settings->setMediaTypeOverride(m_originalMediaTypeOverride);
92 settings->setMockScrollbarsEnabled(m_originalMockScrollbarsEnabled); 93 settings->setMockScrollbarsEnabled(m_originalMockScrollbarsEnabled);
93 settings->setMockGestureTapHighlightsEnabled(m_originalMockGestureTapHighlig htsEnabled); 94 settings->setMockGestureTapHighlightsEnabled(m_originalMockGestureTapHighlig htsEnabled);
94 RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(m_langAttr ibuteAwareFormControlUIEnabled); 95 RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(m_langAttr ibuteAwareFormControlUIEnabled);
95 settings->setImagesEnabled(m_imagesEnabled); 96 settings->setImagesEnabled(m_imagesEnabled);
96 settings->setDefaultVideoPosterURL(m_defaultVideoPosterURL); 97 settings->setDefaultVideoPosterURL(m_defaultVideoPosterURL);
97 settings->genericFontFamilySettings().reset(); 98 settings->genericFontFamilySettings().reset();
98 RuntimeEnabledFeatures::setPseudoClassesInMatchingCriteriaInAuthorShadowTree sEnabled(m_originalPseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled); 99 RuntimeEnabledFeatures::setPseudoClassesInMatchingCriteriaInAuthorShadowTree sEnabled(m_originalPseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled);
99 RuntimeEnabledFeatures::setImageColorProfilesEnabled(m_originalImageColorPro filesEnabled); 100 RuntimeEnabledFeatures::setImageColorProfilesEnabled(m_originalImageColorPro filesEnabled);
101 settings->setImageAnimationPolicy(m_originalImageAnimationPolicy);
100 } 102 }
101 103
102 #if ENABLE(OILPAN) 104 #if ENABLE(OILPAN)
103 InternalSettings* InternalSettings::from(Page& page) 105 InternalSettings* InternalSettings::from(Page& page)
104 { 106 {
105 if (!HeapSupplement<Page>::from(page, supplementName())) 107 if (!HeapSupplement<Page>::from(page, supplementName()))
106 HeapSupplement<Page>::provideTo(page, supplementName(), new InternalSett ings(page)); 108 HeapSupplement<Page>::provideTo(page, supplementName(), new InternalSett ings(page));
107 return static_cast<InternalSettings*>(HeapSupplement<Page>::from(page, suppl ementName())); 109 return static_cast<InternalSettings*>(HeapSupplement<Page>::from(page, suppl ementName()));
108 } 110 }
109 #else 111 #else
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 else if (token == "on-demand") 433 else if (token == "on-demand")
432 hoverType = HoverTypeOnDemand; 434 hoverType = HoverTypeOnDemand;
433 else if (token == "hover") 435 else if (token == "hover")
434 hoverType = HoverTypeHover; 436 hoverType = HoverTypeHover;
435 else 437 else
436 exceptionState.throwDOMException(SyntaxError, "The hover type token ('" + token + ")' is invalid."); 438 exceptionState.throwDOMException(SyntaxError, "The hover type token ('" + token + ")' is invalid.");
437 439
438 settings()->setPrimaryHoverType(hoverType); 440 settings()->setPrimaryHoverType(hoverType);
439 } 441 }
440 442
443 void InternalSettings::setImageAnimationPolicy(const String& policy, ExceptionSt ate& exceptionState)
444 {
445 InternalSettingsGuardForSettings();
446 if (equalIgnoringCase(policy, "allowed"))
447 settings()->setImageAnimationPolicy(ImageAnimationPolicyAllowed);
448 else if (equalIgnoringCase(policy, "once"))
449 settings()->setImageAnimationPolicy(ImageAnimationPolicyAnimateOnce);
450 else if (equalIgnoringCase(policy, "none"))
451 settings()->setImageAnimationPolicy(ImageAnimationPolicyNoAnimation);
452 else
453 exceptionState.throwDOMException(SyntaxError, "The image animation polic y provided ('" + policy + "') is invalid.");
441 } 454 }
455 }
OLDNEW
« 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