Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floating outside the parent box makes surrounding text leak #25

Closed
Smylers opened this issue Dec 21, 2012 · 2 comments
Closed

Floating outside the parent box makes surrounding text leak #25

Smylers opened this issue Dec 21, 2012 · 2 comments

Comments

@Smylers
Copy link
Contributor

Smylers commented Dec 21, 2012

Applying a margin to a floated element can make text that flows round it leak outside its box,if the floated element fits entirely outside the box. See http://www.stripey.com/demo/weasyprint/float_outside_box.html and http://www.stripey.com/demo/weasyprint/float_outside_box.pdf

Each is floated left and has a negative left margin, so it starts left of its parent <p>. In the first paragraph the text of the <span> extends far enough back into the <p>, and the rest of the <p> text flows round it, as expected.

In the second paragraph the <span> text is short enough to fit entirely outside the content area of the <p>; the rest of the text in the <p> can avoid it simply by staying inside the <p>. This is what happens in Firefox and Chrome. But in Weasyprint the first line of the following text starts immediately after the right edge of the <span>, left of its own content area; it's moved into the negative margin that should only apply to the <span>.

@SimonSapin
Copy link
Member

This is a bug in the handling of "inline floats". A max() or something is missing in weasyprint.layout.inlines.split_inline_box().

@liZe
Copy link
Member

liZe commented Feb 25, 2013

Fixed in 6e114af, but more cases are broken (see issue #39).

@liZe liZe closed this as completed Feb 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants