Skip to content

shaping with the lang attribute does not support region subtags #44430

@delan

Description

@delan

#43447 makes shaping take the lang attribute into account, but this only works for language tags with a primary language subtag only, not those with a region subtag too. this can be relevant for chinese text.

using the example from the figure in Han unification on english wikipedia:

<!doctype html><meta charset="utf-8">
<body style="font-size: 7em;">
<div>
    <span></span>
    <span lang="zh-CN"></span>
    <span lang="zh-TW"></span>
    <span lang="zh-HK"></span>
    <span lang="ja-JP"></span>
    <span lang="ko-KR"></span>
</div>
<div>
    <span></span>
    <span lang="zh"></span>
    <span lang="zh"></span>
    <span lang="zh"></span>
    <span lang="ja"></span>
    <span lang="ko"></span>
</div>
<style>
    /* not relevant to the test case */
    span::before {
        display: inline-block;
        width: 0;
        white-space: nowrap;
        position: relative;
        top: 2rem;
        font-size: 1rem;
        content: attr(lang);
    }
</style>
Firefox 142 Image
Servo 0.1.0 Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-untriagedNew issues that haven't been triaged yet

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions