Backed out 2 changesets (bug 1064172) for Wr failures at /css/css-text/boundary-shaping/boundary-shaping-010.html

Backed out changeset 8126c43fb9e7 (bug 1064172)
Backed out changeset 107a4383fa0c (bug 1064172)
This commit is contained in:
Coroiu Cristina 2018-12-29 16:43:23 +02:00
Родитель 49f58b6031
Коммит 2edc28a37f
22 изменённых файлов: 2 добавлений и 606 удалений

Просмотреть файл

@ -1828,15 +1828,6 @@ bool BuildTextRunsScanner::ContinueTextRunAcrossFrames(nsTextFrame* aFrame1,
}
ComputedStyle* sc1 = aFrame1->Style();
ComputedStyle* sc2 = aFrame2->Style();
// Any difference in writing-mode/directionality inhibits shaping across
// the boundary.
WritingMode wm(sc1);
if (wm != WritingMode(sc2)) {
return false;
}
const nsStyleText* textStyle1 = sc1->StyleText();
// If the first frame ends in a preformatted newline, then we end the textrun
// here. This avoids creating giant textruns for an entire plain text file.
@ -1844,78 +1835,8 @@ bool BuildTextRunsScanner::ContinueTextRunAcrossFrames(nsTextFrame* aFrame1,
// even if it has newlines in it, so typically we won't see trailing newlines
// until after reflow has broken up the frame into one (or more) frames per
// line. That's OK though.
if (textStyle1->NewlineIsSignificant(aFrame1) &&
HasTerminalNewline(aFrame1)) {
if (textStyle1->NewlineIsSignificant(aFrame1) && HasTerminalNewline(aFrame1))
return false;
}
if (aFrame1->GetParent()->GetContent() !=
aFrame2->GetParent()->GetContent()) {
// Does aFrame, or any ancestor between it and aAncestor, have a property
// that should inhibit cross-element-boundary shaping on aSide?
auto PreventCrossBoundaryShaping = [](const nsIFrame* aFrame,
const nsIFrame* aAncestor,
Side aSide) {
while (aFrame != aAncestor) {
ComputedStyle* ctx = aFrame->Style();
// According to https://drafts.csswg.org/css-text/#boundary-shaping:
//
// Text shaping must be broken at inline box boundaries when any of the
// following are true for any box whose boundary separates the two
// typographic character units:
//
// 1. Any of margin/border/padding separating the two typographic
// character units in the inline axis is non-zero.
const nsStyleCoord& margin = ctx->StyleMargin()->mMargin.Get(aSide);
if (!margin.ConvertsToLength() || margin.ToLength() != 0) {
return true;
}
const nsStyleCoord& padding = ctx->StylePadding()->mPadding.Get(aSide);
if (!padding.ConvertsToLength() || padding.ToLength() != 0) {
return true;
}
if (ctx->StyleBorder()->GetComputedBorderWidth(aSide) != 0) {
return true;
}
// 2. vertical-align is not baseline.
const nsStyleCoord& coord = ctx->StyleDisplay()->mVerticalAlign;
if (coord.GetUnit() != eStyleUnit_Enumerated ||
coord.GetIntValue() != NS_STYLE_VERTICAL_ALIGN_BASELINE) {
return true;
}
// 3. The boundary is a bidi isolation boundary.
const uint8_t unicodeBidi = ctx->StyleTextReset()->mUnicodeBidi;
if (unicodeBidi == NS_STYLE_UNICODE_BIDI_ISOLATE ||
unicodeBidi == NS_STYLE_UNICODE_BIDI_ISOLATE_OVERRIDE) {
return true;
}
aFrame = aFrame->GetParent();
}
return false;
};
const nsIFrame* ancestor =
nsLayoutUtils::FindNearestCommonAncestorFrame(aFrame1, aFrame2);
MOZ_ASSERT(ancestor);
// Map inline-end and inline-start to physical sides for checking presence
// of non-zero margin/border/padding.
Side side1 = wm.PhysicalSide(eLogicalSideIEnd);
Side side2 = wm.PhysicalSide(eLogicalSideIStart);
// If the frames have an embedding level that is opposite to the writing
// mode, we need to swap which sides we're checking.
if (IS_LEVEL_RTL(aFrame1->GetEmbeddingLevel()) == wm.IsBidiLTR()) {
Swap(side1, side2);
}
if (PreventCrossBoundaryShaping(aFrame1, ancestor, side1) ||
PreventCrossBoundaryShaping(aFrame2, ancestor, side2)) {
return false;
}
}
if (aFrame1->GetContent() == aFrame2->GetContent() &&
aFrame1->GetNextInFlow() != aFrame2) {
@ -1928,10 +1849,7 @@ bool BuildTextRunsScanner::ContinueTextRunAcrossFrames(nsTextFrame* aFrame1,
return false;
}
if (sc1 == sc2) {
return true;
}
ComputedStyle* sc2 = aFrame2->Style();
const nsStyleText* textStyle2 = sc2->StyleText();
if (sc1 == sc2) return true;

Просмотреть файл

@ -1,28 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Text shaping must not be broken across inline box boundaries when there is no change in formatting</title>
<link rel=match href="reference/boundary-shaping-001.ref.html">
<link rel=help href="https://drafts.csswg.org/css-text/#boundary-shaping">
<style>
@font-face {
font-family: test;
src: url(resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
/* initial values for these properties should not interrupt shaping */
vertical-align: initial;
padding: initial;
margin: initial;
border: initial;
}
</style>
</head>
<body>
of<span class=a>f</span>ice
</body>
</html>

Просмотреть файл

@ -1,24 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Text shaping must be broken across inline box boundaries when 'vertical-align' is not 'baseline'</title>
<link rel=match href="reference/boundary-shaping-002.ref.html">
<link rel=help href="https://drafts.csswg.org/css-text/#boundary-shaping">
<style>
@font-face {
font-family: test;
src: url(resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
vertical-align: 0; /* distinct from 'baseline', should break shaping */
}
</style>
</head>
<body>
of<span class=a>f</span>ice
</body>
</html>

Просмотреть файл

@ -1,24 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Text shaping must be broken across inline box boundaries when padding is non-zero</title>
<link rel=match href="reference/boundary-shaping-003.ref.html">
<link rel=help href="https://drafts.csswg.org/css-text/#boundary-shaping">
<style>
@font-face {
font-family: test;
src: url(resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
padding-left: 10px;
}
</style>
</head>
<body>
of<span class=a>f</span>ice
</body>
</html>

Просмотреть файл

@ -1,24 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Text shaping must be broken across inline box boundaries when margin is non-zero</title>
<link rel=match href="reference/boundary-shaping-004.ref.html">
<link rel=help href="https://drafts.csswg.org/css-text/#boundary-shaping">
<style>
@font-face {
font-family: test;
src: url(resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
margin-right: 10px;
}
</style>
</head>
<body>
of<span class=a>f</span>ice
</body>
</html>

Просмотреть файл

@ -1,24 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Text shaping must be broken across inline box boundaries when border is non-zero</title>
<link rel=match href="reference/boundary-shaping-005.ref.html">
<link rel=help href="https://drafts.csswg.org/css-text/#boundary-shaping">
<style>
@font-face {
font-family: test;
src: url(resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
border-right: 10px solid transparent;
}
</style>
</head>
<body>
of<span class=a>f</span>ice
</body>
</html>

Просмотреть файл

@ -1,24 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Text shaping must be broken across inline box boundaries when 'vertical-align' is not 'baseline'</title>
<link rel=match href="reference/boundary-shaping-006.ref.html">
<link rel=help href="https://drafts.csswg.org/css-text/#boundary-shaping">
<style>
@font-face {
font-family: test;
src: url(resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
vertical-align: super;
}
</style>
</head>
<body>
of<span><span><span class=a><span><span>f</span></span></span></span></span>ice
</body>
</html>

Просмотреть файл

@ -1,27 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Text shaping must be broken across inline box boundaries when padding or margin is non-zero</title>
<link rel=match href="reference/boundary-shaping-007.ref.html">
<link rel=help href="https://drafts.csswg.org/css-text/#boundary-shaping">
<style>
@font-face {
font-family: test;
src: url(resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
padding-left: 10px;
}
.b {
margin-right: 10px;
}
</style>
</head>
<body>
of<span><span class=a><span><span class=b><span>f</span></span></span></span></span>ice
</body>
</html>

Просмотреть файл

@ -1,24 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Text shaping must be broken across inline box boundaries at a bidi isolation boundary</title>
<link rel=match href="reference/boundary-shaping-008.ref.html">
<link rel=help href="https://drafts.csswg.org/css-text/#boundary-shaping">
<style>
@font-face {
font-family: test;
src: url(resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
unicode-bidi: isolate; /* bidi isolation boundaries should break shaping */
}
</style>
</head>
<body>
of<span class=a>f</span>ice
</body>
</html>

Просмотреть файл

@ -1,57 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Text shaping must be broken across inline box boundaries when padding or margin is non-zero</title>
<link rel=match href="reference/boundary-shaping-009.ref.html">
<link rel=help href="https://drafts.csswg.org/css-text/#boundary-shaping">
<style>
body {
font: 36px sans-serif;
}
div {
text-align: center;
}
.a {
padding-right: 10px;
}
.b {
margin-left: 10px;
}
.c {
color: red;
padding-left: 10px;
}
.d {
color: red;
margin-right: 10px;
}
</style>
</head>
<body>
<div dir=ltr>
السلام<span class=a>عليكم</span>
</div>
<div dir=ltr>
<span class=b>السلام</span>عليكم
</div>
<div dir=rtl>
السلام<span class=a>عليكم</span>
</div>
<div dir=rtl>
<span class=b>السلام</span>عليكم
</div>
<div dir=ltr>
السلام<span class=c>عليكم</span>
</div>
<div dir=ltr>
<span class=d>السلام</span>عليكم
</div>
<div dir=rtl>
السلام<span class=c>عليكم</span>
</div>
<div dir=rtl>
<span class=d>السلام</span>عليكم
</div>
</body>
</html>

Просмотреть файл

@ -1,21 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Text shaping must not be broken across inline box boundaries when there is no change in formatting</title>
<link rel=match href="reference/boundary-shaping-010.ref.html">
<link rel=help href="https://drafts.csswg.org/css-text/#boundary-shaping">
<style>
body {
font: 36px sans-serif;
}
div {
text-align: center;
}
</style>
</head>
<body>
<div dir=rtl>
ال<span>سل</span>ام
</body>
</html>

Просмотреть файл

@ -1,18 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<style>
@font-face {
font-family: test;
src: url(../resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
</style>
</head>
<body>
office
</body>
</html>

Просмотреть файл

@ -1,21 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<style>
@font-face {
font-family: test;
src: url(../resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
display: inline-block;
}
</style>
</head>
<body>
of<span class=a>f</span>ice
</body>
</html>

Просмотреть файл

@ -1,22 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<style>
@font-face {
font-family: test;
src: url(../resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
display: inline-block;
width: 10px;
}
</style>
</head>
<body>
of<span class=a>&nbsp;</span>fice
</body>
</html>

Просмотреть файл

@ -1,22 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<style>
@font-face {
font-family: test;
src: url(../resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
display: inline-block;
width: 10px;
}
</style>
</head>
<body>
off<span class=a>&nbsp;</span>ice
</body>
</html>

Просмотреть файл

@ -1,22 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<style>
@font-face {
font-family: test;
src: url(../resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
display: inline-block;
width: 10px;
}
</style>
</head>
<body>
off<span class=a>&nbsp;</span>ice
</body>
</html>

Просмотреть файл

@ -1,22 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<style>
@font-face {
font-family: test;
src: url(../resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
vertical-align: super;
display: inline-block;
}
</style>
</head>
<body>
of<span class=a>f</span>ice
</body>
</html>

Просмотреть файл

@ -1,23 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<style>
@font-face {
font-family: test;
src: url(../resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
padding-left: 10px;
margin-right: 10px;
display: inline-block;
}
</style>
</head>
<body>
of<span class=a>f</span>ice
</body>
</html>

Просмотреть файл

@ -1,21 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<style>
@font-face {
font-family: test;
src: url(../resources/LinLibertine_Re-4.7.5.woff);
}
body {
font: 36px test; /* use a font that includes ligatures for "fi" etc */
}
.a {
display: inline-block;
}
</style>
</head>
<body>
of<span class=a>f</span>ice
</body>
</html>

Просмотреть файл

@ -1,56 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<style>
body {
font: 36px sans-serif;
}
div {
text-align: center;
}
.a {
display: inline-block;
width: 10px;
}
.c1 {
padding-left: 10px;
}
.c {
color: red;
}
.d1 {
margin-right: 10px;
}
.d {
color: red;
}
</style>
</head>
<body>
<div dir=ltr>
السلام<span class=a>&nbsp;</span>عليكم
</div>
<div dir=ltr>
السلام<span class=a>&nbsp;</span>عليكم
</div>
<div dir=rtl>
السلام<span class=a>&nbsp;</span>عليكم
</div>
<div dir=rtl>
السلام<span class=a>&nbsp;</span>عليكم
</div>
<div dir=ltr>
<span class=c1>السلام<span class=c>عليكم</span></span>
</div>
<div dir=ltr>
<span class=d1><span class=d>السلام</span>عليكم</span>
</div>
<div dir=rtl>
<span class=c1>السلام<span class=c>عليكم</span></span>
</div>
<div dir=rtl>
<span class=d1><span class=d>السلام</span>عليكم</span>
</div>
</body>
</html>

Просмотреть файл

@ -1,18 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<style>
body {
font: 36px sans-serif;
}
div {
text-align: center;
}
</style>
</head>
<body>
<div dir=rtl>
السلام
</body>
</html>

Двоичный файл не отображается.