| Index: third_party/WebKit/Source/core/paint/ListMarkerPainter.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/ListMarkerPainter.cpp b/third_party/WebKit/Source/core/paint/ListMarkerPainter.cpp
|
| index abc82dee2f29018b99e3da56fcc5dfa82b69e771..ee0612eb2730d7434351694a0228892833dd7965 100644
|
| --- a/third_party/WebKit/Source/core/paint/ListMarkerPainter.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/ListMarkerPainter.cpp
|
| @@ -58,88 +58,22 @@ void ListMarkerPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& pai
|
| return;
|
| }
|
|
|
| - if (m_layoutListMarker.selectionState() != SelectionNone) {
|
| + if (!RuntimeEnabledFeatures::selectionPaintingWithoutSelectionGapsEnabled()
|
| + && m_layoutListMarker.selectionState() != SelectionNone) {
|
| LayoutRect selRect = m_layoutListMarker.localSelectionRect();
|
| selRect.moveBy(boxOrigin);
|
| context->fillRect(pixelSnappedIntRect(selRect), m_layoutListMarker.listItem()->selectionBackgroundColor());
|
| }
|
|
|
| - const Color color(m_layoutListMarker.resolveColor(CSSPropertyColor));
|
| - context->setStrokeColor(color);
|
| - context->setStrokeStyle(SolidStroke);
|
| - context->setStrokeThickness(1.0f);
|
| - context->setFillColor(color);
|
| -
|
| - EListStyleType type = m_layoutListMarker.style()->listStyleType();
|
| - switch (type) {
|
| - case Disc:
|
| - context->fillEllipse(marker);
|
| - return;
|
| - case Circle:
|
| - context->strokeEllipse(marker);
|
| - return;
|
| - case Square:
|
| - context->fillRect(marker);
|
| - return;
|
| - case NoneListStyle:
|
| + EListStyleType listStyle = m_layoutListMarker.style()->listStyleType();
|
| + if (listStyle == NoneListStyle)
|
| return;
|
| - case ArabicIndic:
|
| - case Armenian:
|
| - case Bengali:
|
| - case Cambodian:
|
| - case CJKIdeographic:
|
| - case CjkEarthlyBranch:
|
| - case CjkHeavenlyStem:
|
| - case DecimalLeadingZero:
|
| - case DecimalListStyle:
|
| - case Devanagari:
|
| - case EthiopicHalehame:
|
| - case EthiopicHalehameAm:
|
| - case EthiopicHalehameTiEr:
|
| - case EthiopicHalehameTiEt:
|
| - case Georgian:
|
| - case Gujarati:
|
| - case Gurmukhi:
|
| - case Hebrew:
|
| - case Hangul:
|
| - case HangulConsonant:
|
| - case KoreanHangulFormal:
|
| - case KoreanHanjaFormal:
|
| - case KoreanHanjaInformal:
|
| - case Hiragana:
|
| - case HiraganaIroha:
|
| - case Kannada:
|
| - case Katakana:
|
| - case KatakanaIroha:
|
| - case Khmer:
|
| - case Lao:
|
| - case LowerAlpha:
|
| - case LowerArmenian:
|
| - case LowerGreek:
|
| - case LowerLatin:
|
| - case LowerRoman:
|
| - case Malayalam:
|
| - case Mongolian:
|
| - case Myanmar:
|
| - case Oriya:
|
| - case Persian:
|
| - case SimpChineseFormal:
|
| - case SimpChineseInformal:
|
| - case Telugu:
|
| - case Thai:
|
| - case Tibetan:
|
| - case TradChineseFormal:
|
| - case TradChineseInformal:
|
| - case UpperAlpha:
|
| - case UpperArmenian:
|
| - case UpperLatin:
|
| - case UpperRoman:
|
| - case Urdu:
|
| - break;
|
| - }
|
| if (m_layoutListMarker.text().isEmpty())
|
| return;
|
|
|
| + const Color color(m_layoutListMarker.resolveColor(CSSPropertyColor));
|
| + context->setFillColor(color);
|
| +
|
| const Font& font = m_layoutListMarker.style()->font();
|
| TextRun textRun = constructTextRun(font, m_layoutListMarker.text(), m_layoutListMarker.styleRef());
|
|
|
| @@ -171,9 +105,18 @@ void ListMarkerPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& pai
|
| textRun.setText(reversedText.toString());
|
| }
|
|
|
| - const UChar suffix = m_layoutListMarker.listMarkerSuffix(type, m_layoutListMarker.listItem()->value());
|
| - UChar suffixStr[2] = { suffix, static_cast<UChar>(' ') };
|
| - TextRun suffixRun = constructTextRun(font, suffixStr, 2, m_layoutListMarker.styleRef(), m_layoutListMarker.style()->direction());
|
| + const UChar suffix = m_layoutListMarker.listMarkerSuffix(listStyle, m_layoutListMarker.listItem()->value());
|
| + UChar suffixStr[2];
|
| + suffixStr[0] = suffix;
|
| + int suffixLength = 1;
|
| + // For lists with symbol style, the suffix is a space. For language styles, the suffix is a
|
| + // language-specific character which is then followed by an additional space.
|
| + // TODO(wkorman): Review everywhere we do this and see if we can consolidate logic.
|
| + if (m_layoutListMarker.listStyleCategory() == LayoutListMarker::LanguageListCategory) {
|
| + suffixStr[1] = static_cast<UChar>(' ');
|
| + suffixLength = 2;
|
| + }
|
| + TextRun suffixRun = constructTextRun(font, suffixStr, suffixLength, m_layoutListMarker.styleRef(), m_layoutListMarker.style()->direction());
|
| TextRunPaintInfo suffixRunInfo(suffixRun);
|
| suffixRunInfo.bounds = marker;
|
|
|
|
|