Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(649)

Unified Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp

Issue 2512493003: Avoid special handling of LayoutSVGForeignObject about its paint offset (Closed)
Patch Set: - Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
index 2ca46226fd107407f6a2125a858841a3d2dd0040..0e5870618251927ea94cc1d9fcd72106309c8b48 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -262,16 +262,11 @@ void PaintPropertyTreeBuilder::updateTransformForNonRootSVG(
const LayoutObject& object,
PaintPropertyTreeBuilderContext& context) {
DCHECK(object.isSVG() && !object.isSVGRoot());
- // SVG (other than SVGForeignObject) does not use paint offset internally.
- DCHECK(object.isSVGForeignObject() ||
- context.current.paintOffset == LayoutPoint());
+ // SVG does not use paint offset internally.
+ DCHECK(context.current.paintOffset == LayoutPoint());
if (object.needsPaintPropertyUpdate()) {
- // TODO(pdr): Refactor this so all non-root SVG objects use the same
- // transform function.
- const AffineTransform& transform = object.isSVGForeignObject()
- ? object.localSVGTransform()
- : object.localToSVGParentTransform();
+ const AffineTransform& transform = object.localToSVGParentTransform();
// TODO(pdr): Check for the presence of a transform instead of the value.
// Checking for an identity matrix will cause the property tree structure
// to change during animations if the animation passes through the
@@ -855,12 +850,8 @@ static void deriveBorderBoxFromContainerContext(
ASSERT_NOT_REACHED();
}
- // SVGForeignObject needs paint offset because its viewport offset is baked
- // into its location(), while its localSVGTransform() doesn't contain the
- // offset.
if (boxModelObject.isBox() &&
- (!boxModelObject.isSVG() || boxModelObject.isSVGRoot() ||
- boxModelObject.isSVGForeignObject())) {
+ (!boxModelObject.isSVG() || boxModelObject.isSVGRoot())) {
// TODO(pdr): Several calls in this function walk back up the tree to
// calculate containers (e.g., topLeftLocation, offsetForInFlowPosition*).
// The containing block and other containers can be stored on

Powered by Google App Engine
This is Rietveld 408576698