Commit graph

54 commits

Author SHA1 Message Date
Bobby Holley
c5e27f41ed servo: Merge #8595 - Generalize the layout wrapper layer (from bholley:generalize_wrappers); r=pcwalton
There's still more refactoring to do, but this is the core stuff that's most likely to bitrot.

Source-Repo: https://github.com/servo/servo
Source-Revision: a5babb89a02b9b84a8cd62554a5ceef9efb0d481
2015-11-19 06:43:40 +05:01
Ms2ger
039acf7bfe servo: Merge #8562 - Stop exposing the internal details of the layout crate (from Ms2ger:private-layout); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: 2be0cb7827c6553b7dfa4d641bf3a1c72372ad3b
2015-11-18 19:04:36 +05:01
Ms2ger
ffd1877846 servo: Merge #8378 - Reduce LayoutTaskData to the fields used for RPC (from Ms2ger:rwdata); r=eefriedman
Source-Repo: https://github.com/servo/servo
Source-Revision: 0d21158eb3bc8cb64a1953ab77b57e813bd429ed
2015-11-10 07:18:45 +05:01
Glenn Watson
11639f24e6 servo: Merge #8306 - Change overflow calculation to be calculated after compute_absolute_position (from glennw:fix-abd-overflow); r=pcwalton
Also include absolutely positioned elements in the overflow rect calculation.

Fixes #7797.

Source-Repo: https://github.com/servo/servo
Source-Revision: ca56ebbb09f3c258d10e7a7fa276d42fe258d893
2015-11-04 07:46:58 +05:01
Ms2ger
fad7f9bff1 servo: Merge #8212 - Remove SharedLayoutContext::reflow_root (from Ms2ger:reflow-root); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: b6bcccb204f710665482fa8098084a30126a3bac
2015-10-30 04:53:54 +05:01
Ms2ger
8be0065221 servo: Merge #8029 - Some cleanup in layout (from Ms2ger:cleanup-layout); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: e0c8a88410277843714a20d5fced73a392fad861
2015-10-19 11:36:58 -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
Patrick Walton
3574beaa4c servo: Merge #7600 - layout: Allow the overflow area of the <body> to be scrolled (from pcwalton:body-overflow-scroll); r=mbrubeck
Fixes scrolling on Twitter.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 8d7ba12f28a873880c1f51b122d4fc185294c849

--HG--
rename : servo/tests/html/lipsum.html => servo/tests/html/percentage-body-height.html
2015-09-11 11:20:13 -06:00
Simon Sapin
a0656c9a6b servo: Merge #7237 - Replace FlowRef with Arc<Flow>, now that Arc supports DST (from servo:arc-flow); r=pcwalton
… and `WeakFlowRef` with `Weak<Flow>`.

