[webkit-reviews] review granted: [Bug 191341] Positioned text underline can look like a strike-through : [Attachment 354165] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 7 15:24:26 PST 2018


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Myles C. Maxfield
<mmaxfield at apple.com>'s request for review:
Bug 191341: Positioned text underline can look like a strike-through
https://bugs.webkit.org/show_bug.cgi?id=191341

Attachment 354165: Patch

https://bugs.webkit.org/attachment.cgi?id=354165&action=review




--- Comment #3 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 354165
  --> https://bugs.webkit.org/attachment.cgi?id=354165
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=354165&action=review

> Source/WebCore/ChangeLog:11
> +	   We should just clamp the value so it can't go above the baseline.
> +
> +	   We shouldn't do this at parse time because it's totally reasonable
for text-underline-position: under to want
> +	   a negative text-underline-offset. Instead, we just do it at used
value time.

Will the spec describe this behavior?

> Source/WebCore/style/InlineTextBoxStyle.cpp:62
> +	   return fontMetrics.ascent() + std::max(0.0f,
underlineOffset.lengthValue());

Slightly prefer std::max<float>(0, underlineOffset.lengthValue())

> Source/WebCore/style/InlineTextBoxStyle.cpp:64
> +	   return fontMetrics.ascent() + std::max(0.0f,
fontMetrics.underlinePosition() + underlineOffset.lengthOr(0));

Ditto.


More information about the webkit-reviews mailing list