Intent to Implement and Ship: Unprefixed ruby-position CSS property

150 views
Skip to first unread message

TAMURA, Kent

unread,
Apr 16, 2020, 9:44:27 PM4/16/20
to blink-dev
tk...@chromium.org N/A Specification: https://drafts.csswg.org/css-ruby/#rubypos None; Not a big change. The 'ruby-position' CSS property controls the position of ruby annotation. It's the unprefixed version of the existing '-webkit-ruby-position' property.
We'll ship 'ruby-position' with two supported keywords 'over' and 'under', without 'inter-caracter'. It's same as Firefox. Firefox supports no '-webkit-ruby-position', but 'ruby-position'. Shipping 'ruby-position' improves browser interoperability and websites won't need to rely on the vendor-prefixed '-webkit-ruby-position'.
Interoperability risk: Very low. Firefox already supports 'ruby-position', and Safari already supports '-webkit-ruby-position'. Compatibility risk: Very low. We won't change the behavior of the existing '-webkit-ruby-position'.

Firefox: Shipped Edge: No public signals; EdgeHTML didn't have 'ruby-position' Safari: No public signals; Shipped prefixed '-webkit-ruby-position' Web developers: Positive (https://bugs.chromium.org/p/chromium/issues/detail?id=196690#c13 and https://bugs.chromium.org/p/chromium/issues/detail?id=196690#c15) Multiple video vendors asked this feature.
Yes Yes https://wpt.fyi/results/css/css-ruby https://bugs.chromium.org/p/chromium/issues/detail?id=196690 https://chromestatus.com/feature/6249925820022784
This intent message was generated by Chrome Platform Status.



--
TAMURA Kent
Software Engineer, Google


Mike West

unread,
Apr 17, 2020, 1:55:48 AM4/17/20
to TAMURA, Kent, blink-dev
LGTM1.

Matching Firefox's behavior by shipping the unprefixed attribute seems like a positive step. It would be helpful to file a bug against WebKit to see if they'd be willing to follow suit and ship an unprefixed version as well. That might give us the ability to deprecate the prefixed version at some point in the future.

-mike


--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAGH7WqESu2t_Z9W26BdhEnw2WLPf_jbi6hfnBm84qe6-PvYPMQ%40mail.gmail.com.

Manuel Rego Casasnovas

unread,
Apr 17, 2020, 3:07:32 AM4/17/20
to blin...@chromium.org, TAMURA, Kent
Hi,

It's great we're moving to the standard unprefixed property!

On 17/04/2020 03:44, TAMURA, Kent wrote:> Summary
> The 'ruby-position' CSS property controls the position of
> ruby annotation. It's the unprefixed version of the existing
> '-webkit-ruby-position' property.
> We'll ship 'ruby-position' with two supported keywords 'over' and
> 'under', without 'inter-caracter'. It's same as Firefox.

We currently have "-webkit-ruby-position: before|after" supported, are
we dropping the prefixed property?
Or "before|after" will only be supported on "-webkit-ruby-position" but
not in "ruby-position"; and "under|over" will be only supported by
"ruby-position" but not the prefixed version?
Could you clarify the plan regarding this?

> /Safari/: No public signals

Could you please notify on the WebKit bug that we're unprefixing this in
Chromium? https://bugs.webkit.org/show_bug.cgi?id=151306

> Is this feature fully tested by web-platform-tests
> <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md>?Yes
> https://wpt.fyi/results/css/css-ruby

I see there are some tests regarding parsing, but for the different
behavior "under" vs "over" I don't see tests. It'd be nice to add some
tests to check that and ensure interop with Firefox.

Bye,
Rego

TAMURA, Kent

unread,
Apr 17, 2020, 3:09:41 AM4/17/20
to Mike West, blink-dev
Here is a WebKit bug filed in 2015.

TAMURA, Kent

unread,
Apr 17, 2020, 3:23:04 AM4/17/20
to Manuel Rego Casasnovas, blink-dev
On Fri, Apr 17, 2020 at 4:07 PM Manuel Rego Casasnovas <re...@igalia.com> wrote:
Hi,

It's great we're moving to the standard unprefixed property!

