Bug 181209 - Incorrect handling of line-height on ::first-line
Summary: Incorrect handling of line-height on ::first-line
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: FromImplementor
Depends on:
Blocks:
 
Reported: 2018-01-01 21:06 PST by Boris Zbarsky
Modified: 2018-01-02 18:28 PST (History)
4 users (show)

See Also:


Attachments
Testcase (368 bytes, text/html)
2018-01-01 21:06 PST, Boris Zbarsky
no flags Details
Slightly modified testcase that shows the problem (374 bytes, text/html)
2018-01-02 18:28 PST, Boris Zbarsky
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Zbarsky 2018-01-01 21:06:47 PST
Created attachment 330308 [details]
Testcase

STEPS TO REPRODUCE: Load attached testcase

EXPECTED BEHAVIOR: The two blocks should look identical.

ACTUAL BEHAVIOR: The two blocks do not look identical.

ADDITIONAL INFORMATION:  https://drafts.csswg.org/selectors-3/#first-line says:

   The ::first-line pseudo-element is similar to an inline-level element,
   but with certain restrictions

but in Safari it's not acting like an inline-level element is supposed to in terms of line-height handling.
Comment 1 Boris Zbarsky 2018-01-01 21:10:27 PST
Note that https://drafts.csswg.org/css-pseudo-4/#first-line-styling has the same language about ::first-line being an inline.

See also https://bugs.chromium.org/p/chromium/issues/detail?id=798257 for the corresponding Blink issue.
Comment 2 Jon Lee 2018-01-02 14:19:24 PST
(In reply to Boris Zbarsky from comment #1)
> Note that https://drafts.csswg.org/css-pseudo-4/#first-line-styling has the
> same language about ::first-line being an inline.
> 
> See also https://bugs.chromium.org/p/chromium/issues/detail?id=798257 for
> the corresponding Blink issue.

In STP 46 and Firefox 57 the test case renders correctly. Chrome 63 does not render it correctly. Am I missing something?
Comment 3 Boris Zbarsky 2018-01-02 18:28:23 PST
Created attachment 330364 [details]
Slightly modified testcase that shows the problem

Er, right you are.  When I tried to make the testcase more reliable by using <br> to end the first line, the problem went away in Safari.  Here's a testcase which fails with my font sizes in Safari 11.0.2 and in STP 46.