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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGForeignObject.cpp

Issue 2778873002: Reland "Let SVGForeignObject's local SVG coordinates mean what it should" (Closed)
Patch Set: Fix Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * Copyright (C) 2009 Google, Inc. 3 * Copyright (C) 2009 Google, Inc.
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 28 matching lines...) Expand all
39 // Disallow arbitary SVG content. Only allow proper <svg xmlns="svgNS"> 39 // Disallow arbitary SVG content. Only allow proper <svg xmlns="svgNS">
40 // subdocuments. 40 // subdocuments.
41 return !child->isSVGChild(); 41 return !child->isSVGChild();
42 } 42 }
43 43
44 void LayoutSVGForeignObject::paint(const PaintInfo& paintInfo, 44 void LayoutSVGForeignObject::paint(const PaintInfo& paintInfo,
45 const LayoutPoint&) const { 45 const LayoutPoint&) const {
46 SVGForeignObjectPainter(*this).paint(paintInfo); 46 SVGForeignObjectPainter(*this).paint(paintInfo);
47 } 47 }
48 48
49 AffineTransform LayoutSVGForeignObject::localToSVGParentTransform() const {
50 // Unlike other viewport-defining SVG objects, here localSVGTransform applies
51 // to the viewport offset.
52 return localSVGTransform() *
53 AffineTransform::translation(location().x(), location().y());
54 }
55
56 LayoutUnit LayoutSVGForeignObject::elementX() const { 49 LayoutUnit LayoutSVGForeignObject::elementX() const {
57 return LayoutUnit( 50 return LayoutUnit(
58 roundf(SVGLengthContext(toSVGElement(node())) 51 roundf(SVGLengthContext(toSVGElement(node()))
59 .valueForLength(styleRef().svgStyle().x(), styleRef(), 52 .valueForLength(styleRef().svgStyle().x(), styleRef(),
60 SVGLengthMode::Width))); 53 SVGLengthMode::Width)));
61 } 54 }
62 55
63 LayoutUnit LayoutSVGForeignObject::elementY() const { 56 LayoutUnit LayoutSVGForeignObject::elementY() const {
64 return LayoutUnit( 57 return LayoutUnit(
65 roundf(SVGLengthContext(toSVGElement(node())) 58 roundf(SVGLengthContext(toSVGElement(node()))
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 HitTestLocation hitTestLocation(localPoint); 146 HitTestLocation hitTestLocation(localPoint);
154 return LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), 147 return LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(),
155 HitTestForeground) || 148 HitTestForeground) ||
156 LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), 149 LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(),
157 HitTestFloat) || 150 HitTestFloat) ||
158 LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), 151 LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(),
159 HitTestChildBlockBackgrounds); 152 HitTestChildBlockBackgrounds);
160 } 153 }
161 154
162 } // namespace blink 155 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698