⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 233814 in webkit


Ignore:
Timestamp:
Jul 13, 2018, 1:34:24 PM (8 years ago)
Author:
graouts@webkit.org
Message:

Dark Mode: document markers are difficult to see
​https://bugs.webkit.org/show_bug.cgi?id=187632
<rdar://problem/41099719>

Reviewed by Simon Fraser.

We update the way we draw the document markers for macOS and use more constrasting colors in dark mode.
Paving the way for future improvements, we move the drawLineForDocumentMarker() method from GraphicsContext
to RenderTheme and implement a first version in RenderThemeMac. The circles used for the underline are now
drawn directly with Core Graphics and we no longer use an image resource. To allow both GraphicsContext
and RenderTheme to have different versions of the drawLineForDocumentMarker() method, the DocumentMarkerLineStyle
enum is now an "enum class".

No new test due to webkit.org/b/105616, webkit.org/b/187655 was raised to track the creation of new tests
when it becomes possible again.

  • platform/graphics/GraphicsContext.h:
  • platform/graphics/GraphicsContextImpl.h:
  • platform/graphics/cairo/CairoOperations.cpp:

(WebCore::Cairo::drawLineForDocumentMarker):

  • platform/graphics/cairo/CairoOperations.h:
  • platform/graphics/cairo/GraphicsContextImplCairo.cpp:

(WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker):

  • platform/graphics/cairo/GraphicsContextImplCairo.h:
  • platform/graphics/cocoa/GraphicsContextCocoa.mm:

(WebCore::GraphicsContext::drawLineForDocumentMarker):

  • platform/graphics/displaylists/DisplayListItems.h:

(WebCore::DisplayList::DrawLineForDocumentMarker::create):
(WebCore::DisplayList::DrawLineForDocumentMarker::DrawLineForDocumentMarker):

  • platform/graphics/displaylists/DisplayListRecorder.cpp:

(WebCore::DisplayList::Recorder::drawLineForDocumentMarker):

  • platform/graphics/displaylists/DisplayListRecorder.h:
  • platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:

(Nicosia::CairoOperationRecorder::drawLineForDocumentMarker):

  • platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
  • platform/graphics/win/GraphicsContextCGWin.cpp:

(WebCore::GraphicsContext::drawLineForDocumentMarker):

  • rendering/InlineTextBox.cpp:

(WebCore::InlineTextBox::paintPlatformDocumentMarker): Call drawLineForDocumentMarker() on the RenderTheme on
macOS and on GraphicsContext in all other cases.

  • rendering/RenderTheme.cpp:

(WebCore::RenderTheme::drawLineForDocumentMarker):

  • rendering/RenderTheme.h:
  • rendering/RenderThemeMac.h:
  • rendering/RenderThemeMac.mm:

(WebCore::colorForStyle): Provide different colors for light and dark modes.
(WebCore::RenderThemeMac::drawLineForDocumentMarker): A new macOS-specific version of drawLineForDocumentMarker()
where we paint circles using Core Graphics directly.

