Skip to content

[css-pseudo] Possible interoperability issues with white space handling in ::first-letter #13766

@mrobinson

Description

@mrobinson

First Letter and Associated Punctuation seems to imply that white-space that precedes the first letter pattern should be ignored. Yet, all major browser do include leading white space consistently though their some behaviors are incompatible:

<!DOCTYPE html>

<style>
    div {
        float: left;
        outline: solid 1px black;
        margin-right: 10px;
    }
    div::first-letter {
        font-size: 30px;
        background: pink;
    }
</style>

<div style="white-space: pre;">Hello</div>
<div style="white-space: pre;">H.ello</div>
<div style="white-space: pre;">.H.ello</div>
<div style="white-space: pre;"> .H.ello</div>
<div style="white-space: pre;"> Hello</div>
<div style="white-space: pre;"> . H .ello</div>

Firefox:

Image

Chrome:

Image

Epiphany (WebKit):

Image

Servo (does not include white space, in an attempt to implement the spec):

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions