Commit 7a0fd621 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Remove variable shadowing in blink/svg

In an effort to reduce or even ban symbol shadowing, this renames
a variable to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The exact error this avoids is:
third_party/blink/renderer/core/svg/svg_svg_element.cc:456:28: error: declaration shadows a local variable [-Werror,-Wshadow]
      TransformationMatrix transform;
                           ^
third_party/blink/renderer/core/svg/svg_svg_element.cc:449:19: note: previous declaration is here
  AffineTransform transform;
                  ^

Bug: 923510
Change-Id: I99c001d0eb513d73bfc33d540601479a6fd7280d
Reviewed-on: https://chromium-review.googlesource.com/c/1482975
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: default avatarFredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#634676}
parent 8c69cffa
...@@ -453,24 +453,24 @@ AffineTransform SVGSVGElement::LocalCoordinateSpaceTransform( ...@@ -453,24 +453,24 @@ AffineTransform SVGSVGElement::LocalCoordinateSpaceTransform(
y_->CurrentValue()->Value(length_context)); y_->CurrentValue()->Value(length_context));
} else if (mode == kScreenScope) { } else if (mode == kScreenScope) {
if (LayoutObject* layout_object = this->GetLayoutObject()) { if (LayoutObject* layout_object = this->GetLayoutObject()) {
TransformationMatrix transform; TransformationMatrix matrix;
// Adjust for the zoom level factored into CSS coordinates (WK bug // Adjust for the zoom level factored into CSS coordinates (WK bug
// #96361). // #96361).
transform.Scale(1.0 / layout_object->StyleRef().EffectiveZoom()); matrix.Scale(1.0 / layout_object->StyleRef().EffectiveZoom());
// Apply transforms from our ancestor coordinate space, including any // Apply transforms from our ancestor coordinate space, including any
// non-SVG ancestor transforms. // non-SVG ancestor transforms.
transform.Multiply(layout_object->LocalToAbsoluteTransform()); matrix.Multiply(layout_object->LocalToAbsoluteTransform());
// At the SVG/HTML boundary (aka LayoutSVGRoot), we need to apply the // At the SVG/HTML boundary (aka LayoutSVGRoot), we need to apply the
// localToBorderBoxTransform to map an element from SVG viewport // localToBorderBoxTransform to map an element from SVG viewport
// coordinates to CSS box coordinates. // coordinates to CSS box coordinates.
transform.Multiply( matrix.Multiply(
ToLayoutSVGRoot(layout_object)->LocalToBorderBoxTransform()); ToLayoutSVGRoot(layout_object)->LocalToBorderBoxTransform());
// Drop any potential non-affine parts, because we're not able to convey // Drop any potential non-affine parts, because we're not able to convey
// that information further anyway until getScreenCTM returns a DOMMatrix // that information further anyway until getScreenCTM returns a DOMMatrix
// (4x4 matrix.) // (4x4 matrix.)
return transform.ToAffineTransform(); return matrix.ToAffineTransform();
} }
} }
if (!HasEmptyViewBox()) { if (!HasEmptyViewBox()) {
......
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