Bug 1268347 - Forbid break opportunities inside horizontal-in-vertical. r=jfkthame
authorXidorn Quan <quanxunzhen@gmail.com>
Tue, 03 May 2016 14:39:24 +1000
changeset 335105 9a5bd81a31052c842daa0a0bad3c864b6f6f84d5
parent 335104 b25511aef2655ade9c48cb7f21972f28d596d750
child 335106 19216295bd20ea96b02b4d980a1a7c6f33f9640d
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1268347
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1268347 - Forbid break opportunities inside horizontal-in-vertical. r=jfkthame MozReview-Commit-ID: K8ao3D0IE93
layout/reftests/w3c-css/submitted/writing-modes-3/reftest.list
layout/reftests/w3c-css/submitted/writing-modes-3/text-combine-upright-break-inside-001-ref.html
layout/reftests/w3c-css/submitted/writing-modes-3/text-combine-upright-break-inside-001.html
layout/reftests/w3c-css/submitted/writing-modes-3/text-combine-upright-break-inside-001a.html
layout/style/nsStyleStructInlines.h
--- a/layout/reftests/w3c-css/submitted/writing-modes-3/reftest.list
+++ b/layout/reftests/w3c-css/submitted/writing-modes-3/reftest.list
@@ -1,10 +1,12 @@
 default-preferences pref(layout.css.text-combine-upright.enabled,true)
 
+== text-combine-upright-break-inside-001.html text-combine-upright-break-inside-001-ref.html
+== text-combine-upright-break-inside-001a.html text-combine-upright-break-inside-001-ref.html
 == text-combine-upright-compression-001.html text-combine-upright-compression-001-ref.html
 == text-combine-upright-compression-002.html text-combine-upright-compression-002-ref.html
 == text-combine-upright-compression-003.html text-combine-upright-compression-003-ref.html
 == text-combine-upright-compression-004.html text-combine-upright-compression-004-ref.html
 == text-combine-upright-compression-005.html text-combine-upright-compression-005-ref.html
 == text-combine-upright-compression-005a.html text-combine-upright-compression-005-ref.html
 == text-combine-upright-compression-006.html text-combine-upright-compression-006-ref.html
 == text-combine-upright-compression-006a.html text-combine-upright-compression-006-ref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/writing-modes-3/text-combine-upright-break-inside-001-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="ja">
+<head>
+<meta charset="UTF-8">
+<title>CSS Reference: text-combine-upright, no line break</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="stylesheet" href="support/tcy.css">
+<style>
+.test { writing-mode: vertical-rl; }
+.test > p { height: 3em; margin: 0 5em; }
+.tcy, .fake-tcy { color: transparent; }
+</style>
+</head>
+<body>
+<p>Test passes if the two columns are identical.</p>
+<div class="test">
+  <p style="white-space: nowrap">XXXXX<span class="fake-tcy">X</span>XXXXX</p>
+  <p style="white-space: nowrap">XXXXX<span class="fake-tcy">X</span>XXXXX</p>
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/writing-modes-3/text-combine-upright-break-inside-001.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="ja">
+<head>
+<meta charset="UTF-8">
+<title>CSS Test: text-combine-upright, whitespace inside tcy with insufficient line space</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#text-combine-layout">
+<link rel="match" href="text-combine-upright-break-inside-001-ref.html">
+<meta name="assert" content="line should never be broken inside text-combine-upright text node">
+<link rel="stylesheet" href="support/tcy.css">
+<style>
+.test { writing-mode: vertical-rl; }
+.test > p { height: 3em; margin: 0 5em; }
+.tcy, .fake-tcy { color: transparent; }
+</style>
+</head>
+<body>
+<p>Test passes if the two columns are identical.</p>
+<div class="test">
+  <p>XXXXX<span class="tcy">X X</span>XXXXX</p>
+  <p style="white-space: nowrap">XXXXX<span class="fake-tcy">X</span>XXXXX</p>
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/writing-modes-3/text-combine-upright-break-inside-001a.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="ja">
+<head>
+<meta charset="UTF-8">
+<title>CSS Test: text-combine-upright, white-space: pre with new line</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#text-combine-layout">
+<link rel="match" href="text-combine-upright-break-inside-001-ref.html">
+<meta name="assert" content="line should never be broken inside text-combine-upright text node">
+<link rel="stylesheet" href="support/tcy.css">
+<style>
+.test { writing-mode: vertical-rl; }
+.test > p { height: 3em; margin: 0 5em; }
+.tcy { white-space: pre; }
+.tcy, .fake-tcy { color: transparent; }
+</style>
+</head>
+<body>
+<p>Test passes if the two columns are identical.</p>
+<div class="test">
+  <p>XXXXX<span class="tcy">X
+X</span>XXXXX</p>
+  <p style="white-space: nowrap">XXXXX<span class="fake-tcy">X</span>XXXXX</p>
+</div>
+</body>
+</html>
--- a/layout/style/nsStyleStructInlines.h
+++ b/layout/style/nsStyleStructInlines.h
@@ -43,24 +43,26 @@ nsStyleText::GetTextShadow() const
   return mTextShadow;
 }
 
 bool
 nsStyleText::NewlineIsSignificant(const nsTextFrame* aContextFrame) const
 {
   NS_ASSERTION(aContextFrame->StyleText() == this, "unexpected aContextFrame");
   return NewlineIsSignificantStyle() &&
-    !aContextFrame->ShouldSuppressLineBreak();
+         !aContextFrame->ShouldSuppressLineBreak() &&
+         !aContextFrame->StyleContext()->IsTextCombined();
 }
 
 bool
 nsStyleText::WhiteSpaceCanWrap(const nsIFrame* aContextFrame) const
 {
   NS_ASSERTION(aContextFrame->StyleText() == this, "unexpected aContextFrame");
-  return WhiteSpaceCanWrapStyle() && !aContextFrame->IsSVGText();
+  return WhiteSpaceCanWrapStyle() && !aContextFrame->IsSVGText() &&
+         !aContextFrame->StyleContext()->IsTextCombined();
 }
 
 bool
 nsStyleText::WordCanWrap(const nsIFrame* aContextFrame) const
 {
   NS_ASSERTION(aContextFrame->StyleText() == this, "unexpected aContextFrame");
   return WordCanWrapStyle() && !aContextFrame->IsSVGText();
 }