summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/svg/svg_animate_element.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/svg/svg_animate_element.cc')
-rw-r--r--chromium/third_party/blink/renderer/core/svg/svg_animate_element.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/chromium/third_party/blink/renderer/core/svg/svg_animate_element.cc b/chromium/third_party/blink/renderer/core/svg/svg_animate_element.cc
index 326e8c2e901..16e66af4305 100644
--- a/chromium/third_party/blink/renderer/core/svg/svg_animate_element.cc
+++ b/chromium/third_party/blink/renderer/core/svg/svg_animate_element.cc
@@ -24,6 +24,7 @@
#include "third_party/blink/renderer/core/css/css_computed_style_declaration.h"
#include "third_party/blink/renderer/core/css/css_property_value_set.h"
+#include "third_party/blink/renderer/core/css/css_style_sheet.h"
#include "third_party/blink/renderer/core/css/style_change_reason.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/qualified_name.h"
@@ -180,9 +181,11 @@ void SVGAnimateElement::ResolveTargetProperty() {
}
} else {
type_ = SVGElement::AnimatedPropertyTypeForCSSAttribute(AttributeName());
- css_property_id_ = type_ != kAnimatedUnknown
- ? cssPropertyID(AttributeName().LocalName())
- : CSSPropertyID::kInvalid;
+ css_property_id_ =
+ type_ != kAnimatedUnknown
+ ? cssPropertyID(targetElement()->GetDocument().ToExecutionContext(),
+ AttributeName().LocalName())
+ : CSSPropertyID::kInvalid;
}
// Blacklist <script> targets here for now to prevent unpleasantries. This
// also disallows the perfectly "valid" animation of 'className' on said
@@ -486,11 +489,10 @@ void SVGAnimateElement::ApplyResultsToTarget() {
MutableCSSPropertyValueSet* properties =
target_element->EnsureAnimatedSMILStyleProperties();
auto animated_value_string = animated_value_->ValueAsString();
- auto secure_context_mode =
- target_element->GetDocument().GetSecureContextMode();
- auto set_result =
- properties->SetProperty(css_property_id_, animated_value_string, false,
- secure_context_mode, nullptr);
+ auto& document = target_element->GetDocument();
+ auto set_result = properties->SetProperty(
+ css_property_id_, animated_value_string, false,
+ document.GetSecureContextMode(), document.ElementSheet().Contents());
if (set_result.did_change) {
target_element->SetNeedsStyleRecalc(
kLocalStyleChange,
@@ -584,7 +586,7 @@ void SVGAnimateElement::SetAttributeType(
AnimationAttributeChanged();
}
-void SVGAnimateElement::Trace(blink::Visitor* visitor) {
+void SVGAnimateElement::Trace(Visitor* visitor) {
visitor->Trace(from_property_);
visitor->Trace(to_property_);
visitor->Trace(to_at_end_of_duration_property_);