Commit Graph

85 Commits

Author SHA1 Message Date
Patrick Walton
9df551f68e servo: Merge #3609 - layout: Rewrite intrinsic inline-size and automatic table layout to match L. David Baron's work-in-progress specification (from pcwalton:tables); r=SimonSapin
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.

r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: e2d7777c41135b71293c195d2a9d7a1bc2afd0ca
2014-10-14 15:42:32 -06:00
Patrick Walton
07c968075f servo: Merge #3622 - layout: Introduce support for legacy presentational attributes to selector matching, and use it for <input size> and <td width> (from pcwalton:html4ever); r=jdm
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.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0aeecfc41d5f0c637960fcddf87cc2db3e5efeea
2014-10-14 14:06:36 -06:00
Patrick Walton
9f1038ee7a servo: Merge #3623 - script: Use atom comparison in more places, especially for attributes (from pcwalton:use-atoms-2); r=jdm
75% improvement in style recalc for Guardians of the Galaxy.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8077edc0622b04aeb26d42ced86ea285c9cac0e7
2014-10-14 12:42:35 -06:00
Glenn Watson
ef7c0d2e17 servo: Merge #3675 - Add support for local font faces. Improves fonts on rust lang and guide (from glennw:local-fonts); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 48ce107d7275c08273cea6dca3523d0eee23eea7
2014-10-14 11:33:34 -06:00
Martin Robinson
03fc4160bd servo: Merge #3673 - Do not compound iframe margins when positioning (from mrobinson:iframe-margin); r=pcwalton
Instead of taking margin size into account twice when positioning
layers, just rely on the absolute position calculated during display
list construction.

Source-Repo: https://github.com/servo/servo
Source-Revision: 834df4e211e7dcac4369da4f5b8113f295869aa1
2014-10-14 04:51:35 -06:00
Ms2ger
e139ba90a7 servo: Merge #3676 - Don't borrow CharacterData.data from layout (from Ms2ger:no-text-borrow); r=Manishearth
This should fix the most frequent intermittent wpt failure.

Source-Repo: https://github.com/servo/servo
Source-Revision: 083bf27b7536a8ae825ce87df4344f9e3cbc1a10
2014-10-14 03:36:36 -06:00
Patrick Walton
58bfe948cb servo: Merge #3654 - layout: Rewrite clipping to be per-display-item instead of having a separate ClipDisplayItem (from pcwalton:clip-reform); r=mrobinson
We push down clipping areas during absolute position calculation. This
makes display items into a flat list, improving cache locality. It
dramatically simplifies the code all around.

Because we need to push down clip rects even for absolutely-positioned
children of non-absolutely-positioned flows, this patch alters the
parallel traversal to compute absolute positions for
absolutely-positioned children at the same time it computes absolute
positions for other children. This doesn't seem to break anything either
in theory (since the overall order remains correct) or in practice. It
simplifies the parallel traversal code quite a bit.

See the relevant Gecko bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=615734

r? @mrobinson

