Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby styling #121

Open
domenic opened this issue Sep 8, 2015 · 8 comments
Open

Ruby styling #121

domenic opened this issue Sep 8, 2015 · 8 comments
Labels
needs implementer interest Moving the issue forward requires implementers to express interest topic: rendering topic: ruby

Comments

@domenic
Copy link
Member

domenic commented Sep 8, 2015

#101 is trying to sort out the parser. Here is some data on the UA styling:

HTML Standard

ruby { display: ruby; }
rt { display: ruby-text; }

W3C HTML 5.1

ruby { display: ruby; }
rb   { display: ruby-base; white-space: nowrap; }
rt   {
    display: ruby-text;
    white-space: nowrap;
    font-size: 50%;
    font-variant-east-asian: ruby;
    text-emphasis: none;
}
rbc  { display: ruby-base-container; }
rtc  { display: ruby-text-container; }
ruby, rb, rt, rbc, rtc { unicode-bidi: isolate; }

Chrome

ruby, rt {
    text-indent: 0; /* blocks used for ruby rendering should not trigger this */
}

rt {
    line-height: normal;
    -webkit-text-emphasis: none;
}

ruby > rt {
    display: block;
    font-size: 50%;
    text-align: start;
}

ruby > rp {
    display: none;
}

WebKit

ruby, rt {
    text-indent: 0; /* blocks used for ruby rendering should not trigger this */
}

rt {
    line-height: normal;
    -webkit-text-emphasis: none;
}

ruby > rt {
    display: block;
    font-size: -webkit-ruby-text;
    text-align: start;
}

ruby > rp {
    display: none;
}

Firefox

ruby {
  display: ruby;
}
rb {
  display: ruby-base;
  white-space: nowrap;
}
rp {
  display: none;
}
rt {
  display: ruby-text;
}
rtc {
  display: ruby-text-container;
}
rtc, rt {
  white-space: nowrap;
  font-size: 50%;
  line-height: 1;
  font-variant-east-asian: ruby;
}
@supports (text-emphasis: none) {
  rtc, rt {
    text-emphasis: none;
  }
}
rtc:lang(zh), rt:lang(zh) {
  ruby-align: center;
}
rtc:lang(zh-TW), rt:lang(zh-TW) {
  font-size: 30%; /* bopomofo */
}
rtc > rt {
  font-size: inherit;
}
ruby, rb, rt, rtc {
  unicode-bidi: -moz-isolate;
}

It seems likely we should not have any styling rules for rb and rtc, as those are only in Gecko (plus W3C HTML).

@kojiishi
Copy link

kojiishi commented Sep 9, 2015

The diff corresponds to when implementers referred the CSS Ruby spec, as it's changing quite often and quite drastically. Gecko implemented after the last large refactor of the spec, so it's most up-to-date.

I'm not familiar with how much copy of CSS specs HTML spec should have. Is it possible to simply delegate to CSS Ruby as it's still WD and is possibly to evolve further? That makes CSS spec editors a bit happier to maintain single copy.

Or do we want to have the minimum common denominator in HTML spec?

@domenic
Copy link
Member Author

domenic commented Sep 9, 2015

That's a good question. I've never seen a CSS spec with UA stylesheets in them before, and I note that that entire appendix is marked informative. So we'd want to have a normative definition somewhere, probably in HTML since that's where the rest of the UA stylesheet is defined (I think?).

We also need something that reflects reality. The Ruby spec you reference is reasonably close to Firefox, but not to any other browsers. So it doesn't seem likely to be a good reference anyway.

@annevk
Copy link
Member

annevk commented Sep 9, 2015

The HTML Standard should contain the default styling for ruby elements. CSS should just define how those styles are to be rendered. CSS should not define the look-and-feel of HTML markup though.

@kojiishi
Copy link

kojiishi commented Sep 9, 2015

Thank you both, understood, but...this looks hard. No UA other than Gecko, AFAIK, has implemented display: ruby, so no specs reflect the reality as of today. But how could we define ruby rendering without using it, I don't have a good idea how to solve it.

And you're right, the CSS spec is still much before call-for-implementation, and after a large refactor, so it's far from "commonly implemented."

Maybe disregard the display property as the current spec do, and try to find common implementations for other properties?

annevk added a commit that referenced this issue Sep 10, 2015
Ruby parsing got forked in two directions. This aligns the parser with the majority of implementations. Remaining implementations have agreed to make these changes as well, hopefully leading us back to fully interoperable HTML parsing.

This does not make either rb or rtc elements conforming. It also does not change any rendering rules. That is separately discussed in #121.
annevk added a commit that referenced this issue Sep 10, 2015
Ruby parsing got forked in two directions. This aligns the parser with the majority of implementations. Remaining implementations have agreed to make these changes as well, hopefully leading us back to fully interoperable HTML parsing.

This does not make either rb or rtc elements conforming. It also does not change any rendering rules. That is separately discussed in #121.
@annevk annevk added the needs implementer interest Moving the issue forward requires implementers to express interest label Sep 10, 2015
annevk added a commit that referenced this issue Sep 10, 2015
Ruby parsing got forked in two directions. This aligns the parser with the majority of implementations. Remaining implementations have agreed to make these changes as well, hopefully leading us back to fully interoperable HTML parsing.

This does not make either rb or rtc elements conforming. It also does not change any rendering rules. That is separately discussed in #121.
@upsuper
Copy link
Member

upsuper commented Sep 11, 2016

FWIW, the W3C i18n wg recently resolved to ask html to remove rb and rtc from the list of "obsolete" tags.

@stevefaulkner
Copy link
Contributor

@upsuper note the request has been fulfilled w3c/html#579

@kojiishi
Copy link

@upsuper shouldn't it have its own issue rather than just a comment to this issue? I support it.

@zcorpan
Copy link
Member

zcorpan commented Sep 20, 2016

From #1799

  <p>For the purposes of the CSS ruby model, runs of children of <code>ruby</code> elements that are
  not <code>rt</code> or <code>rp</code> elements are expected to be wrapped in anonymous boxes
  whose <span>'display'</span> property has the value <span>'ruby-base'</span>. <ref
  spec=CSSRUBY></p>

@bzbarsky:

The ruby/colgroup parts are simply nonsense, imo. The HTML spec should simply define the default UA styling for those (setting the display) property and say nothing else.

frivoal added a commit to frivoal/html that referenced this issue Mar 11, 2021
frivoal added a commit to frivoal/html that referenced this issue Mar 11, 2021
frivoal added a commit to frivoal/html that referenced this issue Mar 11, 2021
frivoal added a commit to frivoal/html that referenced this issue Mar 11, 2021
frivoal added a commit to frivoal/html that referenced this issue Mar 12, 2021
frivoal added a commit to frivoal/html that referenced this issue Jul 26, 2021
frivoal added a commit to frivoal/html that referenced this issue Jul 26, 2021
frivoal added a commit to frivoal/html that referenced this issue Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs implementer interest Moving the issue forward requires implementers to express interest topic: rendering topic: ruby
Development

No branches or pull requests

6 participants