Page MenuHomePhabricator

ruby-align and ruby-position (Ruby Level 1) are not recognised by CSS-sanitizer
Closed, ResolvedPublicFeature

Description

'''Whats the problem'''

CSS attributes ruby-position and ruby-align are "unrecognised" by the CSS-Sanitizer used for Template styles.

This is in connection with a use-case for ruby at Wikisource: - https://en.wikisource.org/w/index.php?title=Page:Kutenai_Tales.djvu/18 and https://en.wikisource.org/wiki/Template:Kut-eng.

I was updating a template at Wikisource to use ruby elements semantically :
https://en.wikisource.org/w/index.php?title=Template:Kut-eng&oldid=11087421

In connection with the layout here:- https://en.wikisource.org/w/index.php?title=Page:Kutenai_Tales.djvu/18

The intended style sheet would have been:

.__kuteani {
	-webkit-ruby-position: after; /* This line is needed for Safari per MDN. */
	ruby-position: under;
	ruby-align: center;
}

The editor for the CSS stylesheet stated that the ruby-position and ruby-align properties were 'unrecognized'

'''What is the solution you want'''

Recognition of the appropriate CSS attributes in the CSS sanitizer (And the prefixed version for Safari) , so I can use the TemplateStyle I intended.

Documentation on the CSS attributes concerned:-
ruby-position: https://developer.mozilla.org/en-US/docs/Web/CSS/ruby-position
ruby-align: https://developer.mozilla.org/en-US/docs/Web/CSS/ruby-align

Browser support:
ruby-position: https://caniuse.com/?search=ruby-position (75% in 2021)
ruby-align: https://caniuse.com/?search=ruby-align (4% in 2021)

Details

Related Changes in Gerrit:

Event Timeline

Aklapper renamed this task from ruby-align and ruby-position are not recognised by CSS-santizer. to ruby-align and ruby-position are not recognised by CSS-sanitizer.Mar 18 2021, 4:26 PM

The editor for the CSS stylesheet stated that the ruby-position and ruby-align properties were 'unrecognized'

As a note, the editor is not the correct check for whether a property is supported; the list of properties/values supported by the editor differs from the list of properties/values supported by CSS sanitizer.

It does happen to be the case that this property is not supported by CSS sanitizer; this would be identified when you attempted to save.

Would recognition of the property concerned in the editor require a separate ticket, once the sanitizer supports it?

I don't really know. Given how closely tied the two systems are (TStyles and CSSS), I'd say no, but...

The editor uses CodeMirror style rules, it has nothing to do with TemplateStyles. So yes, that would have to be a separate task (possibly upstream).

Izno changed the subtype of this task from "Task" to "Feature Request".Jan 14 2023, 1:54 AM
tstarling renamed this task from ruby-align and ruby-position are not recognised by CSS-sanitizer to ruby-align and ruby-position (Ruby Level 1) are not recognised by CSS-sanitizer.May 19 2025, 12:58 AM
tstarling added a project: Wikimedia Wishathon.

Change #1148487 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[css-sanitizer@master] Add Ruby Level 1

https://gerrit.wikimedia.org/r/1148487

Change #1148487 merged by jenkins-bot:

[css-sanitizer@master] Add Ruby Level 1

https://gerrit.wikimedia.org/r/1148487