aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow/construct.rs
diff options
context:
space:
mode:
authorOriol Brufau <obrufau@igalia.com>2023-04-20 03:55:26 +0200
committerOriol Brufau <obrufau@igalia.com>2023-04-25 23:01:07 +0200
commitc842023741f300d93ca7389a832309fff0fe19fd (patch)
tree16bad26063ec1031010a5769928dec210ff18512 /components/layout_2020/flow/construct.rs
parente74b5a180cbe366c551cc2eeec5728004d7495e4 (diff)
downloadservo-c842023741f300d93ca7389a832309fff0fe19fd.tar.gz
servo-c842023741f300d93ca7389a832309fff0fe19fd.zip
Support text-indent in layout-2020
Existing WPT now passing: - _mozilla/css/text_indent_a.html - css/CSS2/css1/c71-fwd-parsing-002.xht - css/CSS2/css1/c71-fwd-parsing-004.xht - css/CSS2/floats-clear/floats-138.xht - css/CSS2/text/text-indent-007.xht - css/CSS2/text/text-indent-008.xht - css/CSS2/text/text-indent-010.xht - css/CSS2/text/text-indent-019.xht - css/CSS2/text/text-indent-020.xht - css/CSS2/text/text-indent-031.xht - css/CSS2/text/text-indent-032.xht - css/CSS2/text/text-indent-043.xht - css/CSS2/text/text-indent-044.xht - css/CSS2/text/text-indent-055.xht - css/CSS2/text/text-indent-056.xht - css/CSS2/text/text-indent-067.xht - css/CSS2/text/text-indent-068.xht - css/CSS2/text/text-indent-079.xht - css/CSS2/text/text-indent-080.xht - css/CSS2/text/text-indent-091.xht - css/CSS2/text/text-indent-092.xht - css/CSS2/text/text-indent-103.xht - css/CSS2/text/text-indent-104.xht - css/CSS2/text/text-indent-112.xht - css/CSS2/text/text-indent-113.xht - css/CSS2/text/text-indent-115.xht - css/CSS2/text/text-indent-applies-to-002.xht - css/CSS2/text/text-indent-applies-to-003.xht - css/CSS2/text/text-indent-applies-to-005.xht - css/CSS2/text/text-indent-applies-to-006.xht - css/CSS2/text/text-indent-applies-to-007.xht - css/CSS2/text/text-indent-applies-to-008.xht - css/CSS2/text/text-indent-applies-to-009.xht - css/CSS2/text/text-indent-applies-to-010.xht - css/CSS2/text/text-indent-applies-to-011.xht - css/CSS2/text/text-indent-applies-to-014.xht - css/CSS2/text/text-indent-applies-to-015.xht - css/CSS2/text/text-indent-inherited-001.xht - css/CSS2/text/text-indent-overflow-001.xht - css/CSS2/text/text-indent-overflow-002.xht - css/CSS2/text/text-indent-overflow-003.xht - css/CSS2/text/text-indent-overflow-004.xht - css/CSS2/text/text-indent-wrap-001.xht - css/css-text-decor/text-shadow/textindent.html - css/css-text/text-indent/text-indent-percentage-001.xht - css/css-text/text-indent/text-indent-percentage-002.html - css/css-text/text-indent/text-indent-percentage-003.html - css/css-text/text-indent/text-indent-percentage-004.html - css/css-values/minmax-length-percent-serialize.html - css/css-values/minmax-length-serialize.html Also improvements in: - _mozilla/mozilla/calc.html - css/css-text/animations/text-indent-interpolation.html - css/css-text/inheritance.html - css/css-text/parsing/text-indent-computed.html - css/css-text/parsing/text-indent-valid.html - css/css-transitions/properties-value-implicit-001.html - css/css-values/animations/calc-interpolation.html - css/css-values/minmax-percentage-serialize.html - css/css-values/viewport-units-css2-001.html - css/css-variables/variable-substitution-basic.html - css/cssom/serialize-values.html Existing WPT now failing, due to lack of direction, outside list markers, flex and grid: - css/CSS2/text/text-indent-rtl-001.xht - css/CSS2/text/text-indent-rtl-002.xht - css/css-pseudo/marker-content-023.html - css/css-text/text-indent/anonymous-flex-item-001.html - css/css-text/text-indent/anonymous-grid-item-001.html New WPT tests: - css/css-text/text-indent/text-indent-length-001.html - css/css-text/text-indent/text-indent-length-002.html This one fails in layout-2013.
Diffstat (limited to 'components/layout_2020/flow/construct.rs')
-rw-r--r--components/layout_2020/flow/construct.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/components/layout_2020/flow/construct.rs b/components/layout_2020/flow/construct.rs
index 5cb1fe51e73..0afb9dfe410 100644
--- a/components/layout_2020/flow/construct.rs
+++ b/components/layout_2020/flow/construct.rs
@@ -63,6 +63,7 @@ impl BlockFormattingContext {
let ifc = InlineFormattingContext {
inline_level_boxes,
text_decoration_line,
+ has_first_formatted_line: true,
};
let contents = BlockContainer::InlineFormattingContext(ifc);
let bfc = Self {
@@ -187,7 +188,10 @@ impl BlockContainer {
context,
info,
block_level_boxes: Vec::new(),
- ongoing_inline_formatting_context: InlineFormattingContext::new(text_decoration_line),
+ ongoing_inline_formatting_context: InlineFormattingContext::new(
+ text_decoration_line,
+ /* has_first_formatted_line = */ true,
+ ),
ongoing_inline_boxes_stack: Vec::new(),
anonymous_style: None,
contains_floats: ContainsFloats::No,
@@ -690,6 +694,8 @@ where
.is_empty()
{
// There should never be an empty inline formatting context.
+ self.ongoing_inline_formatting_context
+ .has_first_formatted_line = false;
return;
}