| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/FieldsetPainter.h" | 6 #include "core/paint/FieldsetPainter.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutFieldset.h" | 8 #include "core/layout/LayoutFieldset.h" |
| 9 #include "core/paint/BoxDecorationData.h" | 9 #include "core/paint/BoxDecorationData.h" |
| 10 #include "core/paint/BoxPainter.h" | 10 #include "core/paint/BoxPainter.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 if (recorder.canUseCachedDrawing()) | 40 if (recorder.canUseCachedDrawing()) |
| 41 return; | 41 return; |
| 42 | 42 |
| 43 BoxDecorationData boxDecorationData(m_layoutFieldset); | 43 BoxDecorationData boxDecorationData(m_layoutFieldset); |
| 44 | 44 |
| 45 if (boxDecorationData.bleedAvoidance == BackgroundBleedNone) | 45 if (boxDecorationData.bleedAvoidance == BackgroundBleedNone) |
| 46 BoxPainter::paintBoxShadow(paintInfo, paintRect, m_layoutFieldset.styleR
ef(), Normal); | 46 BoxPainter::paintBoxShadow(paintInfo, paintRect, m_layoutFieldset.styleR
ef(), Normal); |
| 47 BoxPainter(m_layoutFieldset).paintFillLayers(paintInfo, boxDecorationData.ba
ckgroundColor, m_layoutFieldset.style()->backgroundLayers(), paintRect); | 47 BoxPainter(m_layoutFieldset).paintFillLayers(paintInfo, boxDecorationData.ba
ckgroundColor, m_layoutFieldset.style()->backgroundLayers(), paintRect); |
| 48 BoxPainter::paintBoxShadow(paintInfo, paintRect, m_layoutFieldset.styleRef()
, Inset); | 48 BoxPainter::paintBoxShadow(paintInfo, paintRect, m_layoutFieldset.styleRef()
, Inset); |
| 49 | 49 |
| 50 if (!boxDecorationData.hasBorder) | 50 if (!boxDecorationData.hasBorderDecoration) |
| 51 return; | 51 return; |
| 52 | 52 |
| 53 // Create a clipping region around the legend and paint the border as normal | 53 // Create a clipping region around the legend and paint the border as normal |
| 54 GraphicsContext* graphicsContext = paintInfo.context; | 54 GraphicsContext* graphicsContext = paintInfo.context; |
| 55 GraphicsContextStateSaver stateSaver(*graphicsContext); | 55 GraphicsContextStateSaver stateSaver(*graphicsContext); |
| 56 | 56 |
| 57 // FIXME: We need to work with "rl" and "bt" block flow directions. In thos
e | 57 // FIXME: We need to work with "rl" and "bt" block flow directions. In thos
e |
| 58 // cases the legend is embedded in the right and bottom borders respectively
. | 58 // cases the legend is embedded in the right and bottom borders respectively
. |
| 59 // https://bugs.webkit.org/show_bug.cgi?id=47236 | 59 // https://bugs.webkit.org/show_bug.cgi?id=47236 |
| 60 if (m_layoutFieldset.style()->isHorizontalWritingMode()) { | 60 if (m_layoutFieldset.style()->isHorizontalWritingMode()) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 90 } else { | 90 } else { |
| 91 LayoutUnit xOff = (legend->location().x() > 0) ? LayoutUnit() : (legend-
>size().width() - m_layoutFieldset.borderLeft()) / 2; | 91 LayoutUnit xOff = (legend->location().x() > 0) ? LayoutUnit() : (legend-
>size().width() - m_layoutFieldset.borderLeft()) / 2; |
| 92 paintRect.expand(-xOff, 0); | 92 paintRect.expand(-xOff, 0); |
| 93 paintRect.move(xOff, 0); | 93 paintRect.move(xOff, 0); |
| 94 } | 94 } |
| 95 | 95 |
| 96 BoxPainter(m_layoutFieldset).paintMaskImages(paintInfo, paintRect); | 96 BoxPainter(m_layoutFieldset).paintMaskImages(paintInfo, paintRect); |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |