Commit 764aa379 authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[LayoutNG] Use legacy layout for the 'text-combine' property

This patch forces legacy layout for the 'text-combine'
property, for the first phase of LayoutNG.

Also extracted the "if" block to a function because it gets
large enough.

Bug: 636993
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I2d67e26c506bc560eaf31c574d8552adb785bfb1
Reviewed-on: https://chromium-review.googlesource.com/1144594Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577254}
parent 7a3fc243
......@@ -285,8 +285,6 @@ crbug.com/591099 external/wpt/css/css-writing-modes/sizing-orthog-htb-in-vlr-001
crbug.com/591099 external/wpt/css/css-writing-modes/sizing-orthog-vlr-in-htb-008.xht [ Failure ]
crbug.com/591099 external/wpt/css/css-writing-modes/sizing-orthog-vrl-in-htb-004.xht [ Failure ]
crbug.com/591099 external/wpt/css/css-writing-modes/sizing-orthog-vrl-in-htb-013.xht [ Failure ]
crbug.com/591099 external/wpt/css/css-writing-modes/text-combine-upright-decorations-001.html [ Failure ]
crbug.com/591099 external/wpt/css/css-writing-modes/text-combine-upright-layout-rules-001.html [ Failure ]
crbug.com/591099 external/wpt/css/css-writing-modes/text-orientation-script-001a.html [ Pass ]
crbug.com/591099 external/wpt/css/css-writing-modes/text-orientation-script-001c.html [ Pass ]
crbug.com/591099 external/wpt/css/css-writing-modes/text-orientation-script-001j.html [ Pass ]
......@@ -341,9 +339,6 @@ crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftest
crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/shapes1/shape-outside-padding-box-border-radius-002.html [ Pass ]
crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/shapes1/shape-outside-polygon-021.html [ Failure ]
crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/shapes1/shape-outside-polygon-022.html [ Pass ]
crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-break-inside-001.html [ Failure ]
crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-break-inside-001a.html [ Failure ]
crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-compression-007.html [ Failure ]
crbug.com/591099 external/wpt/editing/run/bold.html [ Pass ]
crbug.com/591099 external/wpt/editing/run/fontname.html [ Pass ]
crbug.com/591099 external/wpt/editing/run/formatblock.html [ Pass ]
......@@ -540,7 +535,6 @@ crbug.com/591099 fast/css3-text/css3-text-indent/text-indent-leading-out-of-flow
crbug.com/591099 fast/dom/HTMLAreaElement/area-download.html [ Failure ]
crbug.com/591099 fast/dom/nodesFromRect/nodesFromRect-basic.html [ Failure ]
crbug.com/591099 fast/dynamic/first-letter-after-list-marker.html [ Failure ]
crbug.com/591099 fast/dynamic/text-combine.html [ Failure ]
crbug.com/591099 fast/encoding/utf-16-big-endian.html [ Failure ]
crbug.com/591099 fast/encoding/utf-16-little-endian.html [ Failure ]
crbug.com/591099 fast/events/background-tab-on-submit-ctrl-click.html [ Failure ]
......@@ -589,18 +583,14 @@ crbug.com/858998 fast/table/table-continuation-outline-paint-crash.html [ Failur
crbug.com/591099 fast/table/table-display-types-vertical.html [ Failure ]
crbug.com/591099 fast/table/unbreakable-images-quirk.html [ Failure ]
crbug.com/591099 fast/table/vertical-align-baseline-readjust.html [ Failure ]
crbug.com/591099 fast/text/decorations-with-text-combine.html [ Failure ]
crbug.com/591099 fast/text/descent-clip-in-scaled-page.html [ Failure ]
crbug.com/591099 fast/text/ellipsis-in-relative-inline-right.html [ Failure ]
crbug.com/591099 fast/text/ellipsis-in-relative-inline.html [ Failure ]
crbug.com/714962 fast/text/emoticons.html [ Failure ]
crbug.com/591099 fast/text/emphasis-combined-text.html [ Failure ]
crbug.com/591099 fast/text/hide-atomic-inlines-after-ellipsis.html [ Failure ]
crbug.com/796943 fast/text/international/shape-across-elements-simple.html [ Pass ]
crbug.com/591099 fast/text/international/text-combine-image-test.html [ Failure ]
crbug.com/591099 fast/text/orientation-sideways.html [ Failure ]
crbug.com/591099 fast/text/selection/emphasis.html [ Failure ]
crbug.com/591099 fast/text/text-combine-first-line-crash.html [ Crash ]
crbug.com/591099 fast/text/unicode-fallback-font.html [ Failure ]
crbug.com/591099 fast/text/whitespace/018.html [ Failure ]
crbug.com/591099 fast/writing-mode/auto-sizing-orthogonal-flows.html [ Failure ]
......@@ -616,9 +606,6 @@ crbug.com/591099 fast/writing-mode/fieldsets.html [ Failure ]
crbug.com/714962 fast/writing-mode/flipped-blocks-hit-test-line-edges.html [ Failure ]
crbug.com/591099 fast/writing-mode/percentage-height-orthogonal-writing-modes.html [ Failure ]
crbug.com/591099 fast/writing-mode/table-percent-width-quirk.html [ Pass ]
crbug.com/591099 fast/writing-mode/text-combine-justify.html [ Failure ]
crbug.com/591099 fast/writing-mode/text-combine-line-break.html [ Failure ]
crbug.com/591099 fast/writing-mode/text-combine-various-fonts.html [ Failure ]
crbug.com/591099 fullscreen/full-screen-with-flex-item.html [ Failure ]
crbug.com/591099 hittesting/inline-with-clip-path.html [ Failure ]
crbug.com/855039 html/details_summary/details-writing-mode-align-center.html [ Failure ]
......
......@@ -88,6 +88,49 @@ bool IsImageOrVideoElement(const Element* element) {
return true;
return false;
}
bool ShouldForceLegacyLayout(const ComputedStyle& style,
const Element& element) {
// Form controls are not supported yet.
if (element.ShouldForceLegacyLayout())
return true;
// TODO(layout-dev): Once LayoutNG handles inline content editable, we
// should get rid of following code fragment.
const Document& document = element.GetDocument();
if (style.UserModify() != EUserModify::kReadOnly || document.InDesignMode() ||
style.Display() == EDisplay::kWebkitBox ||
style.Display() == EDisplay::kWebkitInlineBox)
return true;
if (!RuntimeEnabledFeatures::LayoutNGBlockFragmentationEnabled()) {
// Disable NG for the entire subtree if we're establishing a block
// fragmentation context.
if (style.SpecifiesColumns() ||
(style.IsOverflowPaged() &&
&element != document.ViewportDefiningElement()))
return true;
if (document.Printing()) {
// This needs to be discovered on the root element.
DCHECK_EQ(element, document.documentElement());
return true;
}
}
// The custom container is laid out by the legacy engine. Its children may
// not establish new formatting contexts, so we need to protect against
// re-entering LayoutNG there.
if (style.Display() == EDisplay::kLayoutCustom ||
style.Display() == EDisplay::kInlineLayoutCustom)
return true;
// 'text-combine-upright' property is not supported yet.
if (style.HasTextCombine() && !style.IsHorizontalWritingMode())
return true;
return false;
}
} // namespace
static EDisplay EquivalentBlockDisplay(EDisplay display) {
......@@ -668,40 +711,8 @@ void StyleAdjuster::AdjustComputedStyle(StyleResolverState& state,
}
if (RuntimeEnabledFeatures::LayoutNGEnabled() && !style.ForceLegacyLayout() &&
element) {
const Document& document = element->GetDocument();
if (element->ShouldForceLegacyLayout()) {
// Form controls are not supported yet.
style.SetForceLegacyLayout(true);
} else if (style.UserModify() != EUserModify::kReadOnly ||
document.InDesignMode() ||
style.Display() == EDisplay::kWebkitBox ||
style.Display() == EDisplay::kWebkitInlineBox) {
// TODO(layout-dev): Once LayoutNG handles inline content editable, we
// should get rid of following code fragment.
element && ShouldForceLegacyLayout(style, *element)) {
style.SetForceLegacyLayout(true);
} else if (!RuntimeEnabledFeatures::LayoutNGBlockFragmentationEnabled()) {
// Disable NG for the entire subtree if we're establishing a block
// fragmentation context.
if (style.SpecifiesColumns() ||
(style.IsOverflowPaged() &&
element != document.ViewportDefiningElement())) {
style.SetForceLegacyLayout(true);
} else if (document.Printing()) {
// This needs to be discovered on the root element.
DCHECK_EQ(element, document.documentElement());
style.SetForceLegacyLayout(true);
}
}
if (!style.ForceLegacyLayout()) {
// The custom container is laid out by the legacy engine. Its children may
// not establish new formatting contexts, so we need to protect against
// re-entering LayoutNG there.
if (style.Display() == EDisplay::kLayoutCustom ||
style.Display() == EDisplay::kInlineLayoutCustom)
style.SetForceLegacyLayout(true);
}
}
// If intrinsically sized images or videos are disallowed by feature policy,
......
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