| 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/ListMarkerPainter.h" | 6 #include "core/paint/ListMarkerPainter.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutListItem.h" | 8 #include "core/layout/LayoutListItem.h" |
| 9 #include "core/layout/LayoutListMarker.h" | 9 #include "core/layout/LayoutListMarker.h" |
| 10 #include "core/layout/PaintInfo.h" | 10 #include "core/layout/PaintInfo.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 IntRect marker = m_layoutListMarker.getRelativeMarkerRect(); | 45 IntRect marker = m_layoutListMarker.getRelativeMarkerRect(); |
| 46 marker.moveBy(roundedIntPoint(boxOrigin)); | 46 marker.moveBy(roundedIntPoint(boxOrigin)); |
| 47 | 47 |
| 48 GraphicsContext* context = paintInfo.context; | 48 GraphicsContext* context = paintInfo.context; |
| 49 | 49 |
| 50 if (m_layoutListMarker.isImage()) { | 50 if (m_layoutListMarker.isImage()) { |
| 51 context->drawImage(m_layoutListMarker.image()->image(&m_layoutListMarker
, marker.size()).get(), marker); | 51 context->drawImage(m_layoutListMarker.image()->image(&m_layoutListMarker
, marker.size()).get(), marker); |
| 52 if (m_layoutListMarker.selectionState() != LayoutObject::SelectionNone)
{ | 52 if (m_layoutListMarker.selectionState() != LayoutObject::SelectionNone)
{ |
| 53 LayoutRect selRect = m_layoutListMarker.localSelectionRect(); | 53 LayoutRect selRect = m_layoutListMarker.localSelectionRect(); |
| 54 selRect.moveBy(boxOrigin); | 54 selRect.moveBy(boxOrigin); |
| 55 context->fillRect(pixelSnappedIntRect(selRect), m_layoutListMarker.s
electionBackgroundColor()); | 55 context->fillRect(pixelSnappedIntRect(selRect), m_layoutListMarker.l
istItem()->selectionBackgroundColor()); |
| 56 } | 56 } |
| 57 return; | 57 return; |
| 58 } | 58 } |
| 59 | 59 |
| 60 if (m_layoutListMarker.selectionState() != LayoutObject::SelectionNone) { | 60 if (m_layoutListMarker.selectionState() != LayoutObject::SelectionNone) { |
| 61 LayoutRect selRect = m_layoutListMarker.localSelectionRect(); | 61 LayoutRect selRect = m_layoutListMarker.localSelectionRect(); |
| 62 selRect.moveBy(boxOrigin); | 62 selRect.moveBy(boxOrigin); |
| 63 context->fillRect(pixelSnappedIntRect(selRect), m_layoutListMarker.selec
tionBackgroundColor()); | 63 context->fillRect(pixelSnappedIntRect(selRect), m_layoutListMarker.listI
tem()->selectionBackgroundColor()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 const Color color(m_layoutListMarker.resolveColor(CSSPropertyColor)); | 66 const Color color(m_layoutListMarker.resolveColor(CSSPropertyColor)); |
| 67 context->setStrokeColor(color); | 67 context->setStrokeColor(color); |
| 68 context->setStrokeStyle(SolidStroke); | 68 context->setStrokeStyle(SolidStroke); |
| 69 context->setStrokeThickness(1.0f); | 69 context->setStrokeThickness(1.0f); |
| 70 context->setFillColor(color); | 70 context->setFillColor(color); |
| 71 | 71 |
| 72 EListStyleType type = m_layoutListMarker.style()->listStyleType(); | 72 EListStyleType type = m_layoutListMarker.style()->listStyleType(); |
| 73 switch (type) { | 73 switch (type) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 context->drawText(font, textRunPaintInfo, textOrigin); | 211 context->drawText(font, textRunPaintInfo, textOrigin); |
| 212 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.wid
th(textRun), 0)); | 212 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.wid
th(textRun), 0)); |
| 213 } else { | 213 } else { |
| 214 context->drawText(font, suffixRunInfo, textOrigin); | 214 context->drawText(font, suffixRunInfo, textOrigin); |
| 215 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font.
width(suffixRun), 0)); | 215 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font.
width(suffixRun), 0)); |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 | 219 |
| 220 } // namespace blink | 220 } // namespace blink |
| OLD | NEW |