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() { ...@@ -80,28 +80,16 @@ void LayoutSVGTransformableContainer::SetNeedsTransformUpdate() {
needs_transform_update_ = true; 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( SVGTransformChange LayoutSVGTransformableContainer::CalculateLocalTransform(
bool bounds_changed) { bool bounds_changed) {
NOT_DESTROYED(); NOT_DESTROYED();
SVGElement* element = GetElement(); SVGElement* element = GetElement();
DCHECK(element); DCHECK(element);
// If we're either the LayoutObject for a <use> element, or for any <g> // If we're the LayoutObject for a <use> element, this container needs to
// element inside the shadow tree, that was created during the use/symbol/svg // respect the translations induced by their corresponding use elements x/y
// expansion in SVGUseElement. These containers need to respect the // attributes.
// translations induced by their corresponding use elements x/y attributes. if (IsA<SVGUseElement>(element)) {
if (IsUseElement()) {
const ComputedStyle& style = StyleRef(); const ComputedStyle& style = StyleRef();
const SVGComputedStyle& svg_style = style.SvgStyle(); const SVGComputedStyle& svg_style = style.SvgStyle();
SVGLengthContext length_context(element); SVGLengthContext length_context(element);
......
...@@ -52,7 +52,6 @@ class LayoutSVGTransformableContainer final : public LayoutSVGContainer { ...@@ -52,7 +52,6 @@ class LayoutSVGTransformableContainer final : public LayoutSVGContainer {
NOT_DESTROYED(); NOT_DESTROYED();
return local_transform_; return local_transform_;
} }
bool IsUseElement() const;
bool needs_transform_update_ : 1; bool needs_transform_update_ : 1;
bool transform_uses_reference_box_ : 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