Files
firefox/testing/web-platform/tests/css/css-ruby/ruby-annotation-with-margin-ref.html
Martin Robinson 823923c44a Bug 2008011 [wpt PR 56945] - script: More thoroughly convert between UTF-16 and UTF-8 offsets in text inputs, a=testonly
Automatic update from web-platform-tests
script: More thoroughly convert between UTF-16 and UTF-8 offsets in text inputs

DOM APIs for interacting with selection and text in text inputs
`<input type=text>` and `<textarea>` all accept offsets and lenghths in
UTF-16 code units. Servo was not converting all of these offsets into
UTF-8 code units. This change makes it so that this conversion is done
more thoroughly and makes it clear when the code is dealing with UTF-8
offsets and UTF-16 offsets.

Helper functions are added for doing this conversion in both directions
as it is necessary. In addition, a `char` iterator is added for
`TextInput` as it is useful for doing this conversion. It will be used
more completely in the future when a `Rope` data structure is extracted
from `TextInput`.

Finally, specification text is added to all of the DOM implementation
touched here.

Signed-off-by: Martin Robinson <[email protected]>

--

wpt-commits: 78ebe5a82f362d69e24a30a06c994c7425bf4552
wpt-pr: 56945
2026-01-06 15:19:13 +00:00

30 lines
985 B
HTML

<!DOCTYPE html>
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
body {
display: flow-root;
font-family: Ahem;
font-size: 10px;
}
ruby {
color: transparent;
}
rt {
color: green;
}
</style>
<div style="margin: 10px 0px 20px 10px;"><ruby>base<rt>annotation</rt></ruby></div>
<div style="margin-top: 10px;"><ruby>base<rt>annotation</rt></ruby></div>
<div style="margin-bottom: 30px;"><ruby>base<rt>annotation</rt></ruby></div>
<div style="margin: 20px 0px 10px 10px"><ruby>base<rt>annotation</rt></ruby></div>
<div style="margin: 20px 0px 0px 0px"><ruby>base<rt>annotation</rt></ruby></div>
<div style="margin: 0px 0px 10px 0px"><ruby>base<rt>annotation</rt></ruby></div>
<div style="writing-mode: vertical-lr">
<div style="margin: 0px 0px 0px 10px"><ruby>base<rt>annotation</rt></ruby></div>
<div style="margin: 0px 0px 0px 10px"><ruby>base<rt>annotation</rt></ruby></div>
<div style="margin: -10px 0px 0px 0px"><ruby>base<rt>annotation</rt></ruby></div>
</div>