diff --git a/components/layout_2020/flow/inline/mod.rs b/components/layout_2020/flow/inline/mod.rs index 21be242f35b..4bad4293e5a 100644 --- a/components/layout_2020/flow/inline/mod.rs +++ b/components/layout_2020/flow/inline/mod.rs @@ -2245,17 +2245,17 @@ impl<'layout_data> ContentSizesComputation<'layout_data> { }, InlineItem::TextRun(text_run) => { for segment in text_run.shaped_text.iter() { + let style_text = text_run.parent_style.get_inherited_text(); + let can_wrap = style_text.text_wrap_mode == TextWrapMode::Wrap; + // TODO: This should take account whether or not the first and last character prevent // linebreaks after atomics as in layout. - if segment.break_at_start { + if can_wrap && segment.break_at_start { self.line_break_opportunity() } for run in segment.runs.iter() { let advance = run.glyph_store.total_advance(); - let style_text = text_run.parent_style.get_inherited_text(); - let can_wrap = style_text.text_wrap_mode == TextWrapMode::Wrap; - if run.glyph_store.is_whitespace() { // If this run is a forced line break, we *must* break the line // and start measuring from the inline origin once more. diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json index dc18d6f9780..f19ef328fdd 100644 --- a/tests/wpt/meta/MANIFEST.json +++ b/tests/wpt/meta/MANIFEST.json @@ -570815,7 +570815,7 @@ ] ], "white-space-intrinsic-size-021.html": [ - "f9c246d4899b58dbcf2dc08655c8bc1f39995e5a", + "9c63117d087932fb7c4788ff58c251d60dc1bf17", [ null, {} diff --git a/tests/wpt/tests/css/css-text/white-space/white-space-intrinsic-size-021.html b/tests/wpt/tests/css/css-text/white-space/white-space-intrinsic-size-021.html index f9c246d4899..9c63117d087 100644 --- a/tests/wpt/tests/css/css-text/white-space/white-space-intrinsic-size-021.html +++ b/tests/wpt/tests/css/css-text/white-space/white-space-intrinsic-size-021.html @@ -166,6 +166,16 @@ x-br::before {