Index: third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp |
diff --git a/third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp b/third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp |
index f9b31b9b6246acc9ad0e1cba9acc077b6cd10c38..b6e36cdc2feffc6060d2ca9d30c7bd0867b4be70 100644 |
--- a/third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp |
+++ b/third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp |
@@ -23,9 +23,7 @@ |
#include "core/SVGNames.h" |
#include "core/dom/StyleChangeReason.h" |
-#include "core/frame/FrameView.h" |
#include "core/layout/LayoutObject.h" |
-#include "core/layout/svg/LayoutSVGRoot.h" |
#include "core/svg/SVGElementRareData.h" |
#include "core/svg/SVGMatrixTearOff.h" |
#include "core/svg/SVGRectTearOff.h" |
@@ -73,7 +71,7 @@ AffineTransform SVGGraphicsElement::ComputeCTM( |
break; |
ctm = ToSVGElement(current_element) |
- ->LocalCoordinateSpaceTransform() |
+ ->LocalCoordinateSpaceTransform(mode) |
.Multiply(ctm); |
switch (mode) { |
@@ -86,7 +84,7 @@ AffineTransform SVGGraphicsElement::ComputeCTM( |
done = current_element == ancestor; |
break; |
default: |
- NOTREACHED(); |
+ DCHECK_EQ(mode, kScreenScope); |
break; |
} |
} |
@@ -101,38 +99,7 @@ AffineTransform SVGGraphicsElement::GetCTM( |
AffineTransform SVGGraphicsElement::GetScreenCTM( |
StyleUpdateStrategy style_update_strategy) { |
- if (style_update_strategy == kAllowStyleUpdate) |
- GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets(); |
- TransformationMatrix transform; |
- if (LayoutObject* layout_object = this->GetLayoutObject()) { |
- // Adjust for the zoom level factored into CSS coordinates (WK bug #96361). |
- transform.Scale(1.0 / layout_object->StyleRef().EffectiveZoom()); |
- |
- // Origin in the document. (This, together with the inverse-scale above, |
- // performs the same operation as |
- // Document::adjustFloatRectForScrollAndAbsoluteZoom, but in transformation |
- // matrix form.) |
- if (FrameView* view = GetDocument().View()) { |
- LayoutRect visible_content_rect(view->VisibleContentRect()); |
- transform.Translate(-visible_content_rect.X(), -visible_content_rect.Y()); |
- } |
- |
- // Apply transforms from our ancestor coordinate space, including any |
- // non-SVG ancestor transforms. |
- transform.Multiply(layout_object->LocalToAbsoluteTransform()); |
- |
- // At the SVG/HTML boundary (aka LayoutSVGRoot), we need to apply the |
- // localToBorderBoxTransform to map an element from SVG viewport |
- // coordinates to CSS box coordinates. |
- if (layout_object->IsSVGRoot()) { |
- transform.Multiply( |
- ToLayoutSVGRoot(layout_object)->LocalToBorderBoxTransform()); |
- } |
- } |
- // Drop any potential non-affine parts, because we're not able to convey that |
- // information further anyway until getScreenCTM returns a DOMMatrix (4x4 |
- // matrix.) |
- return transform.ToAffineTransform(); |
+ return ComputeCTM(kScreenScope, style_update_strategy); |
} |
SVGMatrixTearOff* SVGGraphicsElement::getCTMFromJavascript() { |