Commit graph

420 commits

Author SHA1 Message Date
Patrick Walton
690bf079f7 layout: Refactor a few things, mostly just to obey the line limit. 2014-09-27 06:07:58 -07:00
Patrick Walton
fb5952fed0 layout: Don't double-count padding, etc, and don't draw
backgrounds/borders/etc. twice for inline-blocks.

Improves Reddit, GitHub, and many other sites.
2014-09-27 06:07:58 -07:00
Glenn Watson
15e1e5e43f Fix some mutable variable warnings. 2014-09-27 15:04:40 +10:00
Glenn Watson
26cf00ef4e Don't render backgrounds for text fragments. 2014-09-26 18:28:40 +10:00
Glenn Watson
cf79e64a5a Improve acid2. Fix line height calculation. Text fragments get correct enclosing element style.
* 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.
2014-09-26 17:12:22 +10:00
Glenn Watson
32c02fc048 Fix inline context padding on inline-block.
Fixes categories bar on wikipedia - ref #2554.
2014-09-23 15:40:08 +10:00
Glenn Watson
87d18b90a6 Add support for min-width and max-width to images.
This fixes the images on the homepage of github.
2014-09-22 14:03:10 +10:00
Keegan McAllister
dc86e83654 Eliminate warnings 2014-09-20 13:00:55 -07:00
Patrick Walton
08e004d106 Merge pull request #3424 from SimonSapin/font-size-absolute
Add font-size absolute size keywords. Fix #3417
2014-09-19 15:17:55 -07:00
Patrick Walton
b4db9aeaeb Handle generated content with display: block correctly during flow
construction.

The iteration was incorrect here. Although it accidentally worked
before, it will cause problems when we have incremental style
recalculation.

The `after_block_iteration` reftest will become interesting once we have
incremental style recalc.
2014-09-19 12:25:37 -07:00
Simon Sapin
010d87b93e Remove min/max functions from util::geometry. Use std::cmp instead. 2014-09-19 13:56:35 +01:00
Patrick Walton
22bca83509 Merge pull request #3404 from glennw/inline-block-fix
Include margin in inline block intrinsic width. Fixes [edit] links on wikipedia. Also improves google homepage.
2014-09-18 07:51:11 -07:00
Josh Matthews
9607b468bc Revert "script: Use atom comparison in more places, especially for attributes." for persistent test failures.
This reverts commit 874db26104.
2014-09-18 09:20:19 -04:00
Glenn Watson
6bc65f3b07 Include margin in inline block intrinsic width. Fixes [edit] links on wikipedia. 2014-09-18 16:07:28 +10:00
Patrick Walton
874db26104 script: Use atom comparison in more places, especially for attributes.
75% improvement in style recalc for Guardians of the Galaxy.
2014-09-17 13:17:12 -07:00
Matt Brubeck
6c9524b687 Implement background-position keyword values
Also fixes calculation of background-position percentages:

Rather than multiplying the container size by a percent and aligning the top
left of the image at the resulting width, we also need to subtract a
corresponding percent of the image size, per
http://dev.w3.org/csswg/css2/colors.html#propdef-background-position

"A value pair of '100% 100%' places the lower right corner of the image in the
lower right corner of the padding box. With a value pair of '14% 84%', the
point 14% across and 84% down the image is to be placed at the point 14%
across and 84% down the padding box."
2014-09-16 10:24:31 -07:00
Jack Moffitt
e10206e91e Reinstate errors for unused variables and imports. 2014-09-13 23:38:00 -06:00
Glenn Watson
98624c9576 Implement basic support for display: inline-block.
This still needs a lot of work, but it covers the basic
cases and improves wikipedia while passing all existing tests.

Tweak reftest to deal with linux/travis black background.
2014-09-13 07:13:42 +10:00
Glenn Watson
29c3819246 Partial fix for background images on wikipedia pages.
This fixes the visual artifacts seen at the top of wikipedia pages by:
 - Setting clipping rect to avoid images going outside their bounds.
 - Handling case of background-position being >= 100% such that wrapping is required.

However, the gradient is not currently visible on wikipedia. This relies on bug #1997 being fixed.
2014-09-11 16:25:04 +10:00
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00
Renamed from src/components/layout/fragment.rs (Browse further)