Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Issue 2416993002: Introduce support for text-decoration-skip: ink (Closed)

Created:
4 years, 2 months ago by drott
Modified:
4 years, 1 month ago
Reviewers:
eae
CC:
ajuma+watch_chromium.org, blink-reviews, blink-reviews-paint_chromium.org, blink-reviews-platform-graphics_chromium.org, Rik, chromium-reviews, danakj+watch_chromium.org, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), jbroman, Justin Novosad, pdr+graphicswatchlist_chromium.org, rwlbuis, Stephen Chennney, kojii
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce support for text-decoration-skip: ink In addition to the "objects" default value, support value "ink" for text-decoration-skip. The spec [1] describes this as: "Skip over where glyphs are drawn: interrupt the decoration line to let the shape of the text show through where the text decoration would otherwise cross over a glyph. The UA must skip a small distance to either side of the glyph outline." This CL supports this for all underline, overline, and line-through and all text-decoration-style styles: solid, double, dashed, dotted, wavy. The implementation approach is: If ink skipping is requested, clip rectangles are calculated for the text intercepts. The vertical bounds for those clip rectangles are computed from the extends of the underline style: For example tight bounds of a Bezier curve are calculated for the wavy underline style. Using these vertical boundaries, the text intercepts are retrieved from Skia, via GraphicsContext. Skia computes them from the glyph shapes and two distances, the vertical bounds that were previously calculated. The rectangles are inflated in the baseline direction by the underline thickness itself, same as WebKit. These clip rectangles are then used to clip out painting an underline at the calculated positions. Known issue at this point: Due to the way we draw upright in vertical text, currently there is no correct way of computing the ink skip rectangles in this case, tracked in crbug.com/655154 [1] https://drafts.csswg.org/css-text-decor-3/#text-decoration-skip-property BUG=649700, 581456 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Committed: https://crrev.com/c0fd99aa9f08fd23c5cf35e4f29b2e650fcace92 Cr-Commit-Position: refs/heads/master@{#433415}

Patch Set 1 #

Total comments: 10

Patch Set 2 : Reduce font size in test #

Patch Set 3 : Adressing some of Emil's review comments #

Patch Set 4 : Remove sketch comments #

Patch Set 5 : Vertical text artifacts fixed #

Patch Set 6 : Model dependency to multiple decorations painting #

Patch Set 7 : Fix wavy offset #

Patch Set 8 : Perhaps generic test expectations are enough? #

Patch Set 9 : Falling back to adding rebaseline expectation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+580 lines, -257 lines) Patch
M third_party/WebKit/LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip.html View 1 1 chunk +77 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip-expected.png View 1 2 3 4 5 6 7 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip-expected.txt View 1 2 3 4 5 6 7 1 chunk +89 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/InlineTextBoxPainter.h View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp View 1 2 3 4 5 6 6 chunks +365 lines, -249 lines 0 comments Download
M third_party/WebKit/Source/core/paint/TextPainter.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/TextPainter.cpp View 1 2 3 4 1 chunk +32 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyle.h View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsContext.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp View 1 2 3 4 4 chunks +6 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 48 (31 generated)
drott
Reduce font size in test
4 years, 2 months ago (2016-10-13 18:18:40 UTC) #4
eae
This looks great! https://codereview.chromium.org/2416993002/diff/1/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp File third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp (right): https://codereview.chromium.org/2416993002/diff/1/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp#newcode29 third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp:29: // pixel gap, if underline is ...
4 years, 2 months ago (2016-10-13 18:18:54 UTC) #7
drott
Adressing some of Emil's review comments
4 years, 2 months ago (2016-10-13 18:35:42 UTC) #9
drott
https://codereview.chromium.org/2416993002/diff/1/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp File third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp (right): https://codereview.chromium.org/2416993002/diff/1/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp#newcode44 third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp:44: // FIXME: We support only horizontal text for now. ...
4 years, 2 months ago (2016-10-13 18:39:29 UTC) #12
eae
LGTM!
4 years, 2 months ago (2016-10-13 18:52:54 UTC) #13
drott
Remove sketch comments
4 years, 2 months ago (2016-10-13 18:54:34 UTC) #14
drott
Model dependency to multiple decorations painting
4 years, 1 month ago (2016-11-16 14:39:45 UTC) #23
drott
On 2016/10/13 at 18:52:54, eae wrote: > LGTM! Could you take another look, only TextPainter ...
4 years, 1 month ago (2016-11-16 14:43:25 UTC) #26
eae
OK, LGTM
4 years, 1 month ago (2016-11-16 16:32:28 UTC) #29
drott
Fix wavy offset
4 years, 1 month ago (2016-11-18 16:43:04 UTC) #30
drott
Perhaps generic test expectations are enough?
4 years, 1 month ago (2016-11-18 20:43:09 UTC) #35
drott
Falling back to adding rebaseline expectation
4 years, 1 month ago (2016-11-18 20:46:35 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2416993002/160001
4 years, 1 month ago (2016-11-18 20:47:53 UTC) #41
commit-bot: I haz the power
Try jobs failed on following builders: linux_layout_tests_slimming_paint_v2 on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
4 years, 1 month ago (2016-11-18 22:50:09 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2416993002/160001
4 years, 1 month ago (2016-11-19 08:49:23 UTC) #45
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 1 month ago (2016-11-19 08:54:50 UTC) #46
commit-bot: I haz the power
4 years, 1 month ago (2016-11-19 09:02:30 UTC) #48
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/c0fd99aa9f08fd23c5cf35e4f29b2e650fcace92
Cr-Commit-Position: refs/heads/master@{#433415}

Powered by Google App Engine
This is Rietveld 408576698