Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Floats and absolutely positioned boxes with an auto width weren't drawn at all. Their shrink-to-fit width (CSS 2.1 §10.3.5 and §10.3.7) was computed before the words of their inline content were measured, so the word widths were still 0 and the word spacing still
NaN, which made the box widthNaN. Text split over several inline elements ended up with a width of 0 instead.The fix measures the descendants' words before
GetMinMaxWidth, the same way the table layout already did for its column widths. The recursive measuring moved fromCssLayoutEngineTabletoCssBox.MeasureDescendantWords, so both use the same code.Nothing caught this, because every positioning test set an explicit width. The two gap tests for it,
AutoWidthFloat_ShrinksToFitItsContentandAbsolute_WithAutoWidth_ShrinksToFitItsContent, are now enabled, and the gaps are removed from the CSS 2.1, Position 3, Sizing 3 and Sizing 4 manifests. The image regression baselines don't change.Note that an absolutely positioned box with
leftandrightbothautostill goes to the containing block's edge instead of its static position, that's a separate gap.Closes #203
How to test this PR?
CI should succeed. The HTML from #203 should put the paragraphs at 200px from the left, both with
HtmlRenderer.PdfSharpandHtmlRenderer.WinForms.