Changeset 157518 in webkit


Ignore:
Timestamp:
Oct 16, 2013 9:57:44 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Emphasis marks has wrong color.
https://bugs.webkit.org/show_bug.cgi?id=122829

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-10-16
Reviewed by Antti Koivisto.

Source/WebCore:

Tests: fast/text/text-emphasis.html.

fast/text/text-emphasis-expected.html.

Emphasis color should be set as fill color, not stroke color.

  • rendering/TextPaintStyle.cpp:

(WebCore::updateGraphicsContext):

  • rendering/TextPaintStyle.h:

LayoutTests:

  • fast/text/text-emphasis-expected.html: Added.
  • fast/text/text-emphasis.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r157513 r157518  
     12013-10-16  peavo@outlook.com  <peavo@outlook.com>
     2
     3        Emphasis marks has wrong color.
     4        https://bugs.webkit.org/show_bug.cgi?id=122829
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/text/text-emphasis-expected.html: Added.
     9        * fast/text/text-emphasis.html: Added.
     10
    1112013-10-16  Jinwoo Song  <jinwoo7.song@samsung.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r157517 r157518  
     12013-10-16  peavo@outlook.com  <peavo@outlook.com>
     2
     3        Emphasis marks has wrong color.
     4        https://bugs.webkit.org/show_bug.cgi?id=122829
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Tests: fast/text/text-emphasis.html.
     9               fast/text/text-emphasis-expected.html.
     10
     11        Emphasis color should be set as fill color, not stroke color.
     12
     13        * rendering/TextPaintStyle.cpp:
     14        (WebCore::updateGraphicsContext):
     15        * rendering/TextPaintStyle.h:
     16
    1172013-10-16  Antti Koivisto  <antti@apple.com>
    218
  • trunk/Source/WebCore/rendering/TextPaintStyle.cpp

    r157015 r157518  
    155155}
    156156
    157 void updateGraphicsContext(GraphicsContext& context, const TextPaintStyle& paintStyle, StrokeColorType strokeColorType)
     157void updateGraphicsContext(GraphicsContext& context, const TextPaintStyle& paintStyle, FillColorType fillColorType)
    158158{
    159159    TextDrawingModeFlags mode = context.textDrawingMode();
     
    166166    }
    167167   
    168     if (mode & TextModeFill && (paintStyle.fillColor != context.fillColor() || paintStyle.colorSpace != context.fillColorSpace()))
    169         context.setFillColor(paintStyle.fillColor, paintStyle.colorSpace);
     168    Color fillColor = fillColorType == UseEmphasisMarkColor ? paintStyle.emphasisMarkColor : paintStyle.fillColor;
     169    if (mode & TextModeFill && (fillColor != context.fillColor() || paintStyle.colorSpace != context.fillColorSpace()))
     170        context.setFillColor(fillColor, paintStyle.colorSpace);
    170171
    171172    if (mode & TextModeStroke) {
    172         Color strokeColor = strokeColorType == UseEmphasisMarkColor ? paintStyle.emphasisMarkColor : paintStyle.strokeColor;
    173         if (strokeColor != context.strokeColor())
    174             context.setStrokeColor(strokeColor, paintStyle.colorSpace);
     173        if (paintStyle.strokeColor != context.strokeColor())
     174            context.setStrokeColor(paintStyle.strokeColor, paintStyle.colorSpace);
    175175        if (paintStyle.strokeWidth != context.strokeThickness())
    176176            context.setStrokeThickness(paintStyle.strokeWidth);
  • trunk/Source/WebCore/rendering/TextPaintStyle.h

    r157015 r157518  
    5252TextPaintStyle computeTextSelectionPaintStyle(const TextPaintStyle&, const RenderText&, const RenderStyle&, const PaintInfo&, bool& paintSelectedTextOnly, bool& paintSelectedTextSeparately, const ShadowData*& selectionShadow);
    5353
    54 enum StrokeColorType { UseNormalStrokeColor, UseEmphasisMarkColor };
    55 void updateGraphicsContext(GraphicsContext&, const TextPaintStyle&, StrokeColorType = UseNormalStrokeColor);
     54enum FillColorType { UseNormalFillColor, UseEmphasisMarkColor };
     55void updateGraphicsContext(GraphicsContext&, const TextPaintStyle&, FillColorType = UseNormalFillColor);
    5656
    5757}
Note: See TracChangeset for help on using the changeset viewer.