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

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

Issue 220853002: SVG does not respect overflow:visible. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/svg/RenderSVGRoot.h ('k') | Source/core/rendering/svg/SVGRenderSupport.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGRoot.cpp
diff --git a/Source/core/rendering/svg/RenderSVGRoot.cpp b/Source/core/rendering/svg/RenderSVGRoot.cpp
index f63f5f9a8c9583b583577bff16721aabd575d66e..b8ed55f1db63e3156d0b0fd9edc3be8fbc9c4ad1 100644
--- a/Source/core/rendering/svg/RenderSVGRoot.cpp
+++ b/Source/core/rendering/svg/RenderSVGRoot.cpp
@@ -228,6 +228,12 @@ void RenderSVGRoot::layout()
clearNeedsLayout();
}
+bool RenderSVGRoot::applyViewportClip() const
esprehn 2014/04/05 20:19:22 this should be named with an "is" or "should" pref
+{
+ // the outermost svg is clipped if auto, and svg document roots are always clipped
+ return style()->overflowX() == OHIDDEN || style()->overflowX() == OAUTO || this->isRoot();
+}
+
void RenderSVGRoot::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
// An empty viewport disables rendering.
@@ -256,8 +262,9 @@ void RenderSVGRoot::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paint
PaintInfo childPaintInfo(paintInfo);
childPaintInfo.context->save();
- // Apply initial viewport clip - not affected by overflow handling
- childPaintInfo.context->clip(pixelSnappedIntRect(overflowClipRect(paintOffset)));
+ // Apply initial viewport clip
+ if (applyViewportClip())
+ childPaintInfo.context->clip(pixelSnappedIntRect(overflowClipRect(paintOffset)));
// Convert from container offsets (html renderers) to a relative transform (svg renderers).
// Transform from our paint container's coordinate system to our local coords.
@@ -364,8 +371,9 @@ void RenderSVGRoot::computeFloatRectForRepaint(const RenderLayerModelObject* rep
// and then call RenderBox's method to handle all the normal CSS Box model bits
repaintRect = m_localToBorderBoxTransform.mapRect(repaintRect);
- // Apply initial viewport clip - not affected by overflow settings
- repaintRect.intersect(pixelSnappedBorderBoxRect());
+ // Apply initial viewport clip
+ if (applyViewportClip())
+ repaintRect.intersect(pixelSnappedBorderBoxRect());
LayoutRect rect = enclosingIntRect(repaintRect);
RenderReplaced::computeRectForRepaint(repaintContainer, rect, fixed);
« no previous file with comments | « Source/core/rendering/svg/RenderSVGRoot.h ('k') | Source/core/rendering/svg/SVGRenderSupport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698