Commit graph

64 commits

Author SHA1 Message Date
Ms2ger
b51e83819d Fix obsolete format traits.
They are to be removed from the language in the next rust upgrade.
2015-01-02 19:04:18 +01:00
Manish Goregaokar
c7dfb1d24b layout: to_string() -> into_string() 2014-12-27 14:48:36 +01:00
Patrick Walton
cc7cacfd5f gfx: Clip the background properly when border-radius is used.
Improves Reddit, GitHub, etc.
2014-12-22 14:48:55 -08:00
Patrick Walton
dea8375613 gfx: Refactor the border drawing code and split out fragment display
list building into multiple functions.

This should have no functional changes; it's just code cleanup.
2014-12-22 14:48:55 -08:00
Tetsuharu OHZEKI
a7bb436177 script: Remove glob imports added in #4405 2014-12-19 04:52:48 +09:00
Patrick Walton
7371e0b8e3 compositing: Implement cursor per CSS3-UI § 8.1.1 in the CEF/Mac port.
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).
2014-12-17 22:58:52 -08:00
Ms2ger
466faac2a5 Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00
Ms2ger
ac95d12037 Remove some manual deref() / deref_mut() calls. 2014-12-16 16:41:33 +01:00
Patrick Walton
17835ba0cb style: Implement quirks mode rules. 2014-12-15 17:41:51 -08:00
Patrick Walton
a200b139b6 script: Add some workarounds for image cache task races 2014-12-15 14:16:20 -08:00
Tetsuharu OHZEKI
9cda2c3395 Replace almost "render" to "paint" in layout crate.
This doesn't touch some "render" words which are used as general means.
2014-12-08 15:00:57 +09:00
Tetsuharu OHZEKI
79722bdc03 Rename gfx::paint_task::Msg 2014-12-08 14:05:50 +09:00
Tetsuharu OHZEKI
7ff790d941 Rename RenderChan -> PaintChan 2014-12-08 14:05:50 +09:00
Tetsuharu OHZEKI
cee3d517e8 Rename RenderLayer -> PaintLayer 2014-12-08 14:05:49 +09:00
Tetsuharu OHZEKI
daba904302 Rename gfx/render_task.rs -> gfx/paint_task.rs 2014-12-08 11:46:43 +09:00
Timothy B. Terriberry
65575bf8a7 Change time::profile's meta booleans to enums.
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.
2014-12-05 14:23:27 -08:00
Patrick Walton
1c1c507c03 layout: Implement opacity per CSS-COLOR § 3.2.
This adds the infrastructure necessary to support stacking contexts that
are not containing blocks for absolutely-positioned elements. Our
infrastructure did not support that before. This minor revamp actually
ended up simplifying the logic around display list building and
stacking-relative position computation for absolutely-positioned flows,
which was nice.
2014-12-03 14:17:16 -08:00
Patrick Walton
a4a9a46a87 gfx: Rewrite display list construction to make stacking-contexts more
first-class.

This implements the scheme described here:

    https://groups.google.com/forum/#!topic/mozilla.dev.servo/sZVPSfPVfkg

This commit changes Servo to generate one display list per stacking
context instead of one display list per layer. This is purely a
refactoring; there are no functional changes. Performance is essentially
the same as before. However, there should be numerous future benefits
that this is intended to allow for:

* It makes the code simpler to understand because the "new layer needed"
  vs. "no new layer needed" code paths are more consolidated.

* It makes it easy to support CSS properties that did not fit into our
  previous flat display list model (without unconditionally layerizing
  them):

  o `opacity` should be easy to support because the stacking context
    provides the higher-level grouping of display items to which opacity
    is to be applied.

  o `transform` can be easily supported because the stacking context
    provides a place to stash the transformation matrix. This has the side
    benefit of nicely separating the transformation matrix from the
    clipping regions.

* The `flatten` logic is now O(1) instead of O(n) and now only needs to
  be invoked for pseudo-stacking contexts (right now: just floats),
  instead of for every stacking context.

* Layers are now a proper tree instead of a flat list as far as layout
  is concerned, bringing us closer to a production-quality
  compositing/layers framework.

* This commit opens the door to incremental display list construction at
  the level of stacking contexts.

Future performance improvements could come from optimizing allocation of
display list items, and, of course, incremental display list
construction.
2014-11-14 17:31:15 -08:00
Jack Moffitt
d1b433a3b3 Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
Martin Robinson
c7327450ef Clip display list based on frame viewport
Instead of creating a display list for the entire page, only create one
for an area that expands around the viewport. On my machine this makes
incremental layout of http://timecube.com 50% faster.
2014-11-11 08:46:16 -08:00
Glenn Watson
11cf538ff4 Make media queries work with resize and page zoom. 2014-11-04 13:25:21 -08:00
Martin Robinson
2d72f00ccf Have ContentBox(es)Queries consult the flow tree
Instead of looking at the display tree, have ContentBox(es)Query consult
the flow tree. This allow optimizing away parts of the display tree
later. To do this we need to be more careful about how we send reflow
requests, only querying the flow tree when possible.

