Commit graph

81 commits

Author SHA1 Message Date
Ms2ger
baf90775bd servo: Merge #11800 - Remove unused argument to place_float_if_applicable (from Ms2ger:place_float_if_applicable); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: c270622bfdd7a409c1a940322f630fd6cbd985c0
2016-06-20 08:17:13 -05:00
Patrick Walton
c3daa72338 servo: Merge #11398 - script: Keep the DOM-side viewport up to date when scrolling happens in WebRender (from pcwalton:webrender-viewport); r=glennw
This happens asynchronously, just as it does in non-WebRender mode.

This functionality is a prerequisite for doing proper display-list-based
hit testing in WebRender, since it moves the scroll offsets into Servo
(and, specifically, into the script thread, enabling iframe event
forwarding) instead of keeping them private to WebRender.

Requires servo/webrender_traits#55 and servo/webrender#277.

Partially addresses #11108.

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: 27d1f182713077395426a53a9c91ec35c95887ee
2016-05-31 20:54:29 -05:00
malayaleecoder
643c9837e8 servo: Merge #10320 - Rename imm_child_iter() and child_iter() (from malayaleecoder:master); r=KiChjang
Fixes #10286

Source-Repo: https://github.com/servo/servo
Source-Revision: 0a1efe4578e43c4ffc2f90ff0118660899a83ac4
2016-04-09 03:25:40 +05:01
Per Lundberg
206f878009 servo: Merge #10277 - Renamed TComputedValues to ComputedValues (from perlun:rename-tcomputedvalues-to-computedvalues); r=SimonSapin
This is a followup to #10210, and a continuation of #10185.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0ec96ac02a6c40ffda98e1074ceb9874dd1fb3cb
2016-03-30 10:35:57 +05:01
Per Lundberg
ad08fc1cc0 servo: Merge #10210 - ComputedValues is now ServoComputedValues (from perlun:rename-computedvalues-to-servocomputedvalues); r=SimonSapin
This is the first part of #10185. More to follow. I have built this locally with both servo and geckolib without errors; let's see if it succeeds on all platforms as well.

Source-Repo: https://github.com/servo/servo
Source-Revision: 639fdd6b128e0cfd418e4ae0dd78de3f5aecac4c
2016-03-29 17:56:40 +05:01
Patrick Walton
818acd332f servo: Merge #10085 - layout: Rewrite the block formatting context/float inline-size speculation code (from pcwalton:floats-inout-revamp); r=mbrubeck
The old code tried to do the speculation as a single bottom-up pass
after intrinsic inline-size calculation, which was unable to handle
cases like this:

    <div>
        <div style="float: left">Foo</div>
    </div>
    <div>
        <div style="overflow: hidden">Bar</div>
    </div>

No single bottom-up pass could possibly handle this case, because the
inline-size of the float flowing out of the "Foo" block could never make
it down to the "Bar" block, where it is needed for speculation.

On the pages I tried, this regresses layout performance by 1%-2%.

I first noticed this breaking some pages, like the Google SERPs, several
months ago.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 1554331f06900e69f246ed9986a08aae91a0a71e
2016-03-26 06:39:41 +05:01
Bobby Holley
6e1def963d servo: Merge #10155 - Generalize the style structs (from bholley:generalize_style_structs); r=SimonSapin
This allows geckolib to pass gecko style structs and have the style system write to them directly, provided we implement all the traits.

Source-Repo: https://github.com/servo/servo
Source-Revision: 605842f193aedc1151ab38a99c49f693c76e5cf3
2016-03-25 02:58:33 +05:01
Patrick Walton
73f8220db0 servo: Merge #9843 - Optimize flat display lists (from pcwalton:optimize-flat-display-lists); r=mrobinson
Flat display lists were a 2x regression on the spheres demo. This patch series fixes that.

See the individual commits for more details.

r? @mrobinson

Source-Repo: https://github.com/servo/servo
Source-Revision: 55fc48e4c46917a0f036d0054fac296bb5719434
2016-03-04 02:20:04 +05:01
Martin Robinson
36406cdba8 servo: Merge #9756 - Flatten display list structure (from mrobinson:flat-display-lists-webrender); r=pcwalton
Instead of producing a tree of stacking contexts, display list
generation now produces a flat list of display items and a tree of
stacking contexts. This will eventually allow display list construction
to produce and modify WebRender vertex buffers directly, removing the
overhead of display list conversion.  This change also moves
layerization of the display list to the paint thread, since it isn't
currently useful for WebRender.

