mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1141931 part 1 - Compute unicode-bidi property to proper values for ruby boxes. r=heycam
This commit is contained in:
parent
8c07cb0b1c
commit
b82185f80d
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user