Commit graph

173 commits

Author SHA1 Message Date
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
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
Patrick Walton
a6fcec468f layout: Remove FontStyle in favor of using the font style struct
directly, and optimize `get_layout_font_group()` to use a small vector.

Seems to be a 38% layout win on a site I tested with a lot of text.
2014-10-15 22:17:57 -07:00
bors-servo
f3066c70da auto merge of #3689 : cgaebel/servo/working-incremental-flow-construction, r=pcwalton
This implements fragment merging, in order to incrementally reflow linebroken
text. This makes the `whitespace_pre.html` reftest pass with incremental reflow
turned on with `-i`.
2014-10-15 21:27:20 -06: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
481adcd654 Fix whitespace_pre with incremental reflow turned on.
This implements fragment merging, in order to incrementally reflow linebroken
text. This makes the `whitespace_pre.html` reftest pass with incremental reflow
turned on with `-i`.
2014-10-15 16:04:21 -07: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
Tetsuharu OHZEKI
fb98384fa5 Use DOMRefCell<T> in Element. 2014-10-15 13:44:02 +09:00
bors-servo
f1c050531f auto merge of #3655 : kaseyc/servo/add_to_js_method, r=jdm
Replace the manual checks and calls to transmute_copy in /layout/wrapper.rs with calls to to_js/

Fixes #3616
2014-10-14 22:00:28 -06:00
Kasey Carrothers
6d91e92c90 Add a to_js method to the casting trait code in CodegenRust.py
Replace the manual checks and calls to transmute_copy in /layout/wrapper.rs with calls to to_js

Fixes #3616
2014-10-14 19:06:53 -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
Patrick Walton
c7e619dfe7 layout: Rewrite intrinsic inline-size and automatic table layout to
match L. David Baron's work-in-progress specification.

    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.
2014-10-14 14:17:57 -07:00
Patrick Walton
5f8d3f72d8 layout: Introduce support for legacy presentational attributes to selector
matching, and use it for `<input size>` and `<td width>`.

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.
2014-10-14 12:44:09 -07:00
bors-servo
8077edc062 auto merge of #3623 : pcwalton/servo/use-atoms-2, r=jdm
75% improvement in style recalc for Guardians of the Galaxy.
2014-10-14 12:42:35 -06: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
Patrick Walton
ee2ccc4f87 script: Use atom comparison in more places, especially for attributes.
75% improvement in style recalc for Guardians of the Galaxy.
2014-10-14 10:32:40 -07:00
bors-servo
834df4e211 auto merge of #3673 : mrobinson/servo/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.
2014-10-14 04:51:35 -06:00
Ms2ger
16e071168c Don't borrow CharacterData.data from layout.
This should fix the most frequent intermittent wpt failure.
2014-10-14 10:49:33 +02:00
bors-servo
fd70b366ae auto merge of #3654 : pcwalton/servo/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
2014-10-14 00:42:35 -06:00
Glenn Watson
1827852810 Add support for local font faces. Improves fonts on rust lang and guide. 2014-10-14 15:59:08 +10:00
Patrick Walton
5351c8572f Merge pull request #3674 from glennw/remove-println
Change accidental println to debug macro.
2014-10-13 22:39:15 -07:00