r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: 1f9778fad90e41ec70e8f54d61e168172635d925
2015-08-21 15:29:35 -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
João Oliveira
3436fe7092 servo: Merge #7257 - Replace uses of for foo in bar.iter(), (from jxs:master); r=Ms2ger
and `for foo in bar.iter_mut(), and for foo in bar.into_iter()
(continuation of #7197)

Source-Repo: https://github.com/servo/servo
Source-Revision: 0d6d6a05009606dfbbfc9765d7dc2c745c18f6a5
2015-08-18 02:46:46 -06:00
Josh Matthews
6a81d499fc servo: Merge #7203 - Add automated style nit checks to test-tidy (from jdm:style); r=Ms2ger
Expands on the work by @wilmoz and cleans up the existing errors. Closes #7180. Closes #7111.

Source-Repo: https://github.com/servo/servo
Source-Revision: e74825f9fde8e222f4ba9bb24b2c2a3864c73e5f
2015-08-16 08:37:40 -06:00
Anthony Ramine
6660f5b499 servo: Merge #6778 - Optimise Node.childNodes (from nox:childnodes); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 2b9590c5a53f273c13c6fb36f95fbf593bbffd8b
2015-08-10 14:05:02 -06:00
Ms2ger
5d01ac1294 servo: Merge #6712 - Cleanup ParallelPostorderFlowTraversal (from Ms2ger:traversal); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 886c08c393f51499490702eaf97fc770273a2600
2015-07-24 20:50:55 -06:00
Ms2ger
b552054f96 servo: Merge #6650 - Various layout cleanup (from Ms2ger:layout-cleanup); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: e6538c0f2d887bfb244313009490ca67bc1c2298
2015-07-17 09:17:41 -06:00
Ms2ger
26f7280725 servo: Merge #6547 - Borrow the QueueData for WorkQueue::run (from Ms2ger:workqueue-reference); r=pcwalton
This allows us to get rid of the raw pointers and unsafe dereferencing in
the parallel layout implementation.

Source-Repo: https://github.com/servo/servo
Source-Revision: a3821bf24094bf5bb2a9553e66b69da3b6430aa5
2015-07-06 08:29:17 -06:00
Ms2ger
b6bf8e7e24 servo: Merge #6513 - Remove the data field from WorkQueue (from Ms2ger:workqueue-data); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: d09881b051e01f145bf701d48d6d91167bccbe30
2015-07-03 07:22:44 -06:00
Ms2ger
609f5bd7a7 servo: Merge #6461 - Use a dedicated type for the opaque type parameter to WorkQueue in layout (from Ms2ger:workqueuedata); r=pcwalton
Currently, we use UnsafeFlow and UnsafeLayoutNode, both of which are aliases
for (usize, usize) and thus interconvertible. This change should make it
clearer that the WorkQueue is not limited to one particular type.

Source-Repo: https://github.com/servo/servo
Source-Revision: 07a1e187f03484c5f326e48c4a5fed81c134d215
2015-06-26 14:10:07 -06:00
Ms2ger
c5c2f568a3 servo: Merge #6463 - Reduce the scope of the unsafe block in ParallelPostorderDomTraversal (from Ms2ger:layout-reduce-unsafe); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: f812390d3a6f5097aa493313c6c90fd2fa320024
2015-06-26 06:45:48 -06:00
Ms2ger
e448407e4d servo: Merge #6443 - Various layout cleanup (from Ms2ger:cleanup-layout); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 469b9550f6feec56d87ea5c772cb76453c13036a
2015-06-24 03:00:32 -06:00
Patrick Walton
3dca4cd0c1 servo: Merge #6347 - layout: Divide DOM nodes and flows into chunks, and perform work stealing over those instead of working on nodes one-by-one (from pcwalton:chunking); r=mbrubeck
This reduces the overhead of the work-stealing traversal function
significantly. It's especially important on ARM, where memory barriers are
expensive.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 836ac8a0b6daeecb865bcf35d2b39602398870ef
2015-06-12 17:14:23 -06:00
Michael Wu
d49fb75099 servo: Merge #6139 - Rustup fixes (from michaelwu:rustup-fixes); r=SimonSapin
Mutable transmutes and wrong transmutes fixed.

Source-Repo: https://github.com/servo/servo
Source-Revision: 64810583093dadfacbda942562853af1ae82e34e
2015-05-20 01:55:43 -05:00
Nicholas Nethercote
f6d34641fc servo: Merge #5912 - Add a profile_traits crate to reduce compile times (from nnethercote:profile_traits); r=Manishearth
A rebuild after touching components/profile/mem.rs now takes 48 seconds (and
only rebuilds `profile` and `servo`) which is much lower than it used to be.
In comparison, a rebuild after touching components/profile_traits/mem.rs takes
294 seconds and rebuilds many more crates.

This change also removes some unnecessary crate dependencies in `net` and
`net_traits`.

Source-Repo: https://github.com/servo/servo
Source-Revision: 77f653da2c4120ea7ac1a946d97fc70059d513d4

--HG--
rename : servo/tests/unit/gfx/lib.rs => servo/components/profile_traits/lib.rs
2015-04-30 20:02:33 -05:00
Ms2ger
c64ea30626 servo: Merge #5486 - Stop using int/uint in layout (from Ms2ger:int); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: d999fb9db0d572f63165fa8aa2e24023903b6332
2015-04-02 08:06:41 -06:00
Ms2ger
1bc473080c servo: Merge #5443 - Use more usize (from Ms2ger:int); r=saneyuki
Source-Repo: https://github.com/servo/servo
Source-Revision: a0a1304be08250511e20ed8b378bbf6a34c22bf4
2015-03-29 16:16:01 -06:00
Fabrice Desré
4e0aaf879e servo: Merge #5380 - Suppress unused import warnings (from fabricedesre:no-unused-import); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 26c77d6662255e6da4ac86c3efb64bd4eba86697
2015-03-26 08:51:51 -06:00
Nicholas Nethercote
7f03c21505 servo: Merge #5348 - Rename lots of profiling-related things (from nnethercote:profiler-renaming); r=jdm
```
------------------------------------------------------------------------
BEFORE                              AFTER
------------------------------------------------------------------------
util::memory                        util::mem
- heap_size_of                      - heap_size_of (unchanged)
- SizeOf                            - HeapSizeOf
  - size_of_excluding_self            - heap_size_of_children

