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

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

Issue 1586723003: Fix a bad cast in PaintLayerClipper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build Created 4 years, 11 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
Index: third_party/WebKit/Source/core/paint/InlineFlowBoxPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/InlineFlowBoxPainter.cpp b/third_party/WebKit/Source/core/paint/InlineFlowBoxPainter.cpp
index b6074efc6f7e2826876579fc4f38a4e0a0223028..cbbc283eff3351ff26918148003788ec14246803 100644
--- a/third_party/WebKit/Source/core/paint/InlineFlowBoxPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/InlineFlowBoxPainter.cpp
@@ -179,6 +179,17 @@ InlineFlowBoxPainter::BorderPaintingType InlineFlowBoxPainter::getBorderPaintTyp
return DontPaintBorders;
}
+void InlineFlowBoxPainter::paintBoxShadowAndFillLayers(const PaintInfo& paintInfo, const ComputedStyle& style, LayoutRect& paintRect)
+{
+ // Shadow comes first and is behind the background and border.
+ if (!m_inlineFlowBox.boxModelObject().boxShadowShouldBeAppliedToBackground(BackgroundBleedNone, &m_inlineFlowBox))
+ paintBoxShadow(paintInfo, style, Normal, paintRect);
+
+ Color backgroundColor = m_inlineFlowBox.layoutObject().resolveColor(style, CSSPropertyBackgroundColor);
+ paintFillLayers(paintInfo, backgroundColor, style.backgroundLayers(), paintRect);
+ paintBoxShadow(paintInfo, style, Inset, paintRect);
+}
+
void InlineFlowBoxPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo, const LayoutPoint& paintOffset, const LayoutRect& cullRect)
{
ASSERT(paintInfo.phase == PaintPhaseForeground);
@@ -214,13 +225,13 @@ void InlineFlowBoxPainter::paintBoxDecorationBackground(const PaintInfo& paintIn
IntRect adjustedClipRect;
BorderPaintingType borderPaintingType = getBorderPaintType(adjustedFrameRect, adjustedClipRect);
- // Shadow comes first and is behind the background and border.
- if (!m_inlineFlowBox.boxModelObject().boxShadowShouldBeAppliedToBackground(BackgroundBleedNone, &m_inlineFlowBox))
- paintBoxShadow(paintInfo, *styleToUse, Normal, adjustedFrameRect);
-
- Color backgroundColor = m_inlineFlowBox.layoutObject().resolveColor(*styleToUse, CSSPropertyBackgroundColor);
- paintFillLayers(paintInfo, backgroundColor, styleToUse->backgroundLayers(), adjustedFrameRect);
- paintBoxShadow(paintInfo, *styleToUse, Inset, adjustedFrameRect);
+ if (m_inlineFlowBox.lineLayoutItem().style()->containsPaint()) {
+ GraphicsContextStateSaver stateSaver(paintInfo.context);
+ paintInfo.context.clip(adjustedClipRect);
+ paintBoxShadowAndFillLayers(paintInfo, *styleToUse, adjustedFrameRect);
chrishtr 2016/01/14 18:32:56 Why is it just box shadow and fill layers of inlin
+ } else {
+ paintBoxShadowAndFillLayers(paintInfo, *styleToUse, adjustedFrameRect);
+ }
switch (borderPaintingType) {
case DontPaintBorders:

Powered by Google App Engine
This is Rietveld 408576698