Changeset 41152 in webkit


Ignore:
Timestamp:
Feb 23, 2009 12:11:05 PM (15 years ago)
Author:
treat@webkit.org
Message:

2009-02-23 Adam Treat <adam.treat@torchmobile.com>

Reviewed by David Hyatt.

No testcases have been added or modified since this patch should not result in
a behavior change for ports that have layout tests enabled.

Currently, the implementation of GraphicsContext::drawLineForText amongst
the various ports differ in that some of them are honoring the context's
strokeStyle when drawing a text-decoration and some of them are not.
For instance, Apple's Mac port *does not* honor the context's strokeStyle(),
but the Cairo implementation does and has an explicit workaround that
sets the strokeStyle() temporarily.

This patch fixes so that all ports are consistent by explicitly making sure
to set the GraphicsContext strokeStyle to SolidStroke whenever
painting the text-decoration of an InlineFlowBox or InlineTextBox as these
should always use a solid stroke.

This patch addresses these bugs:
https://bugs.webkit.org/show_bug.cgi?id=19364
https://bugs.webkit.org/show_bug.cgi?id=15659

  • rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::paintTextDecorations):
  • rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintDecoration):
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r41150 r41152  
     12009-02-23  Adam Treat  <adam.treat@torchmobile.com>
     2
     3        Reviewed by David Hyatt.
     4
     5        No testcases have been added or modified since this patch should not result in
     6        a behavior change for ports that have layout tests enabled.
     7
     8        Currently, the implementation of GraphicsContext::drawLineForText amongst
     9        the various ports differ in that some of them are honoring the context's
     10        strokeStyle when drawing a text-decoration and some of them are not.
     11        For instance, Apple's Mac port *does not* honor the context's strokeStyle(),
     12        but the Cairo implementation does and has an explicit workaround that
     13        sets the strokeStyle() temporarily.
     14
     15        This patch fixes so that all ports are consistent by explicitly making sure
     16        to set the GraphicsContext strokeStyle to SolidStroke whenever
     17        painting the text-decoration of an InlineFlowBox or InlineTextBox as these
     18        should always use a solid stroke.
     19
     20        This patch addresses these bugs:
     21        https://bugs.webkit.org/show_bug.cgi?id=19364
     22        https://bugs.webkit.org/show_bug.cgi?id=15659
     23
     24        * rendering/InlineFlowBox.cpp:
     25        (WebCore::InlineFlowBox::paintTextDecorations):
     26        * rendering/InlineTextBox.cpp:
     27        (WebCore::InlineTextBox::paintDecoration):
     28
    1292009-02-23  Scott Violet  <sky@google.com>
    230
  • trunk/WebCore/rendering/InlineFlowBox.cpp

    r40916 r41152  
    932932            if (paintUnderline) {
    933933                context->setStrokeColor(underline);
     934                context->setStrokeStyle(SolidStroke);
    934935                // Leave one pixel of white between the baseline and the underline.
    935936                context->drawLineForText(IntPoint(tx, ty + baselinePos + 1), w, isPrinting);
     
    937938            if (paintOverline) {
    938939                context->setStrokeColor(overline);
     940                context->setStrokeStyle(SolidStroke);
    939941                context->drawLineForText(IntPoint(tx, ty), w, isPrinting);
    940942            }
    941943            if (paintLineThrough) {
    942944                context->setStrokeColor(linethrough);
     945                context->setStrokeStyle(SolidStroke);
    943946                context->drawLineForText(IntPoint(tx, ty + 2 * baselinePos / 3), w, isPrinting);
    944947            }
  • trunk/WebCore/rendering/InlineTextBox.cpp

    r40930 r41152  
    636636        if (deco & UNDERLINE) {
    637637            context->setStrokeColor(underline);
     638            context->setStrokeStyle(SolidStroke);
    638639            // Leave one pixel of white between the baseline and the underline.
    639640            context->drawLineForText(IntPoint(tx, ty + baseline + 1), width, isPrinting);
     
    641642        if (deco & OVERLINE) {
    642643            context->setStrokeColor(overline);
     644            context->setStrokeStyle(SolidStroke);
    643645            context->drawLineForText(IntPoint(tx, ty), width, isPrinting);
    644646        }
    645647        if (deco & LINE_THROUGH) {
    646648            context->setStrokeColor(linethrough);
     649            context->setStrokeStyle(SolidStroke);
    647650            context->drawLineForText(IntPoint(tx, ty + 2 * baseline / 3), width, isPrinting);
    648651        }
Note: See TracChangeset for help on using the changeset viewer.