prof::mem                           prof::mem
- MemoryProfilerChan                - ProfilerChan
- MemoryReport                      - Report
- MemoryReportsChan                 - ReportsChan
- MemoryReporter                    - Reporter
- MemoryProfilerMsg                 - ProfilerMsg
  - {R,UnR}egisterMemoryReporter      - {R,UnR}egisterReporter
- MemoryProfiler                    - Prof
- ReportsForest                     - ReportsForest (unchanged)
- ReportsTree                       - ReportsTree   (unchanged)
- SystemMemoryReporter              - SystemReporter

prof::time                          prof::time
- TimeProfilerChan                  - ProfilerChan
- TimerMetadata                     - TimerMetadata (unchanged)
- Formatable                        - Formattable [spelling!]
- TimeProfilerMsg                   - ProfilerMsg
- TimeProfilerCategory              - ProfilerCategory
- TimeProfilerBuckets               - ProfilerBuckets
- TimeProfiler                      - Profiler
- TimerMetadataFrameType            - TimerMetadataFrameType (unchanged)
- TimerMetadataReflowType           - TimerMetadataReflowType (unchanged)
- ProfilerMetadata                  - ProfilerMetadata (unchanged)
```
In a few places both prof::time and prof::mem are used, and so
module-qualification is needed to avoid overlap, e.g. time::Profiler and
mem::Profiler. Likewise with std::mem and prof::mem. This is not a big
deal.

Source-Repo: https://github.com/servo/servo
Source-Revision: d784d9c488be4533a3590a154addd366d15a5864
2015-03-25 21:18:48 -06:00
Nicholas Nethercote
f9758aa688 servo: Merge #5335 - Move profiler code from util into a new crate profile (from nnethercote:profile-crate); r=glennw
- Most of util::memory has been moved into profile::mem, though the
  `SizeOf` trait and related things remain in util::memory. The
  `SystemMemoryReporter` code is now in a submodule
  profile::mem::system_reporter.

- util::time has been moved entirely into profile::time.

Source-Repo: https://github.com/servo/servo
Source-Revision: d1268ec9c6633684270015e7b2619181aeb47b8b

--HG--
rename : servo/components/util/time.rs => servo/components/profile/time.rs
2015-03-24 03:15:49 -06: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
Ms2ger
01a90574bd servo: Merge #5288 - Fix various build warnings (from Ms2ger:warnings); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: 0663cd632517c9a9c86db47456c5a4da637045ed
2015-03-20 11:00:54 -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
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
Ms2ger
f6f1990ef0 servo: Merge #4869 - Various layout cleanup (from Ms2ger:layout-unsafe); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 1a47f176ffb059a7a3f29f94485859163cb1284b
2015-02-08 21:00:43 -07:00
Josh Matthews
78741af324 servo: Merge #4719 - Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev (from servo:rustup_20150109); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 3f9012864a2cd927cf17a8e11dfa6922add1b7df
2015-01-27 18:15:50 -07:00
Ms2ger
7363fc6372 servo: Merge #4708 - Prepare for the rust upgrade (from Ms2ger:rustup-prepare); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: 55fbf1f2b6924c50cff6e4ddf359289654f4858a
2015-01-22 08:06:50 -07:00
Ms2ger
11a0efe9f4 servo: Merge #4542 - Prepare for the rust upgrade (from servo:pre-rustup_20141221); r=saneyuki
In particular, this contains changes to qualify enums where rust will require it, and to stop using some features that will be removed.

Source-Repo: https://github.com/servo/servo
Source-Revision: ba8cf6b0e6145265f9472d4855f078d8b5943fe7
2015-01-04 12:39:47 -07:00
Patrick Walton
cda269baf7 servo: Merge #4358 - compositing: Implement cursor per CSS3-UI § 8.1.1 in the CEF/Mac port (from pcwalton:cursor); r=mbrubeck
I'm not sure how we want to handle Linux cursors, and GLFW has no
ability to set cursors (short of disabling it and managing it yourself).

If you test this in the wild you will probably hit #4357 until that PR lands.

Source-Repo: https://github.com/servo/servo
Source-Revision: e2267e0a0749e27046ee8a26ba514cc6865e0345
2014-12-18 00:24:49 -07:00
Timothy B. Terriberry
658bba4ee7 servo: Merge #4234 - Change time::profile's meta booleans to enums (from tterribe:issue4158); r=metajack
This makes these parameters self-documenting.
This patch does not attempt to push those enums into the data
structures that feed calls to this function.

Fixes #4158.

Source-Repo: https://github.com/servo/servo
Source-Revision: bc7b5b35b44e82dadb35242e39b190b3d1fcba10
2014-12-05 17:34:03 -07:00
Glenn Watson
22c4035692 servo: Merge #3948 - Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a (from servo:rustup-20141105_2); r=Manishearth
Source-Repo: https://github.com/servo/servo
Source-Revision: c5e1b0d32e17fad29799023c85e2e73ac89c3af7
2014-11-12 20:48:31 -07:00
Glenn Watson
feabe3b678 servo: Merge #3729 - Use opts as a global, to avoid cloning and passing the struct all over the code base (from glennw:opts-cleanup); r=mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: 852378209badb936e8929c31501cb8cabeea6bc5
2014-10-19 21:33:25 -06:00
Clark Gaebel
39c7ff714e servo: Merge #3686 - Use the Deref traits for FlowRefs (from cgaebel:deref-flows); r=pcwalton
This patch switches FlowRefs to using the Deref and DerefMut traits, instead of
the custom `get` and `get_mut` functions.

Source-Repo: https://github.com/servo/servo
Source-Revision: 6a11ee89de82abae9d6607a6c2890692df5259eb
2014-10-15 16:18:23 -06:00
Clark Gaebel
f081b5599e servo: Merge #3668 - Removes duplicate CSS selector matching logic (from cgaebel:sequential-reflow); r=pcwalton
Now that DOM/Flow traversals have been refactored out, the `recalc_style_for_subtree`
function in `css/matching.rs` can be removed, in lieu of just running the standard
`recalc_style_for_node` and `construct_flows` traversals sequentially. Now we
no longer have the maintenance headache of duplicating selector matching logic
in two places! \o/

This passes reftests with both default arguments, and with `-y 1`.

r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: 7eaeaeeb217e7cbd083fe318863e7de4b9f38e2b
2014-10-14 19:33:28 -06:00
Patrick Walton
46685905bb 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
Patrick Walton
ec00d8be86 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
b4bfd82e79 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
e1fa32f008 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
c3ef958820 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
c3a687251b 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
Patrick Walton
aca0393814 servo: Merge #3401 - layout: Remove layout/extra.rs (from pcwalton:refactor-layout)
Source-Repo: https://github.com/servo/servo
Source-Revision: f139eb51763091165136c88a7b9931fc09ebe2cc
2014-09-19 10:51:02 -04:00