Fixes #3790.
2014-11-03 10:30:28 -08:00
Patrick Walton
08fc7c2795 layout: Make incremental reflow more fine-grained by introducing "reflow
out-of-flow" and "reconstruct flow" damage bits.

This is needed for good performance on the maze solver.
2014-10-31 12:24:40 -07:00
bors-servo
651ef60b1c auto merge of #3839 : pcwalton/servo/fewer-moves-in-dls, r=glennw
These were showing up in the profile.

r? @glennw
2014-10-28 17:57:43 -06:00
bors-servo
4bdd9a5ec0 auto merge of #3837 : pcwalton/servo/layout-formatting-cleanups, r=metajack
These should have no effect on functionality.

r? @metajack
2014-10-28 17:21:48 -06:00
Patrick Walton
93bf69a6fe layout: Use the new append_from method to get rid of a bunch of moves
in display list construction.

These were showing up in the profile.
2014-10-28 14:28:34 -07:00
bors-servo
2d8bd10abe auto merge of #3828 : cgaebel/servo/layout-node-dumping, r=pcwalton
r? @pcwalton
2014-10-28 13:12:52 -06:00
Patrick Walton
68091d7a86 layout: Make some formatting cleanups.
These should have no effect on functionality.
2014-10-28 12:00:35 -07:00
Clark Gaebel
e4d8741991 remove warning 2014-10-28 10:28:24 -07:00
Clark Gaebel
47091c014d combine conditions 2014-10-28 10:26:48 -07:00
Clark Gaebel
a8f80b89f4 layout: Implement flow tree dumping with RUST_LOG=debug is on.
r? @pcwalton
2014-10-28 10:14:12 -07:00
Clark Gaebel
432071b703 Layout: Fix resize (which just plain doesn't work right now).
Currently, both restyle/flow construction _and_ reflow are skipped
during resize. Reflow should not be in that list. This patch fixes
that.
2014-10-28 09:35:24 -07:00
Keegan McAllister
6ec0939a22 Dynamically check DOMRefCell access from layout in debug builds 2014-10-24 16:27:37 -07:00
Patrick Walton
e9a61c1ccf layout: Don't destroy the flow tree when resizing the window 2014-10-20 22:05:38 -07:00
Clark Gaebel
81bd3cbd9d Fixes the table_percentage_width_a.html reftest with incremental reflow turned on. 2014-10-20 11:13:31 -07:00
Glenn Watson
076495db94 Use opts as a global, to avoid cloning and passing the struct all over the code. 2014-10-20 10:48:47 +10:00
bors-servo
3906cecd16 auto merge of #3719 : mrobinson/servo/flow-dump, r=pcwalton
The flow tree is currently dumped for debugging purposes early on in
the flow process, so many values are still zero. If we wait to dump it
until later, the output will more accurately reflect the real flow tree.
2014-10-17 19:51:24 -06:00
Martin Robinson
e7c79906bd Wait to dump flow tree until flow is complete
The flow tree is currently dumped for debugging purposes early on in
the flow process, so many values are still zero. If we wait to dump it
until later, the output will more accurately reflect the real flow tree.
2014-10-17 18:48:09 -07:00
Clark Gaebel
8496c056e7 Fixed the inline_element_border_a reftest with incremental layout turned on. 2014-10-17 11:11:14 -07:00
Clark Gaebel
2faf5b270f Fix image_dynamic_remove reftest with incremental layout turned out
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
2014-10-17 11:11:14 -07:00
bors-servo
b83352f7eb auto merge of #3692 : cgaebel/servo/fix-incremental-append-style, r=pcwalton
@pcwalton r?
2014-10-15 20:00:20 -06:00
Clark Gaebel
0a541fc83c Fix append_style reftests with incremental reflow turned on.
@pcwalton r?
2014-10-15 15:47:11 -07:00
Clark Gaebel
76ed7484eb Use the Deref traits for FlowRefs.
This patch switches FlowRefs to using the Deref and DerefMut traits, instead of
the custom `get` and `get_mut` functions.
2014-10-15 11:04:05 -07:00
bors-servo
7eaeaeeb21 auto merge of #3668 : cgaebel/servo/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
2014-10-14 19:33:28 -06:00
bors-servo
3eb6b17137 auto merge of #3610 : glennw/servo/media-queries, r=SimonSapin 2014-10-14 18:36:29 -06:00
Clark Gaebel
7368d42225 Removes duplicate CSS selector matching logic.
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/

r? @pcwalton
2014-10-14 16:28:29 -07:00
bors-servo
56989b8dec auto merge of #3640 : cgaebel/servo/incremental-flow-construction, r=pcwalton
This also hides the not-yet-working parts of incremental reflow behind a runtime
flag. As I get the failing reftests passing, I'll send pull requests for them one
by one.
2014-10-14 16:51:30 -06:00
Glenn Watson
c7d81fdde6 Implement media queries parser and matching. Improves mobile first sites like bootstrap3. 2014-10-15 07:36:31 +10:00
Clark Gaebel
f552e2f750 try to reset flows which need reflow, since reflow isn't yet idempotent 2014-10-14 10:33:46 -07:00
bors-servo
48ce107d72 auto merge of #3675 : glennw/servo/local-fonts, r=pcwalton 2014-10-14 11:33:34 -06:00