Location:
trunk/Source/WebCore
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r233805 r233814  
     12018-07-13  Antoine Quint  <graouts@apple.com>
     2
     3        Dark Mode: document markers are difficult to see
     4        https://bugs.webkit.org/show_bug.cgi?id=187632
     5        <rdar://problem/41099719>
     6
     7        Reviewed by Simon Fraser.
     8
     9        We update the way we draw the document markers for macOS and use more constrasting colors in dark mode.
     10        Paving the way for future improvements, we move the drawLineForDocumentMarker() method from GraphicsContext
     11        to RenderTheme and implement a first version in RenderThemeMac. The circles used for the underline are now
     12        drawn directly with Core Graphics and we no longer use an image resource. To allow both GraphicsContext
     13        and RenderTheme to have different versions of the drawLineForDocumentMarker() method, the DocumentMarkerLineStyle
     14        enum is now an "enum class".
     15
     16        No new test due to webkit.org/b/105616, webkit.org/b/187655 was raised to track the creation of new tests
     17        when it becomes possible again.
     18
     19        * platform/graphics/GraphicsContext.h:
     20        * platform/graphics/GraphicsContextImpl.h:
     21        * platform/graphics/cairo/CairoOperations.cpp:
     22        (WebCore::Cairo::drawLineForDocumentMarker):
     23        * platform/graphics/cairo/CairoOperations.h:
     24        * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
     25        (WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker):
     26        * platform/graphics/cairo/GraphicsContextImplCairo.h:
     27        * platform/graphics/cocoa/GraphicsContextCocoa.mm:
     28        (WebCore::GraphicsContext::drawLineForDocumentMarker):
     29        * platform/graphics/displaylists/DisplayListItems.h:
     30        (WebCore::DisplayList::DrawLineForDocumentMarker::create):
     31        (WebCore::DisplayList::DrawLineForDocumentMarker::DrawLineForDocumentMarker):
     32        * platform/graphics/displaylists/DisplayListRecorder.cpp:
     33        (WebCore::DisplayList::Recorder::drawLineForDocumentMarker):
     34        * platform/graphics/displaylists/DisplayListRecorder.h:
     35        * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
     36        (Nicosia::CairoOperationRecorder::drawLineForDocumentMarker):
     37        * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
     38        * platform/graphics/win/GraphicsContextCGWin.cpp:
     39        (WebCore::GraphicsContext::drawLineForDocumentMarker):
     40        * rendering/InlineTextBox.cpp:
     41        (WebCore::InlineTextBox::paintPlatformDocumentMarker): Call drawLineForDocumentMarker() on the RenderTheme on
     42        macOS and on GraphicsContext in all other cases.
     43        * rendering/RenderTheme.cpp:
     44        (WebCore::RenderTheme::drawLineForDocumentMarker):
     45        * rendering/RenderTheme.h:
     46        * rendering/RenderThemeMac.h:
     47        * rendering/RenderThemeMac.mm:
     48        (WebCore::colorForStyle): Provide different colors for light and dark modes.
     49        (WebCore::RenderThemeMac::drawLineForDocumentMarker): A new macOS-specific version of drawLineForDocumentMarker()
     50        where we paint circles using Core Graphics directly.
     51
    1522018-07-13  Charlie Turner  <cturner@igalia.com>
    253
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.h

    r233315 r233814  
    110110};
    111111
     112enum class DocumentMarkerLineStyle : uint8_t {
     113    TextCheckingDictationPhraseWithAlternatives,
     114    Spelling,
     115    Grammar,
     116    AutocorrectionReplacement,
     117    DictationAlternatives
     118};
     119
    112120namespace DisplayList {
    113121class Recorder;
    … …  
    412420    WEBCORE_EXPORT void drawLineForText(const FloatPoint&, float width, bool printing, bool doubleLines = false, StrokeStyle = SolidStroke);
    413421    void drawLinesForText(const FloatPoint&, const DashArray& widths, bool printing, bool doubleLines = false, StrokeStyle = SolidStroke);
    414     enum DocumentMarkerLineStyle {
    415 #if PLATFORM(IOS)
    416         TextCheckingDictationPhraseWithAlternativesLineStyle,
    417 #endif
    418         DocumentMarkerSpellingLineStyle,
    419         DocumentMarkerGrammarLineStyle,
    420         DocumentMarkerAutocorrectionReplacementLineStyle,
    421         DocumentMarkerDictationAlternativesLineStyle
    422     };
    423422    static void updateDocumentMarkerResources();
    424423    void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarkerLineStyle);
  • trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h

    r233078 r233814  
    8080    virtual void drawLine(const FloatPoint&, const FloatPoint&) = 0;
    8181    virtual void drawLinesForText(const FloatPoint&, const DashArray& widths, bool printing, bool doubleLines, float strokeThickness) = 0;
    82     virtual void drawLineForDocumentMarker(const FloatPoint&, float width, GraphicsContext::DocumentMarkerLineStyle) = 0;
     82    virtual void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarkerLineStyle) = 0;
    8383    virtual void drawEllipse(const FloatRect&) = 0;
    8484    virtual void drawPath(const Path&) = 0;
  • trunk/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp

    r233556 r233814  
    10501050}
    10511051
    1052 void drawLineForDocumentMarker(PlatformContextCairo& platformContext, const FloatPoint& origin, float width, GraphicsContext::DocumentMarkerLineStyle style)
    1053 {
    1054     if (style != GraphicsContext::DocumentMarkerSpellingLineStyle
    1055         && style != GraphicsContext::DocumentMarkerGrammarLineStyle)
     1052void drawLineForDocumentMarker(PlatformContextCairo& platformContext, const FloatPoint& origin, float width, DocumentMarkerLineStyle style)
     1053{
     1054    if (style != DocumentMarkerLineStyle::Spelling
     1055        && style != DocumentMarkerLineStyle::Grammar)
    10561056        return;
    10571057
    … …  
    10591059    cairo_save(cr);
    10601060
    1061     if (style == GraphicsContext::DocumentMarkerSpellingLineStyle)
     1061    if (style == DocumentMarkerLineStyle::Spelling)
    10621062        cairo_set_source_rgb(cr, 1, 0, 0);
    1063     else if (style == GraphicsContext::DocumentMarkerGrammarLineStyle)
     1063    else if (style == DocumentMarkerLineStyle::Grammar)
    10641064        cairo_set_source_rgb(cr, 0, 1, 0);
    10651065
  • trunk/Source/WebCore/platform/graphics/cairo/CairoOperations.h

    r232246 r233814  
    146146void drawLine(PlatformContextCairo&, const FloatPoint&, const FloatPoint&, StrokeStyle, const Color&, float, bool);
    147147void drawLinesForText(PlatformContextCairo&, const FloatPoint&, const DashArray&, bool, bool, const Color&, float);
    148 void drawLineForDocumentMarker(PlatformContextCairo&, const FloatPoint&, float, GraphicsContext::DocumentMarkerLineStyle);
     148void drawLineForDocumentMarker(PlatformContextCairo&, const FloatPoint&, float, DocumentMarkerLineStyle);
    149149void drawEllipse(PlatformContextCairo&, const FloatRect&, const Color&, StrokeStyle, const Color&, float);
    150150
  • trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp

    r233078 r233814  
    302302}
    303303
    304 void GraphicsContextImplCairo::drawLineForDocumentMarker(const FloatPoint& origin, float width, GraphicsContext::DocumentMarkerLineStyle style)
     304void GraphicsContextImplCairo::drawLineForDocumentMarker(const FloatPoint& origin, float width, DocumentMarkerLineStyle style)
    305305{
    306306    Cairo::drawLineForDocumentMarker(m_platformContext, origin, width, style);
  • trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h

    r233078 r233814  
    8181    void drawLine(const FloatPoint&, const FloatPoint&) override;
    8282    void drawLinesForText(const FloatPoint&, const DashArray&, bool, bool, float) override;
    83     void drawLineForDocumentMarker(const FloatPoint&, float, GraphicsContext::DocumentMarkerLineStyle) override;
     83    void drawLineForDocumentMarker(const FloatPoint&, float, DocumentMarkerLineStyle) override;
    8484    void drawEllipse(const FloatRect&) override;
    8585    void drawPath(const Path&) override;
  • trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm

    r233315 r233814  
    246246#endif
    247247    switch (style) {
    248     case DocumentMarkerSpellingLineStyle: {
     248    case DocumentMarkerLineStyle::Spelling: {
    249249        // Constants for spelling pattern color.
    250250        static bool usingDotForSpelling = false;
    … …  
    261261        break;
    262262    }
    263     case DocumentMarkerGrammarLineStyle: {
     263    case DocumentMarkerLineStyle::Grammar: {
    264264#if !PLATFORM(IOS)
    265265        // Constants for grammar pattern color.
    … …  
    278278#if PLATFORM(MAC)
    279279    // To support correction panel.
    280     case DocumentMarkerAutocorrectionReplacementLineStyle:
    281     case DocumentMarkerDictationAlternativesLineStyle: {
     280    case DocumentMarkerLineStyle::AutocorrectionReplacement:
     281    case DocumentMarkerLineStyle::DictationAlternatives: {
    282282        // Constants for spelling pattern color.
    283283        static bool usingDotForSpelling = false;
    … …  
    291291#endif
    292292#if PLATFORM(IOS)
    293     case TextCheckingDictationPhraseWithAlternativesLineStyle: {
     293    case DocumentMarkerLineStyle::TextCheckingDictationPhraseWithAlternatives: {
    294294        static bool usingDotForDictationPhraseWithAlternatives = false;
    295295        static CGPatternRef dictationPhraseWithAlternativesPattern = createDotPattern(usingDotForDictationPhraseWithAlternatives, "DictationPhraseWithAlternativesDot").leakRef();
  • trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h

    r224312 r233814  
    831831class DrawLineForDocumentMarker : public DrawingItem {
    832832public:
    833     static Ref<DrawLineForDocumentMarker> create(const FloatPoint& point, float width, GraphicsContext::DocumentMarkerLineStyle style)
     833    static Ref<DrawLineForDocumentMarker> create(const FloatPoint& point, float width, DocumentMarkerLineStyle style)
    834834    {
    835835        return adoptRef(*new DrawLineForDocumentMarker(point, width, style));
    … …  
    840840
    841841private:
    842     DrawLineForDocumentMarker(const FloatPoint& point, float width, GraphicsContext::DocumentMarkerLineStyle style)
     842    DrawLineForDocumentMarker(const FloatPoint& point, float width, DocumentMarkerLineStyle style)
    843843        : DrawingItem(ItemType::DrawLineForDocumentMarker)
    844844        , m_point(point)
    … …  
    854854    FloatPoint m_point;
    855855    float m_width;
    856     GraphicsContext::DocumentMarkerLineStyle m_style;
     856    DocumentMarkerLineStyle m_style;
    857857};
    858858
  • trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp

    r233078 r233814  
    237237}
    238238
    239 void Recorder::drawLineForDocumentMarker(const FloatPoint& point, float width, GraphicsContext::DocumentMarkerLineStyle style)
     239void Recorder::drawLineForDocumentMarker(const FloatPoint& point, float width, DocumentMarkerLineStyle style)
    240240{
    241241    DrawingItem& newItem = downcast<DrawingItem>(appendItem(DrawLineForDocumentMarker::create(point, width, style)));
  • trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h

    r233078 r233814  
    9999    void drawLine(const FloatPoint&, const FloatPoint&) override;
    100100    void drawLinesForText(const FloatPoint&, const DashArray& widths, bool printing, bool doubleLines, float strokeThickness) override;
    101     void drawLineForDocumentMarker(const FloatPoint&, float width, GraphicsContext::DocumentMarkerLineStyle) override;
     101    void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarkerLineStyle) override;
    102102    void drawEllipse(const FloatRect&) override;
    103103    void drawPath(const Path&) override;
  • trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp

    r233078 r233814  
    653653}
    654654
    655 void CairoOperationRecorder::drawLineForDocumentMarker(const FloatPoint& origin, float width, GraphicsContext::DocumentMarkerLineStyle style)
    656 {
    657     struct DrawLineForDocumentMarker final : PaintingOperation, OperationData<FloatPoint, float, GraphicsContext::DocumentMarkerLineStyle> {
     655void CairoOperationRecorder::drawLineForDocumentMarker(const FloatPoint& origin, float width, DocumentMarkerLineStyle style)
     656{
     657    struct DrawLineForDocumentMarker final : PaintingOperation, OperationData<FloatPoint, float, DocumentMarkerLineStyle> {
    658658        virtual ~DrawLineForDocumentMarker() = default;
    659659
  • trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h

    r233078 r233814  
    7474    void drawLine(const WebCore::FloatPoint&, const WebCore::FloatPoint&) override;
    7575    void drawLinesForText(const WebCore::FloatPoint&, const DashArray&, bool, bool, float) override;
    76     void drawLineForDocumentMarker(const WebCore::FloatPoint&, float, WebCore::GraphicsContext::DocumentMarkerLineStyle) override;
     76    void drawLineForDocumentMarker(const WebCore::FloatPoint&, float, WebCore::DocumentMarkerLineStyle) override;
    7777    void drawEllipse(const WebCore::FloatRect&) override;
    7878    void drawPath(const WebCore::Path&) override;
  • trunk/Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp

    r227988 r233814  
    196196        return;
    197197
    198     if (style != DocumentMarkerSpellingLineStyle && style != DocumentMarkerGrammarLineStyle)
     198    if (style != DocumentMarkerLineStyle::Spelling && style != DocumentMarkerLineStyle::Grammar)
    199199        return;
    200200
    … …  
    219219    CGContextSaveGState(context);
    220220
    221     const Color& patternColor = style == DocumentMarkerGrammarLineStyle ? grammarPatternColor() : spellingPatternColor();
     221    const Color& patternColor = style == DocumentMarkerLineStyle::Grammar ? grammarPatternColor() : spellingPatternColor();
    222222    setCGStrokeColor(context, patternColor);
    223223
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r233704 r233814  
    690690        switch (type) {
    691691        case MarkedText::SpellingError:
    692             return GraphicsContext::DocumentMarkerSpellingLineStyle;
     692            return DocumentMarkerLineStyle::Spelling;
    693693        case MarkedText::GrammarError:
    694             return GraphicsContext::DocumentMarkerGrammarLineStyle;
     694            return DocumentMarkerLineStyle::Grammar;
    695695        case MarkedText::Correction:
    696             return GraphicsContext::DocumentMarkerAutocorrectionReplacementLineStyle;
     696            return DocumentMarkerLineStyle::AutocorrectionReplacement;
    697697        case MarkedText::DictationAlternatives:
    698             return GraphicsContext::DocumentMarkerDictationAlternativesLineStyle;
     698            return DocumentMarkerLineStyle::DictationAlternatives;
    699699#if PLATFORM(IOS)
    700700        case MarkedText::DictationPhraseWithAlternatives:
    701             // FIXME: Rename TextCheckingDictationPhraseWithAlternativesLineStyle and remove the PLATFORM(IOS)-guard.
    702             return GraphicsContext::TextCheckingDictationPhraseWithAlternativesLineStyle;
     701            // FIXME: Rename DocumentMarkerLineStyle::TextCheckingDictationPhraseWithAlternatives and remove the PLATFORM(IOS)-guard.
     702            return DocumentMarkerLineStyle::TextCheckingDictationPhraseWithAlternatives;
    703703#endif
    704704        default:
    705705            ASSERT_NOT_REACHED();
    706             return GraphicsContext::DocumentMarkerSpellingLineStyle;
     706            return DocumentMarkerLineStyle::Spelling;
    707707        }
    708708    };
    … …  
    725725        underlineOffset = baseline + 2;
    726726    }
     727
     728#if PLATFORM(MAC)
     729    RenderTheme::singleton().drawLineForDocumentMarker(renderer(), context, FloatPoint(boxOrigin.x() + start, boxOrigin.y() + underlineOffset), width, lineStyleForMarkedTextType(markedText.type));
     730#else
    727731    context.drawLineForDocumentMarker(FloatPoint(boxOrigin.x() + start, boxOrigin.y() + underlineOffset), width, lineStyleForMarkedTextType(markedText.type));
     732#endif
    728733}
    729734
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r233552 r233814  
    14131413#endif
    14141414
     1415void RenderTheme::drawLineForDocumentMarker(const RenderText&, GraphicsContext&, const FloatPoint&, float, DocumentMarkerLineStyle)
     1416{
     1417}
     1418
    14151419} // namespace WebCore
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r233670 r233814  
    2323#include "ColorHash.h"
    2424#include "ControlStates.h"
     25#include "GraphicsContext.h"
    2526#include "PaintInfo.h"
    2627#include "PopupMenuStyle.h"
    … …  
    252253    virtual void paintSystemPreviewBadge(Image&, const PaintInfo&, const FloatRect&);
    253254#endif
     255
     256    virtual void drawLineForDocumentMarker(const RenderText&, GraphicsContext&, const FloatPoint& origin, float width, DocumentMarkerLineStyle);
    254257
    255258protected:
  • trunk/Source/WebCore/rendering/RenderThemeMac.h

    r233532 r233814  
    169169#endif
    170170
     171    void drawLineForDocumentMarker(const RenderText&, GraphicsContext&, const FloatPoint& origin, float width, DocumentMarkerLineStyle) final;
     172
    171173private:
    172174    String fileListNameForWidth(const FileList*, const FontCascade&, int width, bool multipleFilesAllowed) const final;
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r233670 r233814  
    2626#import "CSSValueKeywords.h"
    2727#import "CSSValueList.h"
     28#import "Color.h"
    2829#import "ColorMac.h"
    2930#import "Document.h"
    … …  
    3637#import "FrameView.h"
    3738#import "GeometryUtilities.h"
     39#import "GraphicsContext.h"
    3840#import "GraphicsContextCG.h"
    3941#import "HTMLAttachmentElement.h"
    … …  
    27772779#endif // ENABLE(ATTACHMENT_ELEMENT)
    27782780
     2781static CGColorRef colorForStyle(DocumentMarkerLineStyle style, bool useDarkMode)
     2782{
     2783    switch (style) {
     2784    // Red.
     2785    case DocumentMarkerLineStyle::Spelling:
     2786        return cachedCGColor(useDarkMode ? Color { 255, 140, 140, 217 } : Color { 255, 59, 48, 191 });
     2787    // Blue.
     2788    case DocumentMarkerLineStyle::DictationAlternatives:
     2789    case DocumentMarkerLineStyle::TextCheckingDictationPhraseWithAlternatives:
     2790    case DocumentMarkerLineStyle::AutocorrectionReplacement:
     2791        return cachedCGColor(useDarkMode ? Color { 40, 145, 255, 217 } : Color { 0, 122, 255, 191 });
     2792    // Green.
     2793    case DocumentMarkerLineStyle::Grammar:
     2794        return cachedCGColor(useDarkMode ? Color { 50, 215, 75, 217 } : Color { 25, 175, 50, 191 });
     2795    }
     2796}
     2797
     2798void RenderThemeMac::drawLineForDocumentMarker(const RenderText& renderer, GraphicsContext& context, const FloatPoint& origin, float width, DocumentMarkerLineStyle style)
     2799{
     2800    if (context.paintingDisabled())
     2801        return;
     2802
     2803    auto circleColor = colorForStyle(style, renderer.page().useSystemAppearance() && renderer.page().useDarkAppearance());
     2804
     2805    // Center the underline and ensure we only draw entires dots.
     2806    FloatPoint offsetPoint = origin;
     2807    float widthMod = fmodf(width, cMisspellingLinePatternWidth);
     2808    if (cMisspellingLinePatternWidth - widthMod > cMisspellingLinePatternGapWidth) {
     2809        float gapIncludeWidth = 0;
     2810        if (width > cMisspellingLinePatternWidth)
     2811            gapIncludeWidth = cMisspellingLinePatternGapWidth;
     2812        offsetPoint.move(floor((widthMod + gapIncludeWidth) / 2), 0);
     2813        width -= widthMod;
     2814    }
     2815
     2816    CGContextRef ctx = context.platformContext();
     2817    CGContextStateSaver stateSaver { ctx };
     2818    CGContextSetFillColorWithColor(ctx, circleColor);
     2819    for (int x = 0; x < width; x += cMisspellingLinePatternWidth)
     2820        CGContextAddEllipseInRect(ctx, CGRectMake(offsetPoint.x() + x, offsetPoint.y(), cMisspellingLineThickness, cMisspellingLineThickness));
     2821    CGContextSetCompositeOperation(ctx, kCGCompositeSover);
     2822    CGContextFillPath(ctx);
     2823}
     2824
    27792825} // namespace WebCore
    27802826
Note: See TracChangeset for help on using the changeset viewer.