text-decoration-skip: ink does not work with line wraps
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jan 2014 01:29:56 +0000 (01:29 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jan 2014 01:29:56 +0000 (01:29 +0000)
commit7c852259677bf3462b54a4a490250bd7991893da
treeb4ef860b765ff89be216aa977d9c5a50c3b59873
parent02cfd61ba11b10232465efbbf2d02b6cf5b1f187
text-decoration-skip: ink does not work with line wraps
https://bugs.webkit.org/show_bug.cgi?id=126729

Reviewed by Simon Fraser.

Source/WebCore:

InlineTextBox's m_start and m_length fields are offsets into the renderer's string,
not the generated TextRun. Because of this distinction, when multiple InlineTextBoxes
were constructed for the same element, all the subsequent elements would use incorrect
indices and therefore not have skipping decorations.

Test: fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-multiline.html

* platform/graphics/Font.h:
* platform/graphics/mac/FontMac.mm:
(WebCore::Font::dashesForIntersectionsWithRect):
* rendering/InlineTextBox.cpp:
(WebCore::drawSkipInkUnderline):
(WebCore::InlineTextBox::paintDecoration):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::dashesForIntersectionsWithRect):
* rendering/TextPainter.h:

LayoutTests:

This test compares rending of a single element that wraps lines with one element per line.
Both elements have text-decoration-skip:ink turned on.

* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-multiline-expected.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-multiline.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-multiline-expected.html [new file with mode: 0644]
LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-multiline.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Font.h
Source/WebCore/platform/graphics/mac/FontMac.mm
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/TextPainter.cpp
Source/WebCore/rendering/TextPainter.h