To accomplish this, display list generation now takes three passes of
the flow tree:

        1. Calculation of absolute positions.
        2. Collection of a tree of stacking contexts.
        3. Creation of a list of display items.

After collection of display items, they are sorted based upon the index
of their parent stacking contexts and their position in CSS 2.1
Appendeix E stacking order.

This is a big change, but it actually simplifies display list generation.

Source-Repo: https://github.com/servo/servo
Source-Revision: 62814f7cb486bc267a796b7ce58c51d59240fad0
2016-03-02 05:52:08 +05:01
Anthony Ramine
1b4c648862 servo: Merge #9686 - Move util::logical_geometry to style (from nox:mv-logical_geometry); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: eee0d4efeba1ee77e864a495b6e1992c8ad088cc

--HG--
rename : servo/components/util/logical_geometry.rs => servo/components/style/logical_geometry.rs
rename : servo/tests/unit/util/logical_geometry.rs => servo/tests/unit/style/logical_geometry.rs
2016-02-18 14:22:29 +05:01
Patrick Walton
98bb874f22 servo: Merge #9522 - layout: Separate out overflow-for-scrolling from overflow-for-paint (from pcwalton:two-overflows); r=mbrubeck
Closes #9484.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: fb3fe3d784c24cdfd8040af0282e5c2182ee2051
2016-02-05 10:29:50 +05:01
Simon Sapin
6bd2c3635f servo: Merge #9170 - Add CSS Multicolumn support with block fragmentation (from SimonSapin:multicol2); r=mbrubeck
![a](https://cloud.githubusercontent.com/assets/291359/12147538/bfb198ac-b499-11e5-9936-c54c93d0b1ed.png)

Includes/supersedes #8763.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 5e1f0495a922c5dddbc120f17ba5c933973537ed
2016-01-30 00:20:14 +05:01
Martin Robinson
acc0f49daf servo: Merge #8632 - Improve readability of flow tree dump (from mrobinson:flow-tree-dump); r=pcwalton
Use the PrintTree utility to improve the readability of flow tree
dumps. Blocks and fragments are now split over two dump levels, because
otherwise they are impenetrable. Also start printing the restyle damage of
fragments.

Source-Repo: https://github.com/servo/servo
Source-Revision: a2330f494316926dca9f64431d8357a093143d7d
2015-11-24 07:20:07 +05:01
Glenn Watson
40d2827806 servo: Merge #7795 - Split Au type into separate crate, with minimal dependencies (from glennw:app-units-crate); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: 35888e5a1d48511ec54ddf8c58f1c7b0c47c5d3c
2015-09-30 15:19:33 -06:00
Ravi Shankar
7d512d50d1 servo: Merge #7698 - sorted the declarations in various files (from Wafflespeanut:sorting); r=frewsxcv
This is a direct extract from my abandoned PR for a lint (#7546), along with some rather clumsy modifications (only on `components/script/dom/mod.rs` and `components/style/lib.rs`), because I had to sort some of the files again to make peace with tidy, which hasn't been educated about sorting yet!

Source-Repo: https://github.com/servo/servo
Source-Revision: a7208869f2903e36f9b2f540b55b50283d7df466
2015-09-23 15:02:56 -06:00
Brandon Fairchild
f7fb1e4b4a servo: Merge #7662 - Check for multiple import blocks separated by whitespace (from nerith:import); r=frewsxcv
Fixes #7381.

Source-Repo: https://github.com/servo/servo
Source-Revision: a0d3c9223f09757124b1520c4f17e94fa8bbe249
2015-09-19 13:34:51 -06:00
Manish Goregaokar
cf0446c9f9 servo: Merge #7536 - More clippy fixes (from Manishearth:clippyfix); r=Ms2ger
Elided almost all the lifetimes and removed needless returns. Mostly done by sed + manual fixes.

r? @nox

Source-Repo: https://github.com/servo/servo
Source-Revision: c2c2646d37614ece5869af861993c3d619f6e003
2015-09-04 07:59:04 -06:00
Michael Howell
0989ae0e2b servo: Merge #7474 - Inline constraint resolver for absolutely positioned tables (from notriddle:master); r=pcwalton
Fixes #7425.

Source-Repo: https://github.com/servo/servo
Source-Revision: dee6283483a79b034565a6f9ad979f87c2765f78
2015-08-31 20:35:06 -06:00
Johann Tuffe
5c3a5a67f5 servo: Merge #7265 - Add alphabetical order check for use statements (from tafia:tidy-use); r=Ms2ger
close #7112

Source-Repo: https://github.com/servo/servo
Source-Revision: a5fbb2f2a6fa79755f975feff2435abb6a5dd0e9
2015-08-20 07:43:56 -06:00
Corey Farwell
871003a8b5 servo: Merge #7178 - flow::Flow should follow *_mut naming conventions (from frewsxcv:flow-api-mut); r=nox
Fixes #7148

Source-Repo: https://github.com/servo/servo
Source-Revision: 014608f60c45574e6a347f39a96aa33b8eab02e1
2015-08-18 07:31:57 -06:00
João Oliveira
8410286b02 servo: Merge #7225 - Replace uses of for foo in bar.iter() and for foo in bar.iter_mut() (from jxs:master); r=nox
closes #7197

Source-Repo: https://github.com/servo/servo
Source-Revision: a1b3f477aa541fda4d1b6ccb02c3e56143f4d217
2015-08-15 03:03:21 -06:00
Patrick Walton
feefd8fa17 servo: Merge #6977 - layout: Make sure anonymous table flows are statically positioned (from pcwalton:containing-block-link-crash); r=mbrubeck
The failing `float-applies-to-*` CSS 2.1 tests never really should have
been passing in the first place; they depend on floats inside
fixed-layout tables working properly, which they don't.

Closes #6078.
Closes #6709.
Closes #6858.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 1ddef2997abf51716835017225b282f8a9077cce
2015-08-06 22:11:04 -06:00
Patrick Walton
10bcc61257 servo: Merge #6947 - layout: Don't use the block container inline size as the initial computed table inline size (from pcwalton:table-center); r=glennw
Makes google.com fully centered.

r? @glennw
cc @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: 220557008318350b444ba1917a3b07e03d30bec5
2015-08-04 11:36:09 -06:00
Glenn Watson
b4bfd1bd03 servo: Merge #6784 - Implement offsetParent/Top/Left/Width/Height (from glennw:offset-ext); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: d66c59a15213dec17f38af0653e9e7e1bf579a95
2015-08-03 18:39:43 -06:00
Glenn Watson
a84ef3b7a1 servo: Merge #6865 - Fix panic when html element has display: table (from glennw:root-fixes); r=pcwalton
Ref #6643

Source-Repo: https://github.com/servo/servo
Source-Revision: 8419b15a3475fc54012976fbfab2139f631f9d93
2015-07-31 02:10:40 -06:00
ecoal95
b32a9cd993 servo: Merge #6423 - Use euclid from crates.io (from emilio:euclid); r=glennw
Sorry for not doing it yesterday, I couldn't.

cc @metajack @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: 4ebb95ccd8e034007eacb447a054919ef4af2bf7
2015-06-18 20:50:22 -06:00
Patrick Walton
b776a7f734 servo: Merge #6053 - compositing: Implement display ports and avoid creating display lists for items outside it (from pcwalton:displayports); r=glennw
This improves Servo's performance on large pages.

Please double-check the logic when it comes to nested layers—I'm sure I've messed up some of the geometry calculations :)

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: 0880e54f987bac7c34c934ef6ee36f46475b06e3

--HG--
rename : servo/tests/html/lipsum.html => servo/tests/html/lipsum-large.html
2015-05-19 19:40:36 -05:00
Matt Brubeck
fb26b00385 servo: Merge #6081 - Fix layout of RTL tables in LTR flow (from mbrubeck:table-wrapper-rtl); r=pcwalton
Fixes #6006. r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: 3934831da3f481e24f923e73fa9df3a0faec194e
2015-05-15 22:46:35 -05:00
Patrick Walton
c918f5d92e servo: Merge #5911 - layout: Allow inline elements to be containing blocks for absolutely-positioned elements (from pcwalton:absolute-inline-containing-blocks); r=mbrubeck
r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: c0ee952a2a7054dcc7e97990a625c281322dd526
2015-05-13 14:27:21 -05:00
Matt Brubeck
b470ce5d9d servo: Merge #5997 - Fix direction of columns in mixed LTR/RTL tables (from mbrubeck:table-direction); r=pcwalton
Table columns should be layed out according to the 'direction' property of the
table flow, regardless of the 'direction' property of any table-row,
table-rowgroup, etc. flows.

This fixes a number of the `direction-applies-to-*` tests in the CSS2.1 test
suite.

This also simplifies `propagate_column_inline_sizes_to_child` by separating
the code used for table cells from the code for non-cell flows.

r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: 844ac2915eab6573c43e7648cfa94cc2d97fa901
2015-05-11 07:50:09 -05:00
Simon Sapin
da599fc5b9 servo: Merge #5951 - Clean up the Au API (from SimonSapin:au-cleanup); r=mbrubeck
Fix #5943.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 1721cf45ed59306a69f3ade08feca065804c3804
2015-05-05 15:08:12 -05:00
Simon Sapin
95c8716656 servo: Merge #5935 - Upgrade Rust (from servo:rustup_2015-04-25); r=Ms2ger
r? everybody

Source-Repo: https://github.com/servo/servo
Source-Revision: 49aed6555dbc008c1a378c5cbb303f5467232b6b
2015-05-05 09:11:30 -05:00
Ms2ger
bd8631ac9a servo: Merge #5916 - Prepare for the rustup (from servo:prepare-rustup); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 2f0b805fad2419518f0d80e90cf322fbd507a916
2015-05-01 14:44:19 -05:00
Simon Sapin
5d6d967ea0 servo: Merge #5480 - Preliminary steps for CSS Multi-column Layout (from SimonSapin:multicol); r=pcwalton
This add some properties to the style system and a new flow type, but the larger issues of dealing with fragmentation in the flow tree is still an open question.

Source-Repo: https://github.com/servo/servo
Source-Revision: 1e150140bd12624ad357e3168fb496079fb8ec7c

--HG--
rename : servo/components/layout/table_caption.rs => servo/components/layout/multicol.rs
2015-04-28 19:48:45 -05:00
Ms2ger
33e1b9c8ab servo: Merge #5888 - Prepare for the rustup (from Ms2ger:prepare-rustup); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: ab2d07db1fabd7ad9590aa7296038bbc91806c3f
2015-04-28 17:52:49 -05:00
Matt Brubeck
3e5f72c2ba servo: Merge #5885 - Ignore border-spacing for tables with zero cells (from mbrubeck:empty-table); r=pcwalton
r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: b5beebbc6280f5ff6397b6a9154b705d42d000e7
2015-04-28 13:53:59 -05:00
Patrick Walton
cb206c9929 servo: Merge #5831 - layout: Make margin: auto work properly with tables (from pcwalton:amazon-table-sizing); r=mbrubeck
r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 32b9c0962b7e42ac6d298f5959f1e48d4cc99c5a
2015-04-28 11:44:39 -05:00
Simon Sapin
524056a01d servo: Merge #5870 - layout: Implement most of border-collapse per CSS 2.1 § 17.6.2 (from SimonSapin:border-collapse); r=SimonSapin
Fixes #5300, which it is a rebase of.

Known issues:

* Collapsed borders do not correctly affect the border-box of the table
  itself.

* The content widths of all cells in a column and the content height of
  all cells in a row is the same in this patch, but not in Gecko and
  WebKit.

* Corners are not painted well. The spec does not say what to do here.

* Column spans are not handled well. The spec does not say what to do
  here either.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8a4555cc53bc1bbb21a08eb6f010cb1215034419
2015-04-27 12:29:15 -05:00
Ms2ger
126ec4d408 servo: Merge #5847 - Avoid as_slice() / at_mut_slice() (from Ms2ger:slice); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: 1389be37823fccf4108f4e79d0a3a793f0bbe93e
2015-04-26 05:30:28 -05:00
Ms2ger
374d18472e servo: Merge #5827 - Use as_slice less (from Ms2ger:slice); r=mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: 79be3b967668e46a4289f4fc8fce2b4f457cab23
2015-04-24 12:12:53 -05:00
Patrick Walton
eec717c4e3 servo: Merge #5691 - layout: Use the same code path for computing static positions of regular flows and static positions of hypothetical boxes (from pcwalton:hypothetical-box-reform); r=glennw
Before this change, Servo used one code path that computed the position
of flows with `position: static` or `position: relative` and another
separate code path that computed the position of flows with `position:
absolute` or `position: fixed`. The latter code attempted to duplicate
the former code to determine the static position of hypothetical boxes,
but this was both fragile and incorrect in the case of hypothetical
boxes nested inside floats. In fact, it's impossible to determine the
static position of an absolute flow relative to its containing block at
inline-size assignment time, because that static position could depend
on a float that cannot be placed until block-size assignment!

This patch changes block layout to use the same code path for static
positioning of regular flows and static positioning of absolute flows
where applicable. This both simplifies the code and improves its
efficiency, since it allows the `hypothetical_position` field and
`static_block_offsets` data structure to be removed. Moreover, it
improves correctness in the above case (which the new reftest checks).
This allows the sidebar in Facebook Timeline to be positioned properly.

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: bdcf606f4802e5b1ab3ee251b45ee1e81800359a
2015-04-14 18:14:11 -05:00
Patrick Walton
29f9b60d27 servo: Merge #5584 - layout: Remove the bogus assign_block_size_for_inorder_child_if_necessary logic from table wrapper flows (from pcwalton:fix-a-float-redux); r=glennw
As far as I can tell, this is a cut-and-paste of old buggy code from
block flows. Delegating to the correct block flow code fixes the sidebar
float placement on Guardians of the Galaxy.

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: f4da0f0e94259e12adeb193fd9ecf6813457b883
2015-04-08 03:57:36 -05:00
Manish Goregaokar
5dbe6eb389 servo: Merge #5296 - Replace unsafe_blocks by unsafe_code (from servo:unsafe_code); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 29a36adbe7d87fb38ba9bef3a718c6c823fb5977
2015-03-21 05:12:45 -06:00
Matt Brubeck
a9553b022c servo: Merge #5233 - Fixes for positioning of RTL blocks (from mbrubeck:rtl-position); r=SimonSapin
This fixes a bug in finding the top left corner of an RTL block in physical coordinates.  (The old code used the `start` point of the `position` rect, which is not always the top left.)

It also fixes the setting of `position.start.i` in certain mixed LTR/RTL cases.

There is still a bug related to `position.size` for RTL blocks with margins.  See the FIXME comments for details.

r? @pcwalton or @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: b255b49e2e2246ff8bf7f8751088bfe0a0ee41a2
2015-03-17 12:33:53 -06:00
Patrick Walton
c12b663e80 servo: Merge #4417 - layout: Implement border-spacing per CSS 2.1 § 17.6.1 and the legacy cellspacing attribute per HTML5 § 14.3.9 (from pcwalton:border-spacing); r=larsbergstrom
Table layout code has been refactored to push the spacing down to
rowgroups and rows; this will aid the implementation of
`border-collapse` as well.

r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: 8e811229bae6b338fabcd7df602079730c942889
2015-03-12 13:03:49 -06:00
Patrick Walton
c4615436ae servo: Merge #5160 - layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1 § 12.3-12.5 (from pcwalton:counters-redux); r=SimonSapin
Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.

Reconstructed from #5138 via raw diffing.

r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: fd1bb49a65dd998c8ef9890a1576aaf62ddfdba1
2015-03-09 23:24:47 -06:00
Dan Fox
f6711c6464 servo: Merge #5135 - Fix 5120 rename layout util (from iamdanfox:fix-5120-rename-layout-util); r=jdm
A simple rename/refactor (https://github.com/servo/servo/issues/5120)

My first servo contribution!

Source-Repo: https://github.com/servo/servo
Source-Revision: 7fc37dfaa76c9265e6d2145fe5ef2fba5f6bd013
2015-03-05 11:09:58 -07:00
Simon Sapin
9d0586a22d servo: Revert "layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1"
This reverts commit 30fd28d1077fbb3f47140f6ab1252c0d24f44d23.

Source-Repo: https://github.com/servo/servo
Source-Revision: 4c1d778ced267eeef790d4166e361d9348b933d3
2015-03-03 21:16:24 +01:00
Simon Sapin
73082d1626 servo: Merge #5067 - layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1 § 12.3-12.5 (from servo:counters); r=SimonSapin
Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.

Moved from #4544, because Critic.

Fixes #4544.

Source-Repo: https://github.com/servo/servo
Source-Revision: 5cd6316addc1acf145ed3220719387ef6ef08d2f
2015-03-03 10:42:52 -07:00
Patrick Walton
150bdee4d8 servo: Merge #4994 - layout: Add an option to visualize parallel layout (from pcwalton:layout-tinting); r=pcwalton
r? @metajack

Source-Repo: https://github.com/servo/servo
Source-Revision: d26345f868e4261760ce204bdc383941e8f14621
2015-02-20 23:06:48 -07:00