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

Unified Diff: Source/core/rendering/svg/RenderSVGImage.cpp

Issue 261773008: [SVG2] css 'outline' property should apply to svg elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use Ahem instead Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/svg/RenderSVGContainer.cpp ('k') | Source/core/rendering/svg/RenderSVGRoot.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGImage.cpp
diff --git a/Source/core/rendering/svg/RenderSVGImage.cpp b/Source/core/rendering/svg/RenderSVGImage.cpp
index 4efac7e29b9eb638f86fc41a75e8384ef9c39d63..27c808e3226cb9e53ad543c0aaa750a23051a7fe 100644
--- a/Source/core/rendering/svg/RenderSVGImage.cpp
+++ b/Source/core/rendering/svg/RenderSVGImage.cpp
@@ -124,7 +124,10 @@ void RenderSVGImage::paint(PaintInfo& paintInfo, const LayoutPoint&)
{
ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this);
- if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || !m_imageResource->hasImage())
+ if (paintInfo.context->paintingDisabled()
+ || paintInfo.phase != PaintPhaseForeground
+ || style()->visibility() == HIDDEN
+ || !m_imageResource->hasImage())
return;
FloatRect boundingBox = repaintRectInLocalCoordinates();
@@ -132,29 +135,27 @@ void RenderSVGImage::paint(PaintInfo& paintInfo, const LayoutPoint&)
return;
PaintInfo childPaintInfo(paintInfo);
- bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline);
- if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) {
- GraphicsContextStateSaver stateSaver(*childPaintInfo.context, false);
- if (!m_localTransform.isIdentity()) {
- stateSaver.save();
- childPaintInfo.applyTransform(m_localTransform, false);
- }
- if (childPaintInfo.phase == PaintPhaseForeground && !m_objectBoundingBox.isEmpty()) {
- // SVGRenderingContext may taint the state - make sure we're always saving.
- SVGRenderingContext renderingContext(this, childPaintInfo, stateSaver.saved() ?
- SVGRenderingContext::DontSaveGraphicsContext : SVGRenderingContext::SaveGraphicsContext);
+ GraphicsContextStateSaver stateSaver(*childPaintInfo.context, false);
- if (renderingContext.isRenderingPrepared()) {
- if (style()->svgStyle()->bufferedRendering() == BR_STATIC && renderingContext.bufferForeground(m_bufferedForeground))
- return;
+ if (!m_localTransform.isIdentity()) {
+ stateSaver.save();
+ childPaintInfo.applyTransform(m_localTransform, false);
+ }
+ if (!m_objectBoundingBox.isEmpty()) {
+ // SVGRenderingContext may taint the state - make sure we're always saving.
+ SVGRenderingContext renderingContext(this, childPaintInfo, stateSaver.saved() ?
+ SVGRenderingContext::DontSaveGraphicsContext : SVGRenderingContext::SaveGraphicsContext);
- paintForeground(childPaintInfo);
- }
- }
+ if (renderingContext.isRenderingPrepared()) {
+ if (style()->svgStyle()->bufferedRendering() == BR_STATIC && renderingContext.bufferForeground(m_bufferedForeground))
+ return;
- if (drawsOutline)
- paintOutline(childPaintInfo, IntRect(boundingBox));
+ paintForeground(childPaintInfo);
+ }
}
+
+ if (style()->outlineWidth())
+ paintOutline(childPaintInfo, IntRect(boundingBox));
}
void RenderSVGImage::paintForeground(PaintInfo& paintInfo)
« no previous file with comments | « Source/core/rendering/svg/RenderSVGContainer.cpp ('k') | Source/core/rendering/svg/RenderSVGRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698