Commit graph

800 commits

Author SHA1 Message Date
Patrick Walton
215c2a9d4c layout: Implement CSS linear gradients per the CSS-IMAGES specification.
This implements the CSS `linear-gradient` property per the CSS-IMAGES
specification:

    http://dev.w3.org/csswg/css-images-3/

Improves GitHub.
2014-11-06 08:26:47 -08:00
Glenn Watson
11cf538ff4 Make media queries work with resize and page zoom. 2014-11-04 13:25:21 -08:00
bors-servo
39960f32e4 auto merge of #3878 : zwarich/servo/remove-input-fragment, r=jdm
Fixes #3724.
2014-11-03 16:54:31 -07:00
Cameron Zwarich
5043a63284 Remove InputFragment
Fixes #3724.
2014-11-03 15:48:20 -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
bors-servo
035ff19e4a auto merge of #3860 : pcwalton/servo/reflow-out-of-flow, r=glennw
This is the last PR and most of the work for the maze solver and RoboHornet. 

r? @glennw 
cc @cgaebel
2014-10-31 14:39:34 -06:00
Patrick Walton
a208463b62 layout: Employ a persistent list data structure to avoid copying floats
all the time.

Improves performance on the maze solver significantly since this was
basically O(n^2) before.
2014-10-31 12:42:32 -07: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
Patrick Walton
265763518f layout: Make absolute position calculation idempotent.
This will be necessary for incremental reflow of absolutely-positioned
flows.
2014-10-31 12:24:39 -07:00
bors-servo
ba13e448cf auto merge of #3838 : pcwalton/servo/style-sharing-enhancements, r=SimonSapin
This helps avoid problems with style sharing in common cases, often
caused by the user agent stylesheet.

r? @SimonSapin
2014-10-30 16:33:36 -06:00
Clark Gaebel
314a0d671e layout: Actually calculate restyle damage while styling.
...oops. Looks like I forgot to do this.

r? @pcwalton
2014-10-29 09:34:08 -07:00
Patrick Walton
587cf98209 layout: Promote absolute positioning, floatedness, and clearance into
flags to avoid virtual calls.

These were showing up really high in the maze solver profile.
2014-10-28 19:38:22 -07:00
bors-servo
c20bb66aef auto merge of #3841 : pcwalton/servo/removing-whitespace-damage, r=cgaebel
Avoids total reflow of the entire document on the maze solver.

I have tested Wikipedia reflow and it still works.

r? @cgaebel
2014-10-28 19:12:39 -06:00
bors-servo
08288fea41 auto merge of #3840 : pcwalton/servo/ib-splits-linked-list, r=glennw
r? @glennw
2014-10-28 18:36:41 -06: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
01965c399e layout: Stop adding damage when removing whitespace.
Avoids total reflow of the entire document on the maze solver.
2014-10-28 14:56:39 -07:00
Patrick Walton
16c0ebc14c layout: Put {ib} splits into a linked list so we stop copying them all
the time.
2014-10-28 14:39:45 -07: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
Patrick Walton
4bf0acbe38 layout: Support more types of selectors for style sharing.
This helps avoid problems with style sharing in common cases, often
caused by the user agent stylesheet.
2014-10-28 14:12:50 -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
cb5fa23a1e use println instead of error 2014-10-28 10:24:50 -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
Josh Matthews
a1b2f4b590 Add an optional --debug-mozjs argument to mach build that enables a non-optimized, debug build of mozjs and rust-mozjs. Update the Cargo snapshot to enable new feature support. 2014-10-24 16:18:25 -04:00
Glenn Watson
b1c226778f Cache last fontgroup. Style recalc on wikipedia/rust 66ms -> 41ms. 2014-10-24 08:25:10 +10:00
Patrick Walton
de5e2fd5e2 layout: Shrink fragments down from 448 bytes down to 128 bytes.
16% performance improvement in layout (!)
2014-10-23 09:13:41 -07:00
Clark Gaebel
5cd47c7670 Clear reflow flags after reflow. 2014-10-22 17:46:28 -07:00
bors-servo
01f6a8102d auto merge of #3771 : pcwalton/servo/display-list-building-cleanup, r=mrobinson
`layout::fragment` and `layout::block` were getting too big.

r? @mrobinson
2014-10-22 10:54:35 -06:00
Patrick Walton
821793351e layout: Largely move display list building out to a separate file.
`layout::fragment` and `layout::block` were getting too big.
2014-10-22 08:02:17 -07:00
bors-servo
fe230ef37d auto merge of #3763 : cgaebel/servo/issue-3753, r=pcwalton
r? @pcwalton

Looks like I forgot to save `ScannedTextFragment`s block sizes with their
inline sizes. This patch fixes that.

Fixes #3753
2014-10-21 23:27:36 -06:00
bors-servo
f5ad89f927 auto merge of #3747 : mrobinson/servo/validate-display-list, r=pcwalton
When this option is enabled, the layout task will print an error when
display list items draw outside their owning Flow's position rect. This
will make it easier to detect layout errors before they break rendering.

This is a command-line option for the moment, because we violate this
rule quite a bit still. Once all bugs causing this are fixed, we can be
more aggressive about enabling the option.
2014-10-21 17:51:43 -06:00
bors-servo
3936d14260 auto merge of #3746 : mrobinson/servo/debug-fragment-borders, r=pcwalton
This is quite a bit cleaner than abusing the rust debug functionality.
If we start collecting too many debugging options in the servo
executable we could opt to organize them into a single option.

Fixes #2263.
2014-10-21 17:06:40 -06:00
Clark Gaebel
b31f9e0188 properly incrementally set block size 2014-10-21 14:26:22 -07:00
bors-servo
2bc4ffe5cf auto merge of #3744 : cgaebel/servo/efficient-preorder-traversal, r=pcwalton
This also tackles some nearby FIXMEs. `traverse_preorder` is used in a LOT of
DOM functions..

r? @pcwalton
2014-10-21 13:09:38 -06:00
bors-servo
018146b1a8 auto merge of #3728 : cgaebel/servo/dump-flow-tree-with-println, r=mrobinson
r? @mrobinson
2014-10-21 11:27:40 -06:00
Clark Gaebel
a5bb2f299f more efficient preorder DOM traversals 2014-10-21 10:01:15 -07:00
Martin Robinson
2d5168a1e5 Add an option to show debug fragment borders
This is quite a bit cleaner than abusing the rust debug functionality.
If we start collecting too many debugging options in the servo
executable we could opt to organize them into a single option.

Fixes #2263.
2014-10-21 08:49:25 -07:00
Martin Robinson
adecdbd4cf Add an option to validate display list items
When this option is enabled, the layout task will print an error when
display list items draw outside their owning Flow's position rect. This
will make it easier to detect layout errors before they break rendering.

This is a command-line option for the moment, because we violate this
rule quite a bit still. Once all bugs causing this are fixed, we can be
more aggressive about enabling the option.
2014-10-21 08:47:40 -07:00
Patrick Walton
e9a61c1ccf layout: Don't destroy the flow tree when resizing the window 2014-10-20 22:05:38 -07:00
Patrick Walton
bb6f557276 layout: Rewrite text and inline fragment handling during flow
construction to avoid cloning and moving flows so much.

Besides amounting to a 5%-10% win on a page with a lot of text, this
simplifies and refactors the text layout code.
2014-10-20 22:05:38 -07:00
Clark Gaebel
174975061e Dump the flow tree with println, instead of error 2014-10-20 11:14:03 -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