Source-Repo: https://github.com/servo/servo
Source-Revision: fd70b366aeada7f8cb4b2457c04fd07f0ea9b143
2014-10-14 00:42:35 -06:00
Glenn Watson
9788edd8c1 servo: Merge #3674 - Change accidental println to debug macro (from glennw:remove-println)
Source-Repo: https://github.com/servo/servo
Source-Revision: 5351c8572f564314f760037b9bcd355b43afa3aa
2014-10-13 22:39:15 -07:00
Tim Taubert
e87471af27 servo: Merge #3666 - Privatize DOM (fixes #3644) (from ttaubert:issue/3644-privatize-dom); r=Manishearth
This PR removes public fields from all (hope I didn't miss any) DOM structs. Should |Page| be privatized as well? This PR additionally introduces a #[privatize] lint to ensure nobody accidentally re-introduces a public field.

All changesets compile separately if applied in the same order. Hope that helps reviewing but I can of course squash them before merging.

Source-Repo: https://github.com/servo/servo
Source-Revision: f350879574194bb612eac88e21d0920e9827afa7
2014-10-13 22:00:37 -06:00
Patrick Walton
4a4e34f077 servo: Merge #3650 - layout: Refactor inline layout to remove the code that tried to avoid splitting fragments (from pcwalton:give-up-on-not-splitting); r=glennw
I don't think it will be possible to avoid splitting fragments in the
presence of `vertical-align`, because one `ScannedTextFragment` could
potentially be split into arbitrary many fragments, each having its own
vertical position that can influence layout of other fragments.

This code also removes parts of `Range` that were no longer used.

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: 799d0de0c09420a9657a6a7b5fb814374da31163
2014-10-13 18:36:40 -06:00
Patrick Walton
813b44f111 servo: Merge #3631 - layout: Store containing block inline-size separately rather than writing it to a temporary location and overwriting it (from pcwalton:idempotent-inline-size); r=glennw
This makes layout more idempotent, which is important for incremental
layout.

Also converts `is_root` to a set of flags and fixes a `TODO` concerning
percentage inline heights of images.

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: 7902ccf8507a7ec31515bfb5824dc4727564fe4d
2014-10-13 18:03:40 -06:00
Patrick Walton
4cdf72533b servo: Merge #3604 - layout: Make content of display: inline-block; overflow: hidden visible (from pcwalton:inline-block-overflow-hidden); r=glennw
Makes lots of GitHub appear.

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: a92e55597e03d6a7b71e8178cf4a7a6d760f94be
2014-10-13 15:54:41 -06:00
Martin Robinson
1d6a185bfb servo: Merge #3618 - Include leading margin in inline block size (from mrobinson:layer-sizing); r=pcwalton
Extra size from margins should be included in block size, so that
layers are large enough to include the entire block. This is typically
hidden by large tile sizes (512x512), but fitted tiles makes the issue
a lot more common.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7f26c671377dad073da38058c75b2d3b380b6f16
2014-10-13 10:48:45 -06:00
Patrick Walton
80d30d5673 servo: Merge #3615 - layout: Make box-sizing only affect explicitly-specified or percentage sizes, not automatically computed ones (from pcwalton:box-sizing-fix); r=glennw
Improves GitHub significantly.

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: c87f34f877ab4acfb19c48f924068ab1964d397c
2014-10-12 23:45:45 -06:00
Patrick Walton
47c280c684 servo: Merge #3639 - Use Gecko's simpler Bloom filter instead of one based on hash (from pcwalton:rewrite-bloom-filter); r=zwarich
stretching.

This preserves the usage of the Bloom filter throughout style recalc,
but the implementation is rewritten. Provides a 15% improvement on
Guardians of the Galaxy.

Source-Repo: https://github.com/servo/servo
Source-Revision: e048f3f940e124d45b43a53a850177c45907822d
2014-10-10 20:27:39 -06:00
Clark Gaebel
0cd95a4fa4 servo: Merge #3638 - Factors out DOM traversal, keeping the code in parallel free of traversal-specific logic (from cgaebel:parallel-dom-traversal)
Source-Repo: https://github.com/servo/servo
Source-Revision: be6cde93224c3ad266f5f98c4f4e670062146124
2014-10-10 19:08:49 -04:00
Clark Gaebel
c0d7a56ba4 servo: Merge #3590 - Incremental Style Recalc (from cgaebel:slow-incremental-reflow-rebase); r=pcwalton
This patch puts in the initial framework for incremental reflow. Nodes' styles
are no longer recalculated unless the node has changed.

I've been hacking on the general problem of incremental reflow for the past
couple weeks, and I've yet to get a full implementation that actually passes all
the reftests + wikipedia + cnn. Therefore, I'm going to try to land the different
parts of it one by one.

This patch only does incremental style recalc, without incremental flow
construction, inline-size bubbling, reflow, or display lists. Those will be coming
in that order as I finish them.

At least with this strategy, I can land a working version of incremental reflow,
even if not yet complete.

r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: 85b277655f07db1cb99c4d3dee93804735ed0470
2014-10-09 11:21:32 -06:00
Patrick Walton
ed019bf63d servo: Merge #3600 - layout: Mark the styles of elements with pseudos as unshareable (from pcwalton:pseudo-unshareable); r=mbrubeck
Makes multiple `<br>` elements work, since those are implemented via
`before` pseudos.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 15b508ac10d0e98ba10474b6ab091017ae95804e
2014-10-09 00:06:32 -06:00
Patrick Walton
4bd9850e8c servo: Merge #3599 - layout: Implement z-index (from pcwalton:z-index); r=glennw
r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: c4ac93b315f058d9a061b20ce64cacbead339f86
2014-10-08 23:33:33 -06:00
Martin Robinson
d421b28c0e servo: Merge #3617 - Position layers using their absolute position (from mrobinson:layer-positioning); r=pcwalton
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.

Source-Repo: https://github.com/servo/servo
Source-Revision: eff0de0ce12b20ffc4806d14c95777004003f2ae
2014-10-08 17:27:33 -06:00
Tim Taubert
f15d9faaa2 servo: Merge #3584 - Support [*|attr], attribute selectors in any namespace (fixes #1558) (from ttaubert:issue/1558-attr-ns-selectors); r=Manishearth
This implements basic support for attribute selectors with namespace prefixes. I would have added a more sophisticated test covering various selectors but it seems that we don't have an XML parser yet and thus no XHTML support?

r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: f49c730720a51d14dacefe9815faf50216b36b91
2014-10-08 03:12:34 -06:00
Patrick Walton
ea75d56860 servo: Merge #3603 - layout: white_space::pre should not yield ignorable whitespace (from pcwalton:pre-ignorable-whitespace); r=mbrubeck
Improves the Google home page.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: c628d11e6f8defbdaa4438f990b566272a3b0eff
2014-10-08 01:15:36 -06:00
Cameron Zwarich
e4683d9b2b servo: Merge #3592 - Remove trailing whitespace (from zwarich:trailing-whitespace); r=Manishearth
The Mach test runner doesn't actually make these failures yet, which is
tracked by #3482.

Source-Repo: https://github.com/servo/servo
Source-Revision: ae946a9b762d66f01f669ff526eff5c0eaaa3404
2014-10-07 04:57:29 -06:00
Manish Goregaokar
e58df69b05 servo: Merge #3573 - Remove unused mutable variable (from Manishearth:warnings); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: ae4c9be536bcf386db5b6ad2603ecf874566f6ef
2014-10-06 11:51:32 -06:00
Manish Goregaokar
052cbff92f servo: Merge #3518 - Purge Traceable and Untraceable from Servo (from Manishearth:trace-cleanup); r=jdm
Now that we use `JSTraceable` (defined in `script`), we can create arbitrary implementations on non-`script` types (eg `Url` or `RequestHeaderCollection`) where in the past we had to rely on `Traceable` and `Untraceable` to achieve cross-crate impls of `Encodable`.

This removes the two completely. They can be reintroduced if required, though the `untraceable!` macro should suffice.

Fixes #3469

Source-Repo: https://github.com/servo/servo
Source-Revision: b34df7c343579f200d2e67e21fc566842a4e4a91
2014-10-06 10:15:33 -06:00
Patrick Walton
b47d6ac21f servo: Merge #3556 - layout: Implement box-sizing: border-box (from pcwalton:box-sizing); r=SimonSapin
Improves GitHub.

Source-Repo: https://github.com/servo/servo
Source-Revision: c7915028b498dc8426cdbb5b35f0ad270613a244
2014-10-01 23:39:26 -06:00
Patrick Walton
9798446c46 servo: Merge #3546 - layout: Implement the correct hypothetical box behavior for absolutely-positioned elements declared with display: inline (from pcwalton:absolute-inline); r=glennw
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.

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: f7d2fb6ff86afff7a5b674f751af9370a5a6b142
2014-10-01 19:36:25 -06:00
Josh Matthews
2dfdae3733 servo: Merge #3520 - Implement basic form control support (from jdm:formcontrols); r=pcwalton
So far the changes to layout seem fairly well-contained; I think this is worth integrating to give us a browser that is easier to dogfood (and allows us to work on things like form submission much easier), especially since the long-term viability of WebComponents-as-forms is not assured.

Source-Repo: https://github.com/servo/servo
Source-Revision: f80096069592b864221abe112eaf2ecb6c444fda
2014-10-01 16:45:29 -06:00
Cameron Zwarich
c71169cdfc servo: Merge #3540 - Convert TNode / TElement to use self parameters rather than &self (from zwarich:more-jsref); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 09e9abc047e03b81b8a4aa90d13efa184d0a732f
2014-09-30 22:36:28 -06:00
Glenn Watson
35ccd6b338 servo: Merge #3535 - Refactor background image, fix fixed attachment. Improve acid2 (from glennw:fixed-bg); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: a63155b564b64825d292953983117c0df4b34e91
2014-09-30 17:45:29 -06:00
Keegan McAllister
8578d570cb servo: Merge #3530 - Use string-cache's Namespace type, backed by Atom (from kmcallister:namespace-atom); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 698b916c097ae0272a31a680cba7fc6dbd03ca3d
2014-09-30 02:42:23 -06:00
Glenn Watson
fbe6aa4d26 servo: Merge #3523 - Add support for <super> and <sup> tags. Fixes equations on wikipedia (from glennw:wiki-equations); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: b2ff320aecab80b06aeedad440c28b23b2dc3824
2014-09-29 15:36:26 -06:00
Simon Sapin
b3423c8393 servo: Merge #3487 - Upgrade Rust and enable style crate rustdoc (from servo:rustup-20140923); r=Ms2ger
The biggest language change is that enum variants now also reserve (for future use) a name in the type namespace, which must not collide with other types. Some things were renamed, and others qualified as `module::name`.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7409685589c550ee7a9f94182f511acddab4c6fd
2014-09-29 10:45:27 -06:00
Cameron Zwarich
4150491f96 servo: Merge #3501 - Remove the 'static lifetime parameters from TElement methods (from zwarich:telement-lifetimes)
Reviewed-by: jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: c9c8d63727560ab88a8b739f5ac305b8a02410d2
2014-09-27 17:09:28 -06:00
Patrick Walton
f2eb3141b3 servo: Merge #3498 - Stop double-counting stuff in inline-block (from pcwalton:border-box-double-counting)
Reviewed-by: glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: b7345796bc696bd0e7bc00384a71a30c676a3456
2014-09-27 13:12:30 -06:00
Glenn Watson
78a36a7eb2 servo: Merge #3500 - Fix some mutable variable warnings (from glennw:warning-fix)
Reviewed-by: pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: f7e5d295188a885027ff8cd5a6d7421581050ccf
2014-09-26 23:09:31 -06:00
Patrick Walton
af820be1f4 servo: Merge #3492 - layout: Support any display property in generated content, and allow (from pcwalton:clear-generated-content-table)
Reviewed-by: glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: 33e2a7b3625c82e83c7767e81266c2a23f509bed
2014-09-26 22:24:32 -06:00
Glenn Watson
9e168f34e8 servo: Merge #3486 - Improve acid2. Fix line height calculation. Text fragments get correct enclosing element style (from glennw:inline-fixes)
Reviewed-by: pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 94b7c486b12a50298f0706fce42b70a6ca90cdcb
2014-09-26 21:57:35 -06:00
Patrick Walton
ef2254d096 servo: Merge #3483 - layout: Block formatting contexts should contain all their floats (from pcwalton:block-formatting-contexts-containing-floats)
Reviewed-by: glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: ab17d31bbf8c6884f858381f3d5b7e62c4de87c6
2014-09-26 01:42:27 -06:00
Patrick Walton
8dfaa4b286 servo: Merge #3467 - layout: Enhance the heuristic that guesses the inline size of block formatting contexts (from pcwalton:enhance-block-formatting-context-guess)
Reviewed-by: glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: 20f5fdd000408867ac2d3a90ad9a8b55cfb8bc9e
2014-09-25 19:24:30 -06:00
Patrick Walton
c6e166d8b3 servo: Merge #3472 - layout: Unify the block-size computation for blocks and floats (from pcwalton:unify-block-and-float-layout)
Reviewed-by: glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: 9fb47b7636ca79c64acbf73a2c55cc6bf5cd4917
2014-09-25 17:48:35 -06:00
Cameron Zwarich
0c0ca18e96 servo: Merge #3478 - Remove use of deprecated get_mut_ref (from zwarich:get-mut-ref)
Reviewed-by: metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: d9c13352c1ecfefc3a5f07871421c5d24f02c7e7
2014-09-25 17:24:33 -06:00
Cameron Zwarich
93fe906d1b servo: Merge #3480 - Fix trailing whitespace tidy errors (from zwarich:trailing-whitespace)
Reviewed-by: larsbergstrom
Source-Repo: https://github.com/servo/servo
Source-Revision: c2d6d8084c7afc2b865a09cb4847fb1a815ef607
2014-09-25 17:00:34 -06:00
Patrick Walton
0c6129e4c9 servo: Merge #3434 - layout: Float table wrappers directly instead of generating a block (from pcwalton:directly-floated-tables)
Reviewed-by: glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: 1fba32af9ff68db73768b4732d003ea7aad09b28
2014-09-25 10:36:33 -06:00
Patrick Walton
e6b2857d7a servo: Merge #3475 - layout: Consider relatively positioned blocks as possible block (from pcwalton:block-formatting-context-fixes)
Reviewed-by: glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: e9a7b44f688dacd46ce4971a2a79e42d6a80a8fe
2014-09-25 00:26:42 -06:00
Patrick Walton
8c9531a007 servo: Merge #3458 - layout: Implement white-space: nowrap (from pcwalton:whitespace-nowrap)
Source-Repo: https://github.com/servo/servo
Source-Revision: d9f836bc75c0d6e4e813d9f74819bd8578742598
2014-09-23 20:22:33 -07:00
Glenn Watson
0c66868669 servo: Merge #3459 - Add support for small-caps font-variant (from glennw:small-caps)
Source-Repo: https://github.com/servo/servo
Source-Revision: 98222cf24cd64c246fc25b9009f3c198bf33dcbf
2014-09-24 09:49:05 +10:00
Glenn Watson
30b905aaf6 servo: Merge #3460 - Fix inline context padding on inline-block (from glennw:inline-block-padding)
Source-Repo: https://github.com/servo/servo
Source-Revision: 4546d5d23caa3f459b75e9a0bf9e91a3376dc197
2014-09-23 07:47:29 -07:00
Manish Goregaokar
431ec41351 servo: Merge #3435 - Reorganize macros crate; r=jdm (from Manishearth:macro_reorg)
Source-Repo: https://github.com/servo/servo
Source-Revision: 27f3bcd7183d836bd454e687706b4e76d6d3b312
2014-09-23 17:53:37 +05:00
Patrick Walton
8e7fe02560 servo: Merge #3457 - layout: Adjust the position of block formatting contexts based on float placement (from pcwalton:block-formatting-contexts)
Source-Repo: https://github.com/servo/servo
Source-Revision: 6177a3bdcca974d5070b0ecab0973d42963946ec
2014-09-22 20:06:18 -07:00