Chromium Code Reviews| 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: |