Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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: <div style="width: 100px; text-indent: 40px;"> <div style="float: left; width: 60px; height: 10px;"></div> <div style="display: inline-block; width: 60px; height: 20px;"></div> </div> 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
- Loading branch information