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

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

Issue 2204503002: ResizeObserver pt6: integration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore missing code that was blown away by rebase Created 4 years, 4 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) 2011 University of Szeged 2 * Copyright (C) 2011 University of Szeged
3 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> 3 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 m_fillBoundingBox = FloatRect( 78 m_fillBoundingBox = FloatRect(
79 FloatPoint( 79 FloatPoint(
80 lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(), SVGLengthMode::Width), 80 lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(), SVGLengthMode::Width),
81 lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(), SVGLengthMode::Height)), 81 lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(), SVGLengthMode::Height)),
82 boundingBoxSize); 82 boundingBoxSize);
83 m_strokeBoundingBox = m_fillBoundingBox; 83 m_strokeBoundingBox = m_fillBoundingBox;
84 if (style()->svgStyle().hasStroke()) 84 if (style()->svgStyle().hasStroke())
85 m_strokeBoundingBox.inflate(strokeWidth() / 2); 85 m_strokeBoundingBox.inflate(strokeWidth() / 2);
86 if (element())
87 element()->setNeedsResizeObserverUpdate();
86 } 88 }
87 89
88 bool LayoutSVGRect::shapeDependentStrokeContains(const FloatPoint& point) 90 bool LayoutSVGRect::shapeDependentStrokeContains(const FloatPoint& point)
89 { 91 {
90 // The optimized code below does not support non-simple strokes so we need 92 // The optimized code below does not support non-simple strokes so we need
91 // to fall back to LayoutSVGShape::shapeDependentStrokeContains in these cas es. 93 // to fall back to LayoutSVGShape::shapeDependentStrokeContains in these cas es.
92 if (m_usePathFallback || !definitelyHasSimpleStroke()) { 94 if (m_usePathFallback || !definitelyHasSimpleStroke()) {
93 if (!hasPath()) 95 if (!hasPath())
94 LayoutSVGShape::updateShapeFromElement(); 96 LayoutSVGShape::updateShapeFromElement();
95 return LayoutSVGShape::shapeDependentStrokeContains(point); 97 return LayoutSVGShape::shapeDependentStrokeContains(point);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // An approximation of sqrt(2) is used here because at certain precise 139 // An approximation of sqrt(2) is used here because at certain precise
138 // miterlimits, the join style used might not be correct (e.g. a miterlimit 140 // miterlimits, the join style used might not be correct (e.g. a miterlimit
139 // of 1.4142135 should result in bevel joins, but may be drawn using miter 141 // of 1.4142135 should result in bevel joins, but may be drawn using miter
140 // joins). 142 // joins).
141 return svgStyle.strokeDashArray()->isEmpty() 143 return svgStyle.strokeDashArray()->isEmpty()
142 && svgStyle.joinStyle() == MiterJoin 144 && svgStyle.joinStyle() == MiterJoin
143 && svgStyle.strokeMiterLimit() >= 1.5; 145 && svgStyle.strokeMiterLimit() >= 1.5;
144 } 146 }
145 147
146 } // namespace blink 148 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698