Files
firefox/testing/web-platform/tests/css/css-ruby/ruby-position.html
T
Kent Tamura 9feff211db Bug 1632746 [wpt PR 23221] - Implement and ship 'ruby-position' CSS property, a=testonly
Automatic update from web-platform-tests
Implement and ship 'ruby-position' CSS property

This CL implements 'ruby-position' CSS property, which is a property
independent from the existing '-webkit-ruby-position', but these
properties share a single ComputedStyle field.

We apply neither legacy name alias [1] nor legacy shorthands [2] because
 - Acceptable keyword sets are different in ruby-position and
   -webkit-ruby-position.
 - Avoid behavior changes with |element.style.webkitRubyPosition =
   'after'|.

* core/css/css_computed_style_declaration.cc
  Add 'ruby-position' to getComputedStyle() enumeration.

* core/css/parser/css_parser_fast_paths.cc
  Add setting for fast-path parsing

* core/css/properties/longhands/longhands_custom.cc
  Add CSSValueFromComputedStyleInternal() to translate a ComputedStyle::
  GetRubyPosition() value to 'over' or 'under'.

* core/css/resolver/style_builder_converter.{h,cc}
  Add a function to convert a parsed CSS keyword to a
  blink::RubyPosition value.

* web_tests/external/wpt/css/css-ruby/ruby-position.html
  New test to check ruby annotation position.

* web_tests/fast/ruby/ruby-position-om.html
  New test to check relationship between ruby-position and
  -webkit-ruby-position.

Approved intent: https://t.co/nmCPv0Onhk

[1] https://drafts.csswg.org/css-cascade/#legacy-name-alias
[2] https://drafts.csswg.org/css-cascade/#legacy-shorthand

Bug: 196690
Change-Id: I2f00099f90a2222b7ddba8b58c3a532f3b997744
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2152569
Reviewed-by: Anders Hartvoll Ruud <[email protected]>
Reviewed-by: Rune Lillesveen <[email protected]>
Reviewed-by: Koji Ishii <[email protected]>
Commit-Queue: Kent Tamura <[email protected]>
Cr-Commit-Position: refs/heads/master@{#762664}

--

wpt-commits: ae457cd8b39790508e841f581e2066871859db1a
wpt-pr: 23221
2020-04-30 19:04:07 +00:00

35 lines
1.4 KiB
HTML

<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-ruby/#rubypos">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<p><ruby id="o1" style="ruby-position: over">base<rt>annotation</rt></ruby></p>
<p><ruby id="o2" style="ruby-position: under">base<rt style="ruby-position: over">annotation</rt></ruby></p>
<p><ruby id="u1" style="ruby-position: under">base<rt>annotation</rt></ruby></p>
<p><ruby id="u2">base<rt style="ruby-position: under">annotation</rt></ruby></p>
<script>
test(() => {
const o1 = document.querySelector('#o1');
assert_true(o1.querySelector('rt').getBoundingClientRect().top <= o1.getBoundingClientRect().top);
}, 'ruby-position:over on <ruby> works');
test(() => {
const o2 = document.querySelector('#o2');
assert_true(o2.querySelector('rt').getBoundingClientRect().top <= o2.getBoundingClientRect().top);
}, 'ruby-position:over on <rt> works');
test(() => {
const u1 = document.querySelector('#u1');
assert_true(u1.querySelector('rt').getBoundingClientRect().bottom >= u1.getBoundingClientRect().bottom);
}, 'ruby-position:under on <ruby> works');
test(() => {
const u2 = document.querySelector('#u2');
assert_true(u2.querySelector('rt').getBoundingClientRect().bottom >= u2.getBoundingClientRect().bottom);
}, 'ruby-position:under on <rt> works');
</script>
</body>