зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1141931 part 1 - Compute unicode-bidi property to proper values for ruby boxes. r=heycam
--HG-- extra : source : 7078930df197d7cf9d7d8b972c57632b4a0cf380
This commit is contained in:
Родитель
85fe2c1a16
Коммит
06272c8efd
|
@ -4,6 +4,7 @@
|
|||
}
|
||||
rbc {
|
||||
display: ruby-base-container;
|
||||
unicode-bidi: -moz-isolate;
|
||||
}
|
||||
[pseudo] {
|
||||
font-size: inherit;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
rbc {
|
||||
display: ruby-base-container;
|
||||
unicode-bidi: isolate;
|
||||
}
|
||||
|
|
|
@ -823,7 +823,7 @@ marquee[direction="up"], marquee[direction="down"] {
|
|||
rtc > rt {
|
||||
font-size: inherit;
|
||||
}
|
||||
ruby, rb, rt, rbc, rtc {
|
||||
unicode-bidi: isolate;
|
||||
ruby, rb, rt, rtc {
|
||||
unicode-bidi: -moz-isolate;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -447,6 +447,7 @@ nsStyleContext::GetUniqueStyleData(const nsStyleStructID& aSID)
|
|||
|
||||
UNIQUE_CASE(Display)
|
||||
UNIQUE_CASE(Text)
|
||||
UNIQUE_CASE(TextReset)
|
||||
|
||||
#undef UNIQUE_CASE
|
||||
|
||||
|
@ -706,6 +707,24 @@ nsStyleContext::ApplyStyleFixups(bool aSkipParentDisplayBasedStyleFixup)
|
|||
CreateEmptyStyleData(eStyleStruct_Border);
|
||||
CreateEmptyStyleData(eStyleStruct_Padding);
|
||||
}
|
||||
if (disp->IsRubyDisplayType()) {
|
||||
// Per CSS Ruby spec section Bidi Reordering, for all ruby boxes,
|
||||
// the 'normal' and 'embed' values of 'unicode-bidi' should compute to
|
||||
// 'isolate', and 'bidi-override' should compute to 'isolate-override'.
|
||||
const nsStyleTextReset* textReset = StyleTextReset();
|
||||
uint8_t unicodeBidi = textReset->mUnicodeBidi;
|
||||
if (unicodeBidi == NS_STYLE_UNICODE_BIDI_NORMAL ||
|
||||
unicodeBidi == NS_STYLE_UNICODE_BIDI_EMBED) {
|
||||
unicodeBidi = NS_STYLE_UNICODE_BIDI_ISOLATE;
|
||||
} else if (unicodeBidi == NS_STYLE_UNICODE_BIDI_OVERRIDE) {
|
||||
unicodeBidi = NS_STYLE_UNICODE_BIDI_ISOLATE_OVERRIDE;
|
||||
}
|
||||
if (unicodeBidi != textReset->mUnicodeBidi) {
|
||||
auto mutableTextReset = static_cast<nsStyleTextReset*>(
|
||||
GetUniqueStyleData(eStyleStruct_TextReset));
|
||||
mutableTextReset->mUnicodeBidi = unicodeBidi;
|
||||
}
|
||||
}
|
||||
|
||||
// Elements with display:inline whose writing-mode is orthogonal to their
|
||||
// parent's mode will be converted to display:inline-block.
|
||||
|
|
|
@ -76,18 +76,23 @@
|
|||
@supports (display:ruby) {
|
||||
*|*::-moz-ruby {
|
||||
display: ruby;
|
||||
unicode-bidi: -moz-isolate;
|
||||
}
|
||||
*|*::-moz-ruby-base {
|
||||
display: ruby-base;
|
||||
unicode-bidi: -moz-isolate;
|
||||
}
|
||||
*|*::-moz-ruby-text {
|
||||
display: ruby-text;
|
||||
unicode-bidi: -moz-isolate;
|
||||
}
|
||||
*|*::-moz-ruby-base-container {
|
||||
display: ruby-base-container;
|
||||
unicode-bidi: -moz-isolate;
|
||||
}
|
||||
*|*::-moz-ruby-text-container {
|
||||
display: ruby-text-container;
|
||||
unicode-bidi: -moz-isolate;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче