Skip to content
  • commit-queue@webkit.org's avatar
    [css3-text] Add rendering support for -webkit-text-decoration-style · 49c5e13b
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=94094
    
    Patch by Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> on 2012-10-22
    Reviewed by Julien Chaffraix.
    
    Source/WebCore:
    
    This patch implements the "text-decoration-style" property rendering as
    specified in CSS3 working draft, with "-webkit-" prefix. The specification can
    be found here: http://dev.w3.org/csswg/css3-text/#text-decoration-style
    
    Additionally, Mozilla implementation details can be found here:
    https://developer.mozilla.org/en/CSS/text-decoration-style
    
    Tests: fast/css3-text/css3-text-decoration/repaint/repaint-text-decoration-style.html
           fast/css3-text/css3-text-decoration/text-decoration-style.html
    
    * platform/graphics/GraphicsContext.h:
    * platform/graphics/cairo/GraphicsContextCairo.cpp:
    (WebCore::GraphicsContext::setPlatformStrokeStyle):
    * platform/graphics/cg/GraphicsContextCG.cpp:
    (WebCore::GraphicsContext::drawLine):
    * platform/graphics/qt/GraphicsContextQt.cpp:
    (WebCore::toQPenStyle):
    (WebCore::GraphicsContext::drawLine):
    * platform/graphics/skia/PlatformContextSkia.cpp:
    (WebCore::PlatformContextSkia::setupPaintForStroking):
    * platform/graphics/wince/GraphicsContextWinCE.cpp:
    (WebCore::createPen):
    * platform/graphics/wx/GraphicsContextWx.cpp:
    (WebCore::strokeStyleToWxPenStyle):
    Added 'DoubleStroke' and 'WavyStroke' to StrokeStyle enum and updated
    platform-specific stroke handling. Some styles requires
    platform-specific implementation (handled in bug 92868).
    * rendering/InlineTextBox.cpp:
    (WebCore::InlineTextBox::paint):
    (WebCore::textDecorationStyleToStrokeStyle): Added static function that
    translates text decoration to stroke styles.
    (WebCore::InlineTextBox::paintDecoration): Text decoration style does
    not specify a property for line thickness (like border-width does for
    border style), so we statically set it to 1 for now. The 'double' style
    implementation simply adds a parallel line (depending if it is
    underline, overline or line-through) and the space between lines follows
    the approach used by border's 'double' style.
    * rendering/InlineTextBox.h:
    (InlineTextBox):
    * rendering/style/RenderStyle.h:
    * rendering/style/RenderStyleConstants.h:
    Added text decoration style rendering support to
    InlineTextBox::paintDecoration().
    
    LayoutTests:
    
    Added paint and repaint layout tests for CSS3 text-decoration-style
    property. Pixel results are not included due to missing platform support
    for some decoration styles (handled on bug 93507). These are going
    to be added when platform support is complete.
    
    * fast/css3-text/css3-text-decoration/repaint/repaint-text-decoration-style-expected.txt: Added.
    * fast/css3-text/css3-text-decoration/repaint/repaint-text-decoration-style.html: Added.
    * fast/css3-text/css3-text-decoration/text-decoration-style-expected.txt: Added.
    * fast/css3-text/css3-text-decoration/text-decoration-style.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132076 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    49c5e13b