mirror of
https://github.com/servo/servo.git
synced 2025-06-16 12:24:29 +00:00
margins. * The code that attempted to strip out borders that span multiple fragments in the same element could go wrong if fragments were stripped out due to text clumping or whitespace stripping. This patch rewrites that code to maintain flags in the inline fragment context specifying whether the node is the beginning or end of the element. Not only is this easier to maintain, it's closer in spirit to what roc originally suggested two years ago: it's isomorphic to "begin element, end element" markers for inline layout. * Padding and margins for spans containing inline-blocks are now properly handled via a division of labor between the `InlineBlock` fragment and the `BlockFlow` that represents the inline-block. * Unscanned text fragments may not be joined together into a text run if borders, padding, or margins separate them. Because Servo now matches the rendering of Gecko and WebKit on the `input_button_margins_a` reftest, I had to modify it to add some vertical alignment. The combined effect of all of these fixes places "Advertising" on the right place on google.com.
10 lines
254 B
HTML
10 lines
254 B
HTML
<!DOCTYPE html>
|
|
<style>
|
|
html, body {
|
|
margin: 0;
|
|
}
|
|
</style>
|
|
<div><span style="padding-left: 100px; display: inline-block">Boo</span></div>
|
|
<div><span style="padding-left: 100px">Foo</span></div>
|
|
<div><span style="margin-left: 100px">Foo</span></div>
|
|
|