Description[LayoutNG] Make NGLineBuilder work with inline floats
This patch teaches NGLineBuilder how to position inline floats.
Below is a high level overview of the implemented logic:
Consider this example:
The quick <div id="float"></div> brown fox jumps over the lazy dog
1) NGLineBuilder/NGTextLayoutAlgorithm starts constructing a line
2) Every time when we hit a text break opportunity
NGLineBuilder::SetEnd gets a corresponding NGLayoutInlineItem
3) If it's a float then it tries to position it on the current text
line.
4) If the float does not fit it will be added to the UnpositionedFloat
list
5) When we place the line we position all pending floats from the
UnpositionedFloat list.
BUG=635619
TEST=TextFloatsAroundInlineFloatThatFitsOnLine,
TextFloatsAroundInlineFloatThatDoesNotFitOnLine
Review-Url: https://codereview.chromium.org/2755143003
Cr-Commit-Position: refs/heads/master@{#459332}
Committed: https://chromium.googlesource.com/chromium/src/+/fdd13e6a954714ba0cec7070080eacb057fdb3ff
Patch Set 1 #
Total comments: 8
Patch Set 2 : fix comments #
Total comments: 6
Patch Set 3 : update the doc string #
Total comments: 4
Patch Set 4 : fix doc comments #Patch Set 5 : fix punctuations #Patch Set 6 : make setIsInPlacedTree to be available for LayoutNG #Messages
Total messages: 32 (21 generated)
|