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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 2273733002: Use border-box as the reference box for (-webkit-)clip-path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New baselines 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/masking/clip-path-reference-box-inline-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index 47081025b31481acb85edf3d85c931d63a51846f..875b47ab6432330d1d0aa7ed15925277128e0359 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -5,6 +5,7 @@
#include "core/paint/PaintLayerPainter.h"
#include "core/frame/LocalFrame.h"
+#include "core/layout/LayoutInline.h"
#include "core/layout/LayoutView.h"
#include "core/paint/ClipPathClipper.h"
#include "core/paint/FilterPainter.h"
@@ -180,6 +181,14 @@ static bool shouldRepaintSubsequence(PaintLayer& paintLayer, const PaintLayerPai
return needsRepaint;
}
+static LayoutRect computeReferenceBox(const LayoutBoxModelObject& boxModelObject)
+{
+ if (boxModelObject.isLayoutInline())
+ return toLayoutInline(boxModelObject).linesBoundingBox();
+ SECURITY_DCHECK(boxModelObject.isBox());
+ return toLayoutBox(boxModelObject).borderBoxRect();
+}
+
PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerContents(GraphicsContext& context, const PaintLayerPaintingInfo& paintingInfoArg, PaintLayerFlags paintFlags, FragmentPolicy fragmentPolicy)
{
ASSERT(m_paintLayer.isSelfPaintingLayer() || m_paintLayer.hasSelfPaintingLayerDescendant());
@@ -253,9 +262,10 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerContents(GraphicsCon
rootRelativeBoundsComputed = true;
}
paintingInfo.ancestorHasClipPathClipping = true;
- FloatRect floatRootRelativeBounds(rootRelativeBounds);
+ LayoutRect referenceBox(computeReferenceBox(*m_paintLayer.layoutObject()));
+ referenceBox.moveBy(offsetFromRoot);
clipPathClipper.emplace(
- context, *m_paintLayer.layoutObject(), floatRootRelativeBounds, floatRootRelativeBounds, FloatPoint(offsetFromRoot));
+ context, *m_paintLayer.layoutObject(), FloatRect(referenceBox), FloatRect(rootRelativeBounds), FloatPoint(offsetFromRoot));
}
Optional<CompositingRecorder> compositingRecorder;
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/masking/clip-path-reference-box-inline-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698