Commit 74b50f11 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Remove dead code in SVGElement::ParseAttribute

The 'params.name == HTMLNames::classAttr' condition will never be true,
because the if-block just above it will catch that case. The
|class_name_| SVGAnimatedProperty object is registered in the attribute
map. Retain and update the comment about the somewhat special handling
of the 'class' attribute.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I9928fb6f9c29d5db961b7f937fe4b1c0fb3fde82
Reviewed-on: https://chromium-review.googlesource.com/1179749Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#584067}
parent 3f072c5f
...@@ -671,6 +671,13 @@ bool SVGElement::InUseShadowTree() const { ...@@ -671,6 +671,13 @@ bool SVGElement::InUseShadowTree() const {
} }
void SVGElement::ParseAttribute(const AttributeModificationParams& params) { void SVGElement::ParseAttribute(const AttributeModificationParams& params) {
// Note about the 'class' attribute:
// The "special storage" (SVGAnimatedString) for the 'class' attribute (and
// the 'className' property) is updated by the follow block (|class_name_|
// registered in |attribute_to_property_map_|.). SvgAttributeChanged then
// triggers the resulting style updates (instead of
// Element::ParseAttribute). We don't tell Element about the change to avoid
// parsing the class list twice.
if (SVGAnimatedPropertyBase* property = PropertyFromAttribute(params.name)) { if (SVGAnimatedPropertyBase* property = PropertyFromAttribute(params.name)) {
SVGParsingError parse_error = SVGParsingError parse_error =
property->SetBaseValueAsString(params.new_value); property->SetBaseValueAsString(params.new_value);
...@@ -678,15 +685,7 @@ void SVGElement::ParseAttribute(const AttributeModificationParams& params) { ...@@ -678,15 +685,7 @@ void SVGElement::ParseAttribute(const AttributeModificationParams& params) {
return; return;
} }
if (params.name == HTMLNames::classAttr) { if (params.name == tabindexAttr) {
// SVG animation has currently requires special storage of values so we set
// the className here. svgAttributeChanged actually causes the resulting
// style updates (instead of Element::parseAttribute). We don't
// tell Element about the change to avoid parsing the class list twice
SVGParsingError parse_error =
class_name_->SetBaseValueAsString(params.new_value);
ReportAttributeParsingError(parse_error, params.name, params.new_value);
} else if (params.name == tabindexAttr) {
Element::ParseAttribute(params); Element::ParseAttribute(params);
} else { } else {
// standard events // standard events
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment