Commit ef252938 authored by George Steel's avatar George Steel Committed by Commit Bot

[code health] Remove dead case from LayoutSVGTransformableContainer

As of https://chromium-review.googlesource.com/c/chromium/src/+/1986325
we no longer replace nested <use/> elements with <g> elements when
populating shadow trees and instead support <use/> inside shadow trees
directly (as per the current spec).  Remove the check for this case
from LayoutSVGTransformableContainer as it has been dead for a while.

Change-Id: Iad3a09fe4779cdd54edd0ae98aaaac07fc1bcfb0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462227
Commit-Queue: George Steel <gtsteel@chromium.org>
Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816661}
parent 2bacddf7
......@@ -80,28 +80,16 @@ void LayoutSVGTransformableContainer::SetNeedsTransformUpdate() {
needs_transform_update_ = true;
}
bool LayoutSVGTransformableContainer::IsUseElement() const {
NOT_DESTROYED();
const SVGElement& element = *GetElement();
if (IsA<SVGUseElement>(element))
return true;
// Nested <use> are replaced by <g> during shadow tree expansion.
if (IsA<SVGGElement>(element) && To<SVGGElement>(element).InUseShadowTree())
return IsA<SVGUseElement>(element.CorrespondingElement());
return false;
}
SVGTransformChange LayoutSVGTransformableContainer::CalculateLocalTransform(
bool bounds_changed) {
NOT_DESTROYED();
SVGElement* element = GetElement();
DCHECK(element);
// If we're either the LayoutObject for a <use> element, or for any <g>
// element inside the shadow tree, that was created during the use/symbol/svg
// expansion in SVGUseElement. These containers need to respect the
// translations induced by their corresponding use elements x/y attributes.
if (IsUseElement()) {
// If we're the LayoutObject for a <use> element, this container needs to
// respect the translations induced by their corresponding use elements x/y
// attributes.
if (IsA<SVGUseElement>(element)) {
const ComputedStyle& style = StyleRef();
const SVGComputedStyle& svg_style = style.SvgStyle();
SVGLengthContext length_context(element);
......
......@@ -52,7 +52,6 @@ class LayoutSVGTransformableContainer final : public LayoutSVGContainer {
NOT_DESTROYED();
return local_transform_;
}
bool IsUseElement() const;
bool needs_transform_update_ : 1;
bool transform_uses_reference_box_ : 1;
......
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