From e77b16621fe61881516c49fcdbfe3694c45b993b Mon Sep 17 00:00:00 2001 From: Alison Maher Date: Wed, 5 Feb 2020 11:50:32 -0800 Subject: [PATCH] [LayoutNG] Text indent with leading float This change avoids breaking after leading floats in the case where there is a text indentation. Doing so fixes the following scenario:
In the above example, the following steps will happen: 1. The inline div will attempt to fit on the same line as the float. It does not, and a new line opportunity will be created on the next line. 2. The inline div overflows this new line opportunity due to the indent. 3. HandleOverflow() checks if the previous element (ie. the float) can break after. The float can, so it will attempt to rewind. 4. This causes a break in a later DCHECK. Not allowing breaks after leading floats in the case of an indentation fixes the above issue, and appears to match the behavior of other browsers. Bug: 1014247 Change-Id: Icf551f5908a0fcb8e0b80a8b9329c965435dd805 --- .../line-break-after-leading-float.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 css/CSS2/positioning/line-break-after-leading-float.html diff --git a/css/CSS2/positioning/line-break-after-leading-float.html b/css/CSS2/positioning/line-break-after-leading-float.html new file mode 100644 index 00000000000000..a452dbd6635931 --- /dev/null +++ b/css/CSS2/positioning/line-break-after-leading-float.html @@ -0,0 +1,18 @@ + +CSS Test: Line wrapping after leading floating objects + + + + +
+
+
+
+ +