On 17/04/2020 03:44, TAMURA, Kent wrote:> Summary
> The 'ruby-position' CSS property controls the position of
> ruby annotation. It's the unprefixed version of the existing
> '-webkit-ruby-position' property.
> We'll ship 'ruby-position' with two supported keywords 'over' and
> 'under', without 'inter-caracter'. It's same as Firefox.

We currently have "-webkit-ruby-position: before|after" supported, are
we dropping the prefixed property?
Or "before|after" will only be supported on "-webkit-ruby-position" but
not in "ruby-position"; and "under|over" will be only supported by
"ruby-position" but not the prefixed version?
Could you clarify the plan regarding this?

My plan is that:
  * -webkit-ruby-position continues to support only before/after.
  * ruby-position supports only over/under.
  * They are independent properties, not aliases, but they share a field of blink::ComputedStyle.

  |element.style.webkitRubyPosition = 'after'| continues to produce |style="-webkit-ruby-position: after;"|.  |element.style.webkitRubyPosition = 'under'| doesn't work.
  |element.style.rubyPosition = ' under'| produces |style="ruby-position: under;"|.  |element.style.rubyPosition = 'after'| doesn't work.

If '-webkit-ruby-position: after' is specified to an element,
  |getComputedStyle(element)['-webkit-ruby-position']| continues to return "after", and
  |getComputedStyle(element)['ruby-position']| returns "under".

If 'ruby-position: under' is specified to an element,
  |getComputedStyle(element)['-webkit-ruby-position']| returns "after", and
  |getComputedStyle(element)['ruby-position']| returns "under".
 

> /Safari/: No public signals

Could you please notify on the WebKit bug that we're unprefixing this in
Chromium? https://bugs.webkit.org/show_bug.cgi?id=151306

 


> Is this feature fully tested by web-platform-tests
> <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md>?Yes
> https://wpt.fyi/results/css/css-ruby

I see there are some tests regarding parsing, but for the different
behavior "under" vs "over" I don't see tests. It'd be nice to add some
tests to check that and ensure interop with Firefox.

block-ruby-004.html, block-ruby-005.html, ruby-justification-002.html contain "ruby-position: under".
 

Bye,
  Rego


--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

PhistucK

unread,
Apr 17, 2020, 3:26:05 AM4/17/20
to TAMURA, Kent, Manuel Rego Casasnovas, blink-dev

Manuel Rego Casasnovas

unread,
Apr 17, 2020, 10:59:27 AM4/17/20
to TAMURA, Kent, blink-dev
This seems to fit in a "legacy shorthand" as described at:
https://drafts.csswg.org/css-cascade/#legacy-shorthand
But that's not 2 independent properties like you described.
I believe we should follow the shorthand path here.

Also I guess it'd be good add some kind of deprecation message when
people use the prefixed property so they start moving over the
unprefixed one.

> > /Safari/: No public signals
>
> Could you please notify on the WebKit bug that we're unprefixing this in
> Chromium? https://bugs.webkit.org/show_bug.cgi?id=151306
>
>
> Done in https://bugs.webkit.org/show_bug.cgi?id=151306

Thanks!

> > Is this feature fully tested by web-platform-tests
> >
> <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md>?Yes
> > https://wpt.fyi/results/css/css-ruby
>
> I see there are some tests regarding parsing, but for the different
> behavior "under" vs "over" I don't see tests. It'd be nice to add some
> tests to check that and ensure interop with Firefox.
>
>
> block-ruby-004.html, block-ruby-005.html, ruby-justification-002.html
> contain "ruby-position: under".

They use "ruby-position: under" the same that it's used on the reference
files of those tests. So I believe they're not actually testing that
feature but something else.

IMHO we should add some tests in WPT for this property as part of this work.

Bye,
Rego

Simon Pieters

unread,
Apr 17, 2020, 4:54:11 PM4/17/20
to Manuel Rego Casasnovas, TAMURA, Kent, blink-dev
I agree. I think this could be done as soon as the prefixed property is supported. Usage of the prefixed version is low, but seems to be growing, so deprecating it sooner seems better than later. It would also put some pressure on WebKit to support the unprefixed property if sites are using unprefixed only.

https://chromestatus.com/metrics/css/timeline/popularity/314
 

