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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp

Issue 2131803002: Ensure SVG PaintOffset is reset at the HTML/SVG boundary [spv2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sdflj Created 4 years, 5 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PaintPropertyTreeBuilder.h" 5 #include "core/paint/PaintPropertyTreeBuilder.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/layout/LayoutInline.h" 10 #include "core/layout/LayoutInline.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 context.currentTransform = perspective.get(); 256 context.currentTransform = perspective.get();
257 object.getMutableForPainting().ensureObjectPaintProperties().setPerspective( perspective.release()); 257 object.getMutableForPainting().ensureObjectPaintProperties().setPerspective( perspective.release());
258 } 258 }
259 259
260 void PaintPropertyTreeBuilder::updateSvgLocalToBorderBoxTransform(const LayoutOb ject& object, PaintPropertyTreeBuilderContext& context) 260 void PaintPropertyTreeBuilder::updateSvgLocalToBorderBoxTransform(const LayoutOb ject& object, PaintPropertyTreeBuilderContext& context)
261 { 261 {
262 if (!object.isSVGRoot()) 262 if (!object.isSVGRoot())
263 return; 263 return;
264 264
265 AffineTransform transformToBorderBox = SVGRootPainter(toLayoutSVGRoot(object )).transformToPixelSnappedBorderBox(context.paintOffset); 265 AffineTransform transformToBorderBox = SVGRootPainter(toLayoutSVGRoot(object )).transformToPixelSnappedBorderBox(context.paintOffset);
266
267 // The paint offset is included in |transformToBorderBox| so SVG does not ne ed to handle paint
268 // offset internally.
269 context.paintOffset = LayoutPoint();
270
266 if (transformToBorderBox.isIdentity()) 271 if (transformToBorderBox.isIdentity())
267 return; 272 return;
268 273
269 RefPtr<TransformPaintPropertyNode> svgLocalToBorderBoxTransform = TransformP aintPropertyNode::create( 274 RefPtr<TransformPaintPropertyNode> svgLocalToBorderBoxTransform = TransformP aintPropertyNode::create(
270 transformToBorderBox, FloatPoint3D(0, 0, 0), context.currentTransform); 275 transformToBorderBox, FloatPoint3D(0, 0, 0), context.currentTransform);
271 context.currentTransform = svgLocalToBorderBoxTransform.get(); 276 context.currentTransform = svgLocalToBorderBoxTransform.get();
272 context.paintOffset = LayoutPoint(); 277 context.paintOffset = LayoutPoint();
273 object.getMutableForPainting().ensureObjectPaintProperties().setSvgLocalToBo rderBoxTransform(svgLocalToBorderBoxTransform.release()); 278 object.getMutableForPainting().ensureObjectPaintProperties().setSvgLocalToBo rderBoxTransform(svgLocalToBorderBoxTransform.release());
274 } 279 }
275 280
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 updateOverflowClip(object, context); 408 updateOverflowClip(object, context);
404 // TODO(trchen): Insert flattening transform here, as specified by 409 // TODO(trchen): Insert flattening transform here, as specified by
405 // http://www.w3.org/TR/css3-transforms/#transform-style-property 410 // http://www.w3.org/TR/css3-transforms/#transform-style-property
406 updatePerspective(object, context); 411 updatePerspective(object, context);
407 updateSvgLocalToBorderBoxTransform(object, context); 412 updateSvgLocalToBorderBoxTransform(object, context);
408 updateScrollTranslation(object, context); 413 updateScrollTranslation(object, context);
409 updateOutOfFlowContext(object, context); 414 updateOutOfFlowContext(object, context);
410 } 415 }
411 416
412 } // namespace blink 417 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698