Bug 1193519 pt 5 - Expose the sideways-lr value for writing-mode to CSS. r=dholbert

This commit is contained in:
Jonathan Kew 2015-09-24 10:23:34 +01:00
parent a58c826891
commit b20e9ca870
5 changed files with 7 additions and 22 deletions

View File

@ -6663,10 +6663,9 @@ nsLayoutUtils::GetTextRunOrientFlagsForStyle(nsStyleContext* aStyleContext)
return 0;
}
/* not yet implemented:
case NS_STYLE_WRITING_MODE_SIDEWAYS_LR:
return gfxTextRunFactory::TEXT_ORIENT_VERTICAL_SIDEWAYS_LEFT;
*/
case NS_STYLE_WRITING_MODE_SIDEWAYS_RL:
return gfxTextRunFactory::TEXT_ORIENT_VERTICAL_SIDEWAYS_RIGHT;

View File

@ -485,7 +485,7 @@ CSS_KEY(sepia, sepia)
CSS_KEY(serif, serif)
CSS_KEY(show, show)
CSS_KEY(sideways, sideways)
/*CSS_KEY(sideways-lr, sideways_lr)*/
CSS_KEY(sideways-lr, sideways_lr)
CSS_KEY(sideways-right, sideways_right) /* alias for 'sideways' */
CSS_KEY(sideways-rl, sideways_rl)
CSS_KEY(simp-chinese-formal, simp_chinese_formal)

View File

@ -1944,7 +1944,7 @@ const KTableValue nsCSSProps::kWritingModeKTable[] = {
eCSSKeyword_horizontal_tb, NS_STYLE_WRITING_MODE_HORIZONTAL_TB,
eCSSKeyword_vertical_lr, NS_STYLE_WRITING_MODE_VERTICAL_LR,
eCSSKeyword_vertical_rl, NS_STYLE_WRITING_MODE_VERTICAL_RL,
/* eCSSKeyword_sideways_lr, NS_STYLE_WRITING_MODE_SIDEWAYS_LR, */
eCSSKeyword_sideways_lr, NS_STYLE_WRITING_MODE_SIDEWAYS_LR,
eCSSKeyword_sideways_rl, NS_STYLE_WRITING_MODE_SIDEWAYS_RL,
eCSSKeyword_lr, NS_STYLE_WRITING_MODE_HORIZONTAL_TB,
eCSSKeyword_lr_tb, NS_STYLE_WRITING_MODE_HORIZONTAL_TB,

View File

@ -4731,8 +4731,8 @@ if (SpecialPowers.getBoolPref("layout.css.vertical-text.enabled")) {
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "horizontal-tb", "lr", "lr-tb", "rl", "rl-tb" ],
other_values: [ "vertical-lr", "vertical-rl", "sideways-rl", "tb", "tb-rl" ],
invalid_values: [ "10px", "30%", "justify", "auto", "1em", "sideways-lr" ] /* sideways-lr not yet supported */
other_values: [ "vertical-lr", "vertical-rl", "sideways-rl", "sideways-lr", "tb", "tb-rl" ],
invalid_values: [ "10px", "30%", "justify", "auto", "1em" ]
},
"text-orientation": {
domProp: "textOrientation",

View File

@ -72,13 +72,13 @@ var gWritingModes = [
block: "horizontal", inline: "vertical" },
{ style: [
"writing-mode: vertical-lr; direction: rtl; ",
// "writing-mode: sideways-lr; direction: ltr; ",
"writing-mode: sideways-lr; direction: ltr; ",
],
blockStart: "left", blockEnd: "right", inlineStart: "bottom", inlineEnd: "top",
block: "horizontal", inline: "vertical" },
{ style: [
"writing-mode: vertical-lr; direction: ltr; ",
// "writing-mode: sideways-lr; direction: rtl; ",
"writing-mode: sideways-lr; direction: rtl; ",
],
blockStart: "left", blockEnd: "right", inlineStart: "top", inlineEnd: "bottom",
block: "horizontal", inline: "vertical" },
@ -143,20 +143,6 @@ function init() {
make_declaration(gCSSProperties[`${aPrefix}height`].prerequisites)
});
});
// Assume that the sideways-lr keyword is not parsed yet for writing-mode.
// When we start supporting this keyword, the entries in the .style
// properties of the gWritingModes objects above should be uncommented.
var s = document.createElement("style");
document.body.appendChild(s);
s.textContent = "div { }";
s.sheet.cssRules[0].style.writingMode = "sideways-lr";
todo(s.sheet.cssRules[0].style.writingMode, "sideways-lr",
"uncomment sideways-lr cases from gWritingModes and " +
"remove this todo()!");
s.remove();
}
function test_computed_values(aTestName, aRules, aExpectedValues) {