>     > /Safari/: No public signals
>
>     Could you please notify on the WebKit bug that we're unprefixing this in
>     Chromium? https://bugs.webkit.org/show_bug.cgi?id=151306
>
>
> Done in https://bugs.webkit.org/show_bug.cgi?id=151306

Thanks!

>     > Is this feature fully tested by web-platform-tests
>     >
>     <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md>?Yes
>     > https://wpt.fyi/results/css/css-ruby
>
>     I see there are some tests regarding parsing, but for the different
>     behavior "under" vs "over" I don't see tests. It'd be nice to add some
>     tests to check that and ensure interop with Firefox.
>
>
> block-ruby-004.html, block-ruby-005.html, ruby-justification-002.html
> contain "ruby-position: under".

They use "ruby-position: under" the same that it's used on the reference
files of those tests. So I believe they're not actually testing that
feature but something else.

IMHO we should add some tests in WPT for this property as part of this work.

Bye,
  Rego

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

TAMURA, Kent

unread,
Apr 19, 2020, 9:11:15 PM4/19/20
to Manuel Rego Casasnovas, blink-dev
With "legacy shorthand",   |element.style.webkitRubyPosition = 'after'| will produce |style="ruby-position: under; "| though it now produces |style="-webkit-ruby-position: after; "|.  It could be a site compatibility issue and an interoperability issue with Safari.  The risk would be small, however IMO we should take a safer approach in the current world situation.
 

Also I guess it'd be good add some kind of deprecation message when
people use the prefixed property so they start moving over the
unprefixed one.

Yeah, I'm going to send I2D(R) later.
 

>     > /Safari/: No public signals
>
>     Could you please notify on the WebKit bug that we're unprefixing this in
>     Chromium? https://bugs.webkit.org/show_bug.cgi?id=151306
>
>
> Done in https://bugs.webkit.org/show_bug.cgi?id=151306

Thanks!

>     > Is this feature fully tested by web-platform-tests
>     >
>     <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md>?Yes
>     > https://wpt.fyi/results/css/css-ruby
>
>     I see there are some tests regarding parsing, but for the different
>     behavior "under" vs "over" I don't see tests. It'd be nice to add some
>     tests to check that and ensure interop with Firefox.
>
>
> block-ruby-004.html, block-ruby-005.html, ruby-justification-002.html
> contain "ruby-position: under".

They use "ruby-position: under" the same that it's used on the reference
files of those tests. So I believe they're not actually testing that
feature but something else.

IMHO we should add some tests in WPT for this property as part of this work.

Bye,
  Rego

Yoav Weiss

unread,
Apr 20, 2020, 1:52:11 AM4/20/20
to TAMURA, Kent, Manuel Rego Casasnovas, blink-dev
If they are independent attributes, why would setting one impact the other? Are there compat risks with not doing that?
 
 

> /Safari/: No public signals

Could you please notify on the WebKit bug that we're unprefixing this in
Chromium? https://bugs.webkit.org/show_bug.cgi?id=151306

 


> Is this feature fully tested by web-platform-tests
> <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md>?Yes
> https://wpt.fyi/results/css/css-ruby

I see there are some tests regarding parsing, but for the different
behavior "under" vs "over" I don't see tests. It'd be nice to add some
tests to check that and ensure interop with Firefox.

block-ruby-004.html, block-ruby-005.html, ruby-justification-002.html contain "ruby-position: under".
 

Bye,
  Rego

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/1e3033b2-fdfa-4a42-4038-6e221ffbf5a0%40igalia.com.


--
TAMURA Kent
Software Engineer, Google


--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Manuel Rego Casasnovas

unread,
Apr 20, 2020, 11:41:27 AM4/20/20
to Yoav Weiss, TAMURA, Kent, blink-dev

