Commit ed342d9f authored by Ian Clelland's avatar Ian Clelland Committed by Commit Bot

Revert "New TextBreakIterator's default behavior breaks after space run"

This reverts commit 1cb4c9a7.

Reason for revert: Test failures on MacOS 10.14 and 10.15 bots seem to be caused by this CL.

See https://ci.chromium.org/p/chromium/builders/ci/Mac10.15%20Tests/4038
(https://ci.chromium.org/p/chromium/builders/ci/Mac10.15%20Tests/4037 included the change, but failed for an unrelated reason)
and
https://ci.chromium.org/p/chromium/builders/ci/Mac10.14%20Tests/8410
(and subsequent builds on both bots)

Layout test failure example:
https://test-results.appspot.com/data/layout_results/Mac10_14_Tests/8416/blink_web_tests/layout-test-results/results.html

This looks like it is just a test result that needs to be updated, but it's also possible that the new breaking algorithm is incorrect in this case.
Reverting since the original change landed within the last few hours.

Original change's description:
> New TextBreakIterator's default behavior breaks after space run
> 
> Before this change, we were considering breaking opportunities before
> space runs. This approach allowed us to avoid re-shaping in many cases,
> which has an important advantage in terms of performance.
> 
> However, the Unicode spec (UAX#14) state that breaking before a space
> character is not allowed [1], so we had to implement this logic after
> our TextBreakIterator had already determined the best breaking
> opportunity. This approach has been working fine so far for regular
> spaces (white-space, tabs, ...), but it doesn't work correctly for
> other BA [2] class characters; in the CSS Text specification, these are
> known as "other space separators" [3].
> 
> In order to implement the correct behavior for any kind of space, we
> would need to change our TextBreakIterator implementation so that
> matches the Unicode rules, considering breaking opportunity after
> space runs. This change should also consider the performance impact
> of the extra re-shaping operations required to deal with trailing
> spaces.
> 
> In order to prevent performance regressions, we'll store the position
> of the 'end of non-hangable run', which will be used in case of items
> with styles dictating rules to collapse trailing spaces.
> 
> [1] https://unicode-org.atlassian.net/browse/ICU-20843
> [2] https://www.unicode.org/reports/tr14/tr14-39.html#BA
> [3] https://drafts.csswg.org/css-text-3/#other-space-separators
> 
> Change-Id: Ie4a3890c75a3faff1a0155d4a40bcaa85bc6ac06
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2047943
> Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
> Reviewed-by: Koji Ishii <kojii@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#806928}

TBR=jfernandez@igalia.com,kojii@chromium.org

Change-Id: I79a3c7f20064ecc4f5c995f35027c730eb7c409d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2412131Reviewed-by: default avatarIan Clelland <iclelland@chromium.org>
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807019}
parent b512aa3f
...@@ -53,9 +53,6 @@ struct CORE_EXPORT NGInlineItemResult { ...@@ -53,9 +53,6 @@ struct CORE_EXPORT NGInlineItemResult {
// The range of text content for this item. // The range of text content for this item.
NGTextOffset text_offset; NGTextOffset text_offset;
// Indicates the limits of the trailing space run.
base::Optional<unsigned> non_hangable_run_end;
// Inline size of this item. // Inline size of this item.
LayoutUnit inline_size; LayoutUnit inline_size;
......
...@@ -198,7 +198,7 @@ NGLineBreaker::NGLineBreaker(NGInlineNode node, ...@@ -198,7 +198,7 @@ NGLineBreaker::NGLineBreaker(NGInlineNode node,
handled_leading_floats_index_(handled_leading_floats_index), handled_leading_floats_index_(handled_leading_floats_index),
base_direction_(node_.BaseDirection()) { base_direction_(node_.BaseDirection()) {
available_width_ = ComputeAvailableWidth(); available_width_ = ComputeAvailableWidth();
break_iterator_.SetBreakSpace(BreakSpaceType::kAfterSpaceRun); break_iterator_.SetBreakSpace(BreakSpaceType::kBeforeSpaceRun);
if (!break_token) if (!break_token)
return; return;
...@@ -622,17 +622,6 @@ void NGLineBreaker::HandleText(const NGInlineItem& item, ...@@ -622,17 +622,6 @@ void NGLineBreaker::HandleText(const NGInlineItem& item,
return; return;
} }
// Hanging trailing spaces may resolve the overflow.
if (item_result->has_only_trailing_spaces) {
if (item_result->item->Style()->WhiteSpace() == EWhiteSpace::kPreWrap &&
IsBreakableSpace(Text()[item_result->EndOffset() - 1])) {
unsigned end_index = item_result - line_info->Results().begin();
Rewind(end_index, line_info);
}
state_ = LineBreakState::kTrailing;
return;
}
// If this is all trailable spaces, this item is trailable, and next item // If this is all trailable spaces, this item is trailable, and next item
// maybe too. Don't go to |HandleOverflow()| yet. // maybe too. Don't go to |HandleOverflow()| yet.
if (IsAllBreakableSpaces(Text(), item_result->StartOffset(), if (IsAllBreakableSpaces(Text(), item_result->StartOffset(),
...@@ -771,8 +760,6 @@ NGLineBreaker::BreakResult NGLineBreaker::BreakText( ...@@ -771,8 +760,6 @@ NGLineBreaker::BreakResult NGLineBreaker::BreakText(
item_result->inline_size = inline_size; item_result->inline_size = inline_size;
item_result->text_offset.end = result.break_offset; item_result->text_offset.end = result.break_offset;
item_result->text_offset.AssertNotEmpty(); item_result->text_offset.AssertNotEmpty();
item_result->non_hangable_run_end = result.non_hangable_run_end;
item_result->has_only_trailing_spaces = result.has_trailing_spaces;
item_result->shape_result = std::move(shape_result); item_result->shape_result = std::move(shape_result);
break; break;
} }
...@@ -897,31 +884,20 @@ bool NGLineBreaker::HandleTextForFastMinContent(NGInlineItemResult* item_result, ...@@ -897,31 +884,20 @@ bool NGLineBreaker::HandleTextForFastMinContent(NGInlineItemResult* item_result,
if (end_offset >= item.EndOffset()) if (end_offset >= item.EndOffset())
break; break;
unsigned non_hangable_run_end = end_offset;
if (item.Style()->WhiteSpace() != EWhiteSpace::kBreakSpaces) {
while (non_hangable_run_end > item.StartOffset() &&
IsBreakableSpace(text[non_hangable_run_end - 1])) {
--non_hangable_run_end;
}
}
// Inserting a hyphenation character is not supported yet. // Inserting a hyphenation character is not supported yet.
// TODO (jfernandez): Maybe we need to use 'end_offset' here ? if (text[end_offset - 1] == kSoftHyphenCharacter)
if (text[non_hangable_run_end - 1] == kSoftHyphenCharacter)
return false; return false;
float start_position = shape_result.CachedPositionForOffset( float start_position = shape_result.CachedPositionForOffset(
start_offset - shape_result.StartIndex()); start_offset - shape_result.StartIndex());
float end_position = shape_result.CachedPositionForOffset( float end_position = shape_result.CachedPositionForOffset(
non_hangable_run_end - shape_result.StartIndex()); end_offset - shape_result.StartIndex());
float word_width = IsLtr(shape_result.Direction()) float word_width = IsLtr(shape_result.Direction())
? end_position - start_position ? end_position - start_position
: start_position - end_position; : start_position - end_position;
min_width = std::max(word_width, min_width); min_width = std::max(word_width, min_width);
last_end_offset = non_hangable_run_end; last_end_offset = end_offset;
// TODO (jfernandez): I think that having the non_hangable_run_end
// would make this loop unnecessary/redudant.
start_offset = end_offset; start_offset = end_offset;
while (start_offset < item.EndOffset() && while (start_offset < item.EndOffset() &&
IsBreakableSpace(text[start_offset])) { IsBreakableSpace(text[start_offset])) {
...@@ -938,8 +914,7 @@ bool NGLineBreaker::HandleTextForFastMinContent(NGInlineItemResult* item_result, ...@@ -938,8 +914,7 @@ bool NGLineBreaker::HandleTextForFastMinContent(NGInlineItemResult* item_result,
return false; return false;
// Create an NGInlineItemResult that has the max of widths of all words. // Create an NGInlineItemResult that has the max of widths of all words.
item_result->text_offset.end = item_result->text_offset.end = last_end_offset;
std::max(last_end_offset, item_result->text_offset.start + 1);
item_result->text_offset.AssertNotEmpty(); item_result->text_offset.AssertNotEmpty();
item_result->inline_size = LayoutUnit::FromFloatCeil(min_width); item_result->inline_size = LayoutUnit::FromFloatCeil(min_width);
item_result->can_break_after = true; item_result->can_break_after = true;
...@@ -1051,9 +1026,6 @@ void NGLineBreaker::HandleTrailingSpaces(const NGInlineItem& item, ...@@ -1051,9 +1026,6 @@ void NGLineBreaker::HandleTrailingSpaces(const NGInlineItem& item,
(item.Type() == NGInlineItem::kControl && (item.Type() == NGInlineItem::kControl &&
Text()[item.StartOffset()] == kTabulationCharacter)); Text()[item.StartOffset()] == kTabulationCharacter));
DCHECK(&shape_result); DCHECK(&shape_result);
bool is_control_tab = item.Type() == NGInlineItem::kControl &&
Text()[item.StartOffset()] == kTabulationCharacter;
DCHECK(item.Type() == NGInlineItem::kText || is_control_tab);
DCHECK_GE(offset_, item.StartOffset()); DCHECK_GE(offset_, item.StartOffset());
DCHECK_LT(offset_, item.EndOffset()); DCHECK_LT(offset_, item.EndOffset());
const String& text = Text(); const String& text = Text();
...@@ -1067,8 +1039,6 @@ void NGLineBreaker::HandleTrailingSpaces(const NGInlineItem& item, ...@@ -1067,8 +1039,6 @@ void NGLineBreaker::HandleTrailingSpaces(const NGInlineItem& item,
if (style.CollapseWhiteSpace()) { if (style.CollapseWhiteSpace()) {
if (text[offset_] != kSpaceCharacter) { if (text[offset_] != kSpaceCharacter) {
if (offset_ > 0 && IsBreakableSpace(text[offset_ - 1]))
trailing_whitespace_ = WhitespaceState::kCollapsible;
state_ = LineBreakState::kDone; state_ = LineBreakState::kDone;
return; return;
} }
...@@ -1090,29 +1060,18 @@ void NGLineBreaker::HandleTrailingSpaces(const NGInlineItem& item, ...@@ -1090,29 +1060,18 @@ void NGLineBreaker::HandleTrailingSpaces(const NGInlineItem& item,
while (end < item.EndOffset() && IsBreakableSpace(text[end])) while (end < item.EndOffset() && IsBreakableSpace(text[end]))
end++; end++;
if (end == offset_) { if (end == offset_) {
if (IsBreakableSpace(text[end - 1]))
trailing_whitespace_ = WhitespaceState::kPreserved;
state_ = LineBreakState::kDone; state_ = LineBreakState::kDone;
return; return;
} }
// TODO (jfernandez): Could we just modify the last ItemResult
// instead of creating a new one ?
// Probably we can (koji). We would need to review usage of these
// item results, and change them to use "non_hangable_run_end"
// instead.
NGInlineItemResult* item_result = AddItem(item, end, line_info); NGInlineItemResult* item_result = AddItem(item, end, line_info);
item_result->non_hangable_run_end = offset_;
item_result->has_only_trailing_spaces = true; item_result->has_only_trailing_spaces = true;
item_result->shape_result = ShapeResultView::Create(&shape_result); item_result->shape_result = ShapeResultView::Create(&shape_result);
if (item_result->StartOffset() == item.StartOffset() && if (item_result->StartOffset() == item.StartOffset() &&
item_result->EndOffset() == item.EndOffset()) { item_result->EndOffset() == item.EndOffset())
item_result->inline_size = item_result->shape_result item_result->inline_size = item_result->shape_result->SnappedWidth();
? item_result->shape_result->SnappedWidth() else
: LayoutUnit();
} else {
UpdateShapeResult(*line_info, item_result); UpdateShapeResult(*line_info, item_result);
}
position_ += item_result->inline_size; position_ += item_result->inline_size;
item_result->can_break_after = item_result->can_break_after =
end < text.length() && !IsBreakableSpace(text[end]); end < text.length() && !IsBreakableSpace(text[end]);
...@@ -1703,8 +1662,7 @@ void NGLineBreaker::HandleOpenTag(const NGInlineItem& item, ...@@ -1703,8 +1662,7 @@ void NGLineBreaker::HandleOpenTag(const NGInlineItem& item,
DCHECK(!item_result->can_break_after); DCHECK(!item_result->can_break_after);
const NGInlineItemResults& item_results = line_info->Results(); const NGInlineItemResults& item_results = line_info->Results();
if (UNLIKELY(!was_auto_wrap && auto_wrap_ && item_results.size() >= 2)) { if (UNLIKELY(!was_auto_wrap && auto_wrap_ && item_results.size() >= 2)) {
if (IsPreviousItemOfType(NGInlineItem::kText)) ComputeCanBreakAfter(std::prev(item_result), auto_wrap_, break_iterator_);
ComputeCanBreakAfter(std::prev(item_result), auto_wrap_, break_iterator_);
} }
} }
...@@ -1733,15 +1691,29 @@ void NGLineBreaker::HandleCloseTag(const NGInlineItem& item, ...@@ -1733,15 +1691,29 @@ void NGLineBreaker::HandleCloseTag(const NGInlineItem& item,
if (item_results.size() >= 2) { if (item_results.size() >= 2) {
NGInlineItemResult* last = std::prev(item_result); NGInlineItemResult* last = std::prev(item_result);
if (was_auto_wrap || last->can_break_after) { if (was_auto_wrap || last->can_break_after) {
item_result->can_break_after = item_result->can_break_after = last->can_break_after;
last->can_break_after ||
IsBreakableSpace(Text()[item_result->EndOffset()]);
last->can_break_after = false; last->can_break_after = false;
return; return;
} }
if (auto_wrap_ && !IsBreakableSpace(Text()[item_result->EndOffset() - 1]))
ComputeCanBreakAfter(item_result, auto_wrap_, break_iterator_);
} }
if (was_auto_wrap)
return;
DCHECK(!item_result->can_break_after);
if (!auto_wrap_)
return;
// When auto-wrap follows no-wrap, the boundary is determined by the break
// iterator. However, when space characters follow the boundary, the break
// iterator cannot compute this because it considers break opportunities are
// before a run of spaces.
const String& text = Text();
if (item_result->EndOffset() < text.length() &&
IsBreakableSpace(text[item_result->EndOffset()])) {
item_result->can_break_after = true;
return;
}
ComputeCanBreakAfter(item_result, auto_wrap_, break_iterator_);
} }
// Handles when the last item overflows. // Handles when the last item overflows.
...@@ -2177,10 +2149,6 @@ void NGLineBreaker::SetCurrentStyle(const ComputedStyle& style) { ...@@ -2177,10 +2149,6 @@ void NGLineBreaker::SetCurrentStyle(const ComputedStyle& style) {
spacing_.SetSpacing(style.GetFont()); spacing_.SetSpacing(style.GetFont());
} }
bool NGLineBreaker::IsPreviousItemOfType(NGInlineItem::NGInlineItemType type) {
return item_index_ > 0 ? Items().at(item_index_ - 1).Type() == type : false;
}
void NGLineBreaker::MoveToNextOf(const NGInlineItem& item) { void NGLineBreaker::MoveToNextOf(const NGInlineItem& item) {
offset_ = item.EndOffset(); offset_ = item.EndOffset();
item_index_++; item_index_++;
......
...@@ -194,7 +194,6 @@ class CORE_EXPORT NGLineBreaker { ...@@ -194,7 +194,6 @@ class CORE_EXPORT NGLineBreaker {
NGLineInfo*) const; NGLineInfo*) const;
void SetCurrentStyle(const ComputedStyle&); void SetCurrentStyle(const ComputedStyle&);
bool IsPreviousItemOfType(NGInlineItem::NGInlineItemType);
void MoveToNextOf(const NGInlineItem&); void MoveToNextOf(const NGInlineItem&);
void MoveToNextOf(const NGInlineItemResult&); void MoveToNextOf(const NGInlineItemResult&);
......
...@@ -53,15 +53,9 @@ class PLATFORM_EXPORT ShapingLineBreaker final { ...@@ -53,15 +53,9 @@ class PLATFORM_EXPORT ShapingLineBreaker final {
STACK_ALLOCATED(); STACK_ALLOCATED();
public: public:
// Indicates the limits of the space run.
base::Optional<unsigned> non_hangable_run_end;
// Indicates the resulting break offset. // Indicates the resulting break offset.
unsigned break_offset; unsigned break_offset;
// Indicates that the shape result contains trailing spaces
bool has_trailing_spaces;
// True if there were no break opportunities that can fit. When this is // True if there were no break opportunities that can fit. When this is
// false, the result width should be smaller than or equal to the available // false, the result width should be smaller than or equal to the available
// space. // space.
...@@ -113,17 +107,7 @@ class PLATFORM_EXPORT ShapingLineBreaker final { ...@@ -113,17 +107,7 @@ class PLATFORM_EXPORT ShapingLineBreaker final {
STACK_ALLOCATED(); STACK_ALLOCATED();
public: public:
BreakOpportunity(unsigned new_offset, bool hyphenated)
: offset(new_offset),
non_hangable_run_end(new_offset),
is_hyphenated(hyphenated) {}
BreakOpportunity(unsigned new_offset, unsigned run_end, bool hyphenated)
: offset(new_offset),
non_hangable_run_end(run_end),
is_hyphenated(hyphenated) {}
unsigned offset; unsigned offset;
unsigned non_hangable_run_end;
bool is_hyphenated; bool is_hyphenated;
}; };
BreakOpportunity PreviousBreakOpportunity(unsigned offset, BreakOpportunity PreviousBreakOpportunity(unsigned offset,
......
...@@ -334,12 +334,6 @@ inline int LazyLineBreakIterator::NextBreakablePosition( ...@@ -334,12 +334,6 @@ inline int LazyLineBreakIterator::NextBreakablePosition(
continue; continue;
} }
break; break;
case BreakSpaceType::kAfterSpaceRun:
if (is_space)
continue;
if (is_last_space)
return i;
break;
case BreakSpaceType::kAfterEverySpace: case BreakSpaceType::kAfterEverySpace:
if (is_last_space) if (is_last_space)
return i; return i;
...@@ -404,10 +398,6 @@ inline int LazyLineBreakIterator::NextBreakablePosition( ...@@ -404,10 +398,6 @@ inline int LazyLineBreakIterator::NextBreakablePosition(
return NextBreakablePosition<CharacterType, lineBreakType, return NextBreakablePosition<CharacterType, lineBreakType,
BreakSpaceType::kBeforeSpaceRun>(pos, str, BreakSpaceType::kBeforeSpaceRun>(pos, str,
len); len);
case BreakSpaceType::kAfterSpaceRun:
return NextBreakablePosition<CharacterType, lineBreakType,
BreakSpaceType::kAfterSpaceRun>(pos, str,
len);
case BreakSpaceType::kAfterEverySpace: case BreakSpaceType::kAfterEverySpace:
return NextBreakablePosition<CharacterType, lineBreakType, return NextBreakablePosition<CharacterType, lineBreakType,
BreakSpaceType::kAfterEverySpace>(pos, str, BreakSpaceType::kAfterEverySpace>(pos, str,
...@@ -526,8 +516,6 @@ std::ostream& operator<<(std::ostream& ostream, BreakSpaceType break_space) { ...@@ -526,8 +516,6 @@ std::ostream& operator<<(std::ostream& ostream, BreakSpaceType break_space) {
return ostream << "kAfterEverySpace"; return ostream << "kAfterEverySpace";
case BreakSpaceType::kBeforeSpaceRun: case BreakSpaceType::kBeforeSpaceRun:
return ostream << "kBeforeSpaceRun"; return ostream << "kBeforeSpaceRun";
case BreakSpaceType::kAfterSpaceRun:
return ostream << "kAfterSpaceRun";
} }
NOTREACHED(); NOTREACHED();
return ostream << "BreakSpaceType::" << static_cast<int>(break_space); return ostream << "BreakSpaceType::" << static_cast<int>(break_space);
......
...@@ -111,11 +111,6 @@ enum class BreakSpaceType { ...@@ -111,11 +111,6 @@ enum class BreakSpaceType {
// LayoutNG line breaker uses this type. // LayoutNG line breaker uses this type.
kBeforeSpaceRun, kBeforeSpaceRun,
// Break after a run of white space characters.
// This mode enables the LazyLineBreakIterator to completely rely on
// ICU for determining the breaking opportunities.
kAfterSpaceRun,
// white-spaces:break-spaces allows breaking after any preserved white-space, // white-spaces:break-spaces allows breaking after any preserved white-space,
// even when these are leading spaces so that we can avoid breaking // even when these are leading spaces so that we can avoid breaking
// the word in case of overflow. // the word in case of overflow.
......
...@@ -210,9 +210,6 @@ crbug.com/591099 external/wpt/css/css-text/text-transform/text-transform-shaping ...@@ -210,9 +210,6 @@ crbug.com/591099 external/wpt/css/css-text/text-transform/text-transform-shaping
crbug.com/591099 external/wpt/css/css-text/white-space/control-chars-00C.html [ Failure ] crbug.com/591099 external/wpt/css/css-text/white-space/control-chars-00C.html [ Failure ]
crbug.com/591099 external/wpt/css/css-text/white-space/line-edge-white-space-collapse-001.html [ Failure ] crbug.com/591099 external/wpt/css/css-text/white-space/line-edge-white-space-collapse-001.html [ Failure ]
crbug.com/591099 external/wpt/css/css-text/white-space/line-edge-white-space-collapse-002.html [ Failure ] crbug.com/591099 external/wpt/css/css-text/white-space/line-edge-white-space-collapse-002.html [ Failure ]
crbug.com/591099 external/wpt/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-012.html [ Failure ]
crbug.com/591099 external/wpt/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-013.html [ Failure ]
crbug.com/591099 external/wpt/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-014.html [ Failure ]
### external/wpt/css/css-text/word-break/ ### external/wpt/css/css-text/word-break/
crbug.com/591099 external/wpt/css/css-text/word-break/word-break-break-all-004.html [ Failure ] crbug.com/591099 external/wpt/css/css-text/word-break/word-break-break-all-004.html [ Failure ]
...@@ -347,9 +344,6 @@ crbug.com/1012289 external/wpt/css/css-lists/list-style-type-string-005a.html [ ...@@ -347,9 +344,6 @@ crbug.com/1012289 external/wpt/css/css-lists/list-style-type-string-005a.html [
crbug.com/1012289 external/wpt/css/css-lists/list-style-type-string-006.html [ Failure ] crbug.com/1012289 external/wpt/css/css-lists/list-style-type-string-006.html [ Failure ]
crbug.com/1012294 external/wpt/css/css-lists/list-style-type-string-007.html [ Pass ] crbug.com/1012294 external/wpt/css/css-lists/list-style-type-string-007.html [ Pass ]
### external/wpt/css/css-content/
crbug.com/591099 external/wpt/css/css-content/quotes-033.html [ Failure ]
### external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/ ### external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/
crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-align-self-horiz-002.xhtml [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-align-self-horiz-002.xhtml [ Failure ]
crbug.com/886592 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/align3/flex-abspos-staticpos-margin-002.html [ Failure ] crbug.com/886592 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/align3/flex-abspos-staticpos-margin-002.html [ Failure ]
...@@ -389,7 +383,6 @@ crbug.com/875235 external/wpt/html/rendering/non-replaced-elements/the-fieldset- ...@@ -389,7 +383,6 @@ crbug.com/875235 external/wpt/html/rendering/non-replaced-elements/the-fieldset-
### virtual/text-antialias/ ### virtual/text-antialias/
crbug.com/591099 virtual/text-antialias/justify-ideograph-simple.html [ Failure ] crbug.com/591099 virtual/text-antialias/justify-ideograph-simple.html [ Failure ]
crbug.com/591099 virtual/text-antialias/apply-start-width-after-skipped-text.html [ Failure ]
### http/tests/ ### http/tests/
crbug.com/591099 http/tests/devtools/elements/highlight/highlight-node-vertical-rl.js [ Failure ] crbug.com/591099 http/tests/devtools/elements/highlight/highlight-node-vertical-rl.js [ Failure ]
......
...@@ -881,7 +881,6 @@ crbug.com/591099 fast/multicol/vertical-lr/nested-columns.html [ Failure ] ...@@ -881,7 +881,6 @@ crbug.com/591099 fast/multicol/vertical-lr/nested-columns.html [ Failure ]
crbug.com/591099 fast/multicol/vertical-lr/unsplittable-inline-block.html [ Failure ] crbug.com/591099 fast/multicol/vertical-lr/unsplittable-inline-block.html [ Failure ]
crbug.com/591099 [ Win ] virtual/text-antialias/ellipsis-with-self-painting-layer.html [ Failure ] crbug.com/591099 [ Win ] virtual/text-antialias/ellipsis-with-self-painting-layer.html [ Failure ]
crbug.com/591099 [ Mac ] fast/multicol/file-upload-as-multicol.html [ Failure ] crbug.com/591099 [ Mac ] fast/multicol/file-upload-as-multicol.html [ Failure ]
crbug.com/1098801 virtual/text-antialias/whitespace/whitespace-in-pre.html [ Failure ]
# LayoutNG failures that needs to be triaged # LayoutNG failures that needs to be triaged
crbug.com/591099 virtual/text-antialias/selection/selection-rect-line-height-too-small.html [ Failure ] crbug.com/591099 virtual/text-antialias/selection/selection-rect-line-height-too-small.html [ Failure ]
......
<!doctype html>
<meta charset=utf-8>
<meta http-equiv="content-language" content="en, ja" />
<title>CSS test Reference</title>
<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com" />
<style>
div { white-space: pre; }
span { background: blue; }
</style>
<p>This test passes if the line is after the white space, which hangs (blue).
<div>ああ<span>&#x0020;<br>X</span></div>
...@@ -24,5 +24,7 @@ div { ...@@ -24,5 +24,7 @@ div {
<section class="ideo"> <section class="ideo">
<div><br></div> <div><br></div>
<div><br></div> <div><br></div>
<div><br></div>
<div><br></div>
</section> </section>
</body> </body>
<!doctype html>
<meta charset=utf-8>
<title>CSS Text test: hanging trailing spaces with white-space:pre-wrap</title>
<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com">
<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://drafts.csswg.org/css-text-3/#white-space-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
<link rel="help" title="4.1.3. Phase II: Trimming and Positioning" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-normal">
<link rel="match" href="reference/white-space-pre-wrap-trailing-spaces-004-ref.html">
<meta name="assert" content="Previous breaking opportunities are not considered if the overflow is caused by hanging trailing spaces.">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
div {
font: 10px/1 Ahem;
}
.ref {
position: absolute;
color: red;
z-index: -1;
}
.ref span { color: green; }
span { background: green; }
.test {
color: green;
width: 4ch;
white-space: pre-wrap;
}
</style>
<p>This test passes if there is a green square and no red.
<div class="ref">XX<span>X</span>XX<br>XXXXX</span><br>XXXXX<br>XXXXX<br>XXXXX</div>
<div class="test">XX X<span> X</span><span>XX </span>XXXXX<br>XXXXX<br>XXXXX</div>
<!doctype html>
<meta charset=utf-8>
<meta http-equiv="content-language" content="en, ja" />
<title>CSS Text test: hanging trailing spaces with white-space:pre-wrap</title>
<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com">
<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://drafts.csswg.org/css-text-3/#white-space-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
<link rel="help" title="4.1.3. Phase II: Trimming and Positioning" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-normal">
<link rel="match" href="reference/white-space-pre-wrap-trailing-spaces-013-ref.html">
<meta name="assert" content="Previous breaking opportunities are not considered if the overflow is caused by hanging trailing spaces.">
<style>
div {
width: 2em;
white-space: pre-wrap;
}
span { background: blue; } /* If the space is removed instead of hanging, there will be no blue box*/
</style>
<p>This test passes if the line is after the white space, which hangs (blue).
<div>ああ<span>&#x0020;X<span></div>
<!doctype html>
<meta charset=utf-8>
<title>CSS Text test: hanging trailing spaces with white-space:pre-wrap</title>
<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com">
<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://drafts.csswg.org/css-text-3/#white-space-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
<link rel="help" title="4.1.3. Phase II: Trimming and Positioning" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-normal">
<link rel="match" href="reference/white-space-pre-wrap-trailing-spaces-004-ref.html">
<meta name="assert" content="Previous breaking opportunities are not considered if the overflow is caused by hanging trailing spaces.">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
div {
font: 10px/1 Ahem;
}
.ref {
position: absolute;
color: red;
z-index: -1;
}
span { background: green; }
.ref span { color: green; }
.test {
color: green;
width: 4ch;
white-space: pre-wrap;
}
</style>
<p>This test passes if there is a green square and no red.
<div class="ref">XX<span>X</span>X<span>X</span><br>XXXXX</span><br>XXXXX<br>XXXXX<br>XXXXX</div>
<div class="test">XX<span> X</span> X<span>XX </span>XXXXX<br>XXXXX<br>XXXXX</div>
<!doctype html>
<meta charset=utf-8>
<title>CSS Text test: hanging trailing spaces with white-space:pre-wrap</title>
<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com">
<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://drafts.csswg.org/css-text-3/#white-space-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
<link rel="help" title="4.1.3. Phase II: Trimming and Positioning" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-normal">
<link rel="match" href="reference/white-space-pre-wrap-trailing-spaces-004-ref.html">
<meta name="assert" content="Previous breaking opportunities are not considered if the overflow is caused by hanging trailing spaces.">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
div {
font: 10px/1 Ahem;
}
.ref {
position: absolute;
color: red;
z-index: -1;
}
span { background: green; }
.ref span { color: green; }
.test {
color: green;
width: 5ch;
white-space: pre-wrap;
}
</style>
<p>This test passes if there is a green square and no red.
<div class="ref">XX<span>XXX</span><br>XXX<span>X</span>X<br>XXXXX</span><br>XXXXX<br>XXXXX<br></div>
<div class="test">XX XX<span>X X</span><br>XXXXX<br>XXXXX<br>XXXXX</div>
...@@ -35,5 +35,7 @@ div { ...@@ -35,5 +35,7 @@ div {
<section class="ideo"> <section class="ideo">
<div><span class="nowrap"></span></div> <div><span class="nowrap"></span></div>
<div><span class="nowrap"></span><span class="normal"></span></div> <div><span class="nowrap"></span><span class="normal"></span></div>
<div><span class="nowrap"><span class="normal"></span></span></div>
<div class="nowrap"><span class="normal"></span></div>
</section> </section>
</body> </body>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment