servo/components
Martin Robinson 56280c6242
layout: Add initial support for bidirectional text (BiDi) (#33148)
This adds supports for right-to-left text assigning bidi levels to all
line items when necessary. This includes support for the `dir` attribute
as well as corresponding CSS properties like `unicode-bidi`. It only
implements right-to-left rendering for inline layout at the moment and
doesn't include support for `dir=auto`. Because of missing features,
this causes quite a few tests to start failing, as references become
incorrect due to right-to-left rendering being active in some cases,
but not others (before it didn't exist at all).

Analysis of most of the new failures:

```
- /css/css-flexbox/gap-001-rtl.html
  /css/css-flexbox/gap-004-rtl.html
 - Require implementing BiDi in Flexbox, because the start and
   end inline margins are opposite the order of items.

- /css/CSS2/bidi-text/direction-applies-to-*.xht
  /css/CSS2/bidi-text/direction-applies-to-002.xht
  /css/CSS2/bidi-text/direction-applies-to-003.xht
  /css/CSS2/bidi-text/direction-applies-to-004.xht
  - Broken due to a bug in tables, not allocating the
    right amount of width for a column.

- /css/css-lists/inline-list.html
  - This fails because we wrongly insert a soft wrap opportunity between the
    start of an inline box and its first content.

- /css/css-text/bidi/bidi-lines-001.html
  /css/css-text/bidi/bidi-lines-002.html
  /css/CSS2/text/bidi-flag-emoji.html
  - We do not fully support unicode-bidi: plaintext

- /css/css-text/text-align/text-align-end-010.html
  /css/css-text/text-align/text-align-justify-006.html
  /css/css-text/text-align/text-align-start-010.html
  /html/dom/elements/global-attributes/*
  - We do not support dir=auto yet.

- /css/css-text/white-space/tab-bidi-001.html
  - Servo doesn't support tab stops

- /css/CSS2/positioning/abspos-block-level-001.html
  /css/css-text/word-break/word-break-normal-ar-000.html
  - Do not yet support RTL layout in block

- /css/css-text/white-space/pre-wrap-018.html
  - Even in RTL contexts, spaces at the end of the line must hang and
    not be reordered

- /css/css-text/white-space/trailing-space-and-text-alignment-rtl-002.html
  - We are letting spaces hang with white-space: pre, but they shouldn't
    hang.
```

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-08-21 14:28:54 +00:00
..
allocator deps: switch to tikv-jemallocator crates in Cargo.toml (#32828) 2024-07-22 07:55:46 +00:00
background_hang_monitor ohos/android: Redirect stdout/stderr to log sink (#32858) 2024-08-15 09:26:03 +00:00
bluetooth clippy: fix some warnings in desktop and some components (#32583) 2024-06-25 07:04:23 +00:00
canvas Upgrade font-kit, raqote, and stop using dirs-next (#33120) 2024-08-19 12:16:28 +00:00
compositing clippy: Fix various clippy warnings throughout the code (#33003) 2024-08-13 05:16:47 +00:00
config Upgrade font-kit, raqote, and stop using dirs-next (#33120) 2024-08-19 12:16:28 +00:00
config_plugins Replace lazy_static crate with std::sync::LazyLock in layout and config (#33065) 2024-08-15 16:28:04 +00:00
constellation Fix warnings after latest rust upgrade (#33043) 2024-08-14 07:00:16 +00:00
deny_public_fields Use workspace definitions for all crates and update to the 2021 edition (#32544) 2024-06-18 09:22:08 +00:00
devtools Fix warnings after latest rust upgrade (#33043) 2024-08-14 07:00:16 +00:00
dom_struct Use workspace definitions for all crates and update to the 2021 edition (#32544) 2024-06-18 09:22:08 +00:00
domobject_derive Use workspace definitions for all crates and update to the 2021 edition (#32544) 2024-06-18 09:22:08 +00:00
fonts Upgrade font-kit, raqote, and stop using dirs-next (#33120) 2024-08-19 12:16:28 +00:00
geometry Use workspace definitions for all crates and update to the 2021 edition (#32544) 2024-06-18 09:22:08 +00:00
hyper_serde dependencies: Upgrade cookie and rename Servo's Cookie to ServoCookie (#32861) 2024-07-26 16:13:39 +00:00
jstraceable_derive Use workspace definitions for all crates and update to the 2021 edition (#32544) 2024-06-18 09:22:08 +00:00
layout Update stylo for latest changes. (#33079) 2024-08-16 10:47:12 +00:00
layout_2020 layout: Add initial support for bidirectional text (BiDi) (#33148) 2024-08-21 14:28:54 +00:00
layout_thread legacy-layout: Fix display list building after WebRender upgrade (#33073) 2024-08-16 10:02:43 +00:00
layout_thread_2020 Replace lazy_static crate with std::sync::LazyLock in layout and config (#33065) 2024-08-15 16:28:04 +00:00
media Remove lazy static (#33078) 2024-08-16 03:57:09 +00:00
metrics Rename gfx to fonts (#32556) 2024-06-19 20:26:19 +00:00
net Remove unused constant from components/net/fetch/methods.rs (#33054) 2024-08-14 18:35:13 +00:00
pixels Use workspace definitions for all crates and update to the 2021 edition (#32544) 2024-06-18 09:22:08 +00:00
profile clippy: Fix various clippy warnings throughout the code (#33003) 2024-08-13 05:16:47 +00:00
rand Remove lazy static (#33078) 2024-08-16 03:57:09 +00:00
range Refactor GlyphStore::iter_glyphs_for_byte_range without recursion (#33074) 2024-08-19 10:47:09 +00:00
script webgpu: Align writeBuffer with spec (#33147) 2024-08-21 11:46:23 +00:00
servo Remove the WebXR dependency on ancient time@0.1 crate (#32862) 2024-07-26 13:53:34 +00:00
shared Replace the lazy_static crate with std::sync::LazyLock in components/shared (#33060) 2024-08-15 12:05:29 +00:00
url script: Impl cloning of JSPrincipals (#32706) 2024-07-06 10:25:38 +00:00
webdriver_server dependencies: Upgrade cookie and rename Servo's Cookie to ServoCookie (#32861) 2024-07-26 16:13:39 +00:00
webgpu webgpu: Align writeBuffer with spec (#33147) 2024-08-21 11:46:23 +00:00