One part (of 8!) of css font family disambiguation is that font families should
be matched case-insensitively.
This patch implements that. Once it lands, a bug needs to be filed to do lowercasing
properly (as a string, instead of char-by-char -- it's a unicode thing).
r? @gw
This also adds some extra debugging infrastructure which I found useful tracking
this bug down. A regression in the br reftests is also uncovered by this patch,
which I'll work on fixing next.
r? @pcwalton
match L. David Baron's work-in-progress specification.
http://dbaron.org/css/intrinsic/
Column spans are not yet supported.
This effectively adds support for percentage widths, and it also fixes
many bugs, improving the layout of Google and Wikipedia.
matching, and use it for `<input size>` and `<td width>`.
This implements a general framework for legacy presentational attributes
to the DOM and style calculation, so that adding more of them later will
be straightforward.
Instead of taking margin size into account twice when positioning
layers, just rely on the absolute position calculated during display
list construction.
Instead of taking margin size into account twice when positioning
layers, just rely on the absolute position calculated during display
list construction.
According to the documentation for Fragment::position, the inline axis
should include margin size, so we include it for blocks. Also fix
place_float which assumed that it was not included and
assign_inline_sizes which overrode the size set in
set_inline_size_constraint_solutions.
Typically this issue was hidden by large tile sizes, but fitted tiles
makes it more common.
Layers are currently all children of the root layer, so instead of
using coordinates relative to the parent flow we should use coordinates
relative to the page.
Fixes#2061.
Layers are currently all children of the root layer, so instead of
using coordinates relative to the parent flow we should use coordinates
relative to the page.
Fixes#2061.
The page_rect passed to DisplayListOptimizer is relative to the
RenderLayer origin, but the display list components are relative to the
page origin. Before passing the page rect to the display list, we
translate it by the RenderLayer position.
The page_rect passed to DisplayListOptimizer is relative to the
RenderLayer origin, but the display list components are relative to the
page origin. Before passing the page rect to the display list, we
translate it by the RenderLayer position.
absolutely-positioned elements declared with `display: inline`.
Although the computed `display` property of elements with `position:
absolute` is `block`, `position: absolute; display: inline` can still
behave differently from `position: absolute; display: block`. This is
because the hypothetical box for `position: absolute` can be at the
position it would have been if it had `display: inline`. CSS 2.1 §
10.3.7 describes this case in a parenthetical:
"The static-position containing block is the containing block of a
hypothetical box that would have been the first box of the element if
its specified 'position' value had been 'static' and its specified
'float' had been 'none'. (Note that due to the rules in section 9.7 this
hypothetical calculation might require also assuming a different
computed value for 'display'.)"
To handle this, I had to change both style computation and layout. For
the former, I added an internal property
`-servo-display-for-hypothetical-box`, which stores the `display` value
supplied by the author, before the computed value is calculated. Flow
construction now uses this value.
As for layout, implementing the proper behavior is tricky because the
position of an inline fragment in the inline direction cannot be
determined until height assignment, which is a parallelism hazard
because in parallel layout widths are computed before heights. However,
in this particular case we can avoid the parallelism hazard because the
inline direction of a hypothetical box only affects the layout if an
absolutely-positioned element is unconstrained in the inline direction.
Therefore, we can just lay out such absolutely-positioned elements with
a bogus inline position and fix it up once the true inline position of
the hypothetical box is computed. The name for this fix-up process is
"late computation of inline position" (and the corresponding fix-up for
the block position is called "late computation of block position").
This improves the header on /r/rust.
* Enabled acid2 on mac + linux. Updated the reference image. The only difference from the
real acid2 now is the paint order and a 1 pixel horizontal offset on the nose.
* Change line-height to be calculated correctly.
* Apply enclosing element style to text fragments.
formatting contexts.
The widths of block formatting contexts depend on the floats prior to
them. To avoid a circular dependency between width assignment and height
assignment, we must guess their widths during the assign-widths pass.
The old code simply used the size of the last float, whether
left-floated or right-floated, but this proved insufficient to handle
layouts like those seen on Reddit. The new heuristic keeps track of both
left and right floats independently and sums the width of all left and
right floats to determine the width of a block formatting context. This
is still insufficient to properly lay out Reddit, but the results are
much more acceptable.
A fully correct approach will require that blocks be laid out again if
the initial guess proved to be incorrect. A `TODO` is in the code to
handle this case.
The float code was old and did not support most of CSS 2.1. So unifying
the two paths both simplifies code and improves functionality.
Improves the Reddit sidebar.
wrapper around them.
Fixes Wikipedia tables leaking out.
Along the way, I refactored tables' width calculation significantly.
This was necessary in order to properly handle floated tables, as some
of the logic had to be ported over from block flows.