On 20/04/2020 07:51, Yoav Weiss wrote:
> My plan is that:
>   * -webkit-ruby-position continues to support only before/after.
>   * ruby-position supports only over/under.
>   * They are independent properties, not aliases, but they share a
> field of blink::ComputedStyle.
>
>   |element.style.webkitRubyPosition = 'after'| continues to produce
> |style="-webkit-ruby-position: after;"|. 
> |element.style.webkitRubyPosition = 'under'| doesn't work.
>   |element.style.rubyPosition = ' under'| produces
> |style="ruby-position: under;"|.  |element.style.rubyPosition =
> 'after'| doesn't work.
>
> If '-webkit-ruby-position: after' is specified to an element,
>   |getComputedStyle(element)['-webkit-ruby-position']| continues to
> return "after", and
>   |getComputedStyle(element)['ruby-position']| returns "under".
>
> If 'ruby-position: under' is specified to an element,
>   |getComputedStyle(element)['-webkit-ruby-position']| returns
> "after", and
>   |getComputedStyle(element)['ruby-position']| returns "under".
>
>
> If they are independent attributes, why would setting one impact the
> other? Are there compat risks with not doing that?

I think it'd be really weird to have 2 properties for the same thing
that are totally independent.
You could be creating things like this:
-webkit-ruby-position: after;
ruby-position: over;
or:
ruby-position: under;
-webkit-ruby-position: before;

And then you'll have a hard time deciding which behavior to follow.

Bye,
Rego
pEpkey.asc

Manuel Rego Casasnovas

unread,
Apr 20, 2020, 11:43:08 AM4/20/20
to TAMURA, Kent, blink-dev

LGTM2, with some new tests in WPT.

On 20/04/2020 03:10, TAMURA, Kent wrote:
> With "legacy shorthand",   |element.style.webkitRubyPosition = 'after'|
> will produce |style="ruby-position: under; "| though it now produces
> |style="-webkit-ruby-position: after; "|.  It could be a site
> compatibility issue and an interoperability issue with Safari.  The risk
> would be small, however IMO we should take a safer approach in the
> current world situation.

Ok, this is a very small risk IMHO but I guess it's better to play safe
in the current situation as you said. So thanks for thinking about it.

Going into the implementation details I guess you'd be using
"surrogate_for" in css_properties.json5.

> Also I guess it'd be good add some kind of deprecation message when
> people use the prefixed property so they start moving over the
> unprefixed one.
>
>
> Yeah, I'm going to send I2D(R) later.

As I said I believe we should mark it as deprecated on the same version
we ship the unprefixed property. So please take care of coordinating this.

> >     > Is this feature fully tested by web-platform-tests
> >     >
> >   
>  <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md>?Yes
> >     > https://wpt.fyi/results/css/css-ruby
> >
> >     I see there are some tests regarding parsing, but for the
> different
> >     behavior "under" vs "over" I don't see tests. It'd be nice to
> add some
> >     tests to check that and ensure interop with Firefox.
> >
> >
> > block-ruby-004.html, block-ruby-005.html, ruby-justification-002.html
> > contain "ruby-position: under".
>
> They use "ruby-position: under" the same that it's used on the reference
> files of those tests. So I believe they're not actually testing that
> feature but something else.
>
> IMHO we should add some tests in WPT for this property as part of
> this work.

Regarding testing, please make sure you add at least some simple tests
to verify the behvavior of ruby-position over vs under.
For example you could become fast/ruby/position-after.html a ref-test
(or a checkLayout() test) and move it to WPT (then we'll have one less
pixel test too).

Bye,
Rego
pEpkey.asc

Chris Harrelson

unread,
Apr 23, 2020, 3:18:40 PM4/23/20
to Manuel Rego Casasnovas, TAMURA, Kent, blink-dev
LGTM3

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

TAMURA, Kent

unread,
Apr 26, 2020, 8:34:55 PM4/26/20
to Manuel Rego Casasnovas, blink-dev
On Tue, Apr 21, 2020 at 12:43 AM Manuel Rego Casasnovas <re...@igalia.com> wrote:
>     > block-ruby-004.html, block-ruby-005.html, ruby-justification-002.html
>     > contain "ruby-position: under".
>
>     They use "ruby-position: under" the same that it's used on the reference
>     files of those tests. So I believe they're not actually testing that
>     feature but something else.
>
>     IMHO we should add some tests in WPT for this property as part of
>     this work.

Regarding testing, please make sure you add at least some simple tests
to verify the behvavior of ruby-position over vs under.
For example you could become fast/ruby/position-after.html a ref-test
(or a checkLayout() test) and move it to WPT (then we'll have one less
pixel test too).

We added css/css-ruby/ruby-position.html.
Reply all
Reply to author
Forward
0 new messages