Commit graph

53 commits

Author SHA1 Message Date
Brendan Zabarauskas
9dd533ce01 Add character index type
This is more self-documenting and may highlight errors in the future.
2014-05-12 14:21:42 -07:00
Brendan Zabarauskas
97bbaa6ef9 Require Range<T> to have a signed integer T
This allows for generic +ve/-ve offsets
2014-05-07 15:06:41 -07:00
Brendan Zabarauskas
8c6eb08dcb Make range generic 2014-05-07 15:05:59 -07:00
bors-servo
c872764a7c auto merge of #2356 : glennw/servo/warnings, r=jdm 2014-05-07 01:16:22 -04:00
Glenn Watson
b61d2328e2 Fix a few mutability warnings 2014-05-07 14:59:19 +10:00
bors-servo
38bf7fd098 auto merge of #2336 : bjz/servo/debug_str, r=pcwalton 2014-05-06 23:37:35 -04:00
bors-servo
22c6060921 auto merge of #2304 : Manishearth/servo/deadcode, r=metajack
The code was added as a debugging method [here](5663ca1eef), it's no longer used
2014-05-06 19:21:22 -04:00
Brendan Zabarauskas
61b7a38295 Use fmt::Show for outputting debug information 2014-05-06 10:01:48 -07:00
Brendan Zabarauskas
42bf406411 Replace most of the SmallVec0 usages with std::vec::Vec
We can't replace the ones in the `style` crate because some functions expect generic `SmallVec`s.
2014-05-05 16:59:12 -07:00
Ms2ger
243814022e Replace all ~"" with "".to_owned(). 2014-05-03 22:17:45 +02:00
Manish Goregaokar
dbf65aee3c Remove dead code 2014-05-03 21:34:31 +05:30
Patrick Walton
81f5da9dd8 layout: Rewrite display list building to be parallel and to handle
overflow correctly, and opportunistically lay out blocks in parallel
even if floats are present.

This commit fixes the `inline-height-test` in Acid2 by implementing
proper overflow as well as the inline "strut".  (See CSS 2.1 § 10.8.1.)
Acid2 was accidentally being rendered properly before because tables'
descendant flows were not being laid out properly.

Display list building is now parallel and is done by bubbling up display
items and layers from parent to child. Speedups of around 60%-70% are
observed on Wikipedia with a 4-core HyperThreaded Core i7.  More
optimizations are possible; this is just a start.

To minimize the amount of data that needs to be bubbled up, as well as
to make proper handling of `overflow: hidden` clipping easier, the
`StackingContext` abstraction is now purely internal to the display
list.  That is, instead of placing items into a stacking context
directly, display items are placed into display lists alongside a
stacking level.  When a stacking context is complete, it is flattened
with the the `flatten` method, which shuffles the display items that
make up the context into their proper order while handling clipping
properly.
2014-05-02 16:07:42 -07:00
Patrick Walton
27276c0305 layout: Re-enable parallel layout by removing all RefCell instances
from `Flow`s; in the process, remove `InlineInfo` in favor of the
range-based design that was originally planned and halfway implemented.

Now, the DOM tree structure for inline flows is reflected not by a
series of arrays but instead by a flat list of ranges into the list of
boxes. As part of this, the `border` and `padding` fields, which were
incorrect in the case of inlines and necessitated separate
`noncontent_inline_foo` methods, have been merged into a single
`border_padding` field that is always guaranteed to be correct after
width assignment, even for inlines.
2014-05-02 11:47:08 -07:00
Lars Bergstrom
948daf2422 This batch of changes upgrades Servo to work with the Rust upgrade as of
April 10, 2014. The main changes are to privacy, to work around the
issues with incorrect bounds on the libstd `Arc<Mutex<T>>`, and the
various API changes strewn throughout the libraries.
2014-04-27 15:46:12 -05:00
Ms2ger
31eee791dd Upgrade rust. 2014-04-04 20:10:32 +02:00
Patrick Walton
c49f23ffb2 layout: Address review feedback. 2014-04-03 14:51:18 -07:00
Patrick Walton
cd9d824c21 servo: Implement stacking contexts and allow multiple layers per
pipeline. This handles fixed positioning mostly correctly.
2014-04-03 14:50:56 -07:00
Lars Bergstrom
bbac8aa5c3 Rust upgrades 2014-03-18 09:30:35 -05:00
Sankha Narayan Guria
4c18428d19 Create a Line DisplayItem 2014-02-22 19:02:01 +05:30
Isabelle Carter
0892fada74 Multiple display list support 2014-01-30 17:11:17 -06:00
bors-servo
b28d08b4bc auto merge of #1529 : ibnc/servo/display_list_debug, r=metajack 2014-01-23 16:55:26 -08:00
Isabelle Carter
5663ca1eef Dumping display list levels to rust log 2014-01-23 12:06:54 -08:00
patrick kim
b0380ae96a fix text-decoration property in layout 2014-01-23 09:51:08 +09:00
Patrick Walton
54f0f17f83 layout: Implement parallel reflow for the bubble-widths and
assign-heights phases.

This uses the new work-stealing deque. By default, 3/4 of a thread per
logical CPU is used. This can be tuned with the `-y` flag.

I measured a 65% reflow speedup on `perf-rainbow.html` and a 247% reflow
speedup on `http://en.wikipedia.org/wiki/South_China_Sea` on a 4-core
HyperThreaded Core i7. However, numbers were fairly volatile, especially
for the latter.
2014-01-22 15:59:21 -08:00
Jack Moffitt
a7ef1cd35e Upgrade to latest Rust. 2014-01-12 19:45:45 -07:00
Patrick Walton
a2e91d242b layout: Perform text decoration propagation per CSS 2.1 § 16.3.1 without
going to the DOM.
2013-12-12 17:54:51 -08:00
Ryan Choi
d26bf36833 removing @ from flowtree. (but cloning boxes when creating a display list) 2013-12-10 13:44:20 +09:00
Patrick Walton
30bbaa49b7 Revert "auto merge of #1356 : ksh8281/servo/remove_@_in_LayoutTask.FontContext, r=pcwalton"
This reverts commit e8ffac13d7, reversing
changes made to db923feffe.

Reverting this change because FreeType is *not* thread safe. See the
documentation here:

http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html

"In multi-threaded applications, make sure that the same FT_Library
object or any of its children doesn't get accessed in parallel."

We will need to use a `MutexArc` instead.
2013-12-09 19:40:08 -08:00
bors-servo
e8ffac13d7 auto merge of #1356 : ksh8281/servo/remove_@_in_LayoutTask.FontContext, r=pcwalton
Remove @ in LayoutTask.FontContext, ScannedTextBox.text_run
#1334
2013-12-09 19:13:45 -08:00
Patrick Walton
64222f5772 layout: Remove DisplayBoxes to save memory and as one step toward an
`@`-free layout
2013-12-09 18:16:06 -08:00
patrick kim
2865ab4e29 remove @ from ScannedTextBox.run 2013-12-10 08:59:43 +09:00
patrick kim
86e2cac8e8 fix indent & some code 2013-12-07 09:52:54 +09:00
patrick kim
1b8f9c09d3 remove @ fontcontext 2013-12-07 09:52:54 +09:00
patrick kim
964b5e9d9a remove SendableTextRun & remove @mut Font From TextRun&Shaper(Font),Font.shaper,
fontfamily,fontgroup,render_context.font_ctx
2013-12-07 09:52:06 +09:00
sh8281.kim
af80c57029 modify to displaylist to tree & add cliping 2013-11-26 11:49:44 +09:00
Keegan McAllister
e2b7885b73 fmt! -> format! 2013-10-31 14:58:55 -06:00
Seo Sanghyeon
b2431912d3 Use the new style system
Credits to:
    Deokjin Kim
    Ilyong Cho
    Jaeman Park
    Junyoung Cho
    Ryan Choi
    Sangeun Kim
    Yongjin Kim
    Youngmin Yoo
    Youngsoo Son
2013-10-23 16:49:35 +09:00
Simon Sapin
a325905fa6 Move the gfx::geometry module to servo_util::geometry.
This is part of #1006, in order to use Au from the script crate
without introducing a circular crate dependency.
2013-10-16 14:55:07 +01:00
Junyoung Cho
4d719df5e9 Implement the rest of 'text-decoration' property. 2013-09-13 17:48:43 +09:00
Sangeun Kim
03fb29e066 Add style field to render them in RenderContext 2013-09-10 10:35:44 +09:00
Sangeun Kim
0e863b3cef Implement asymmetric border colors 2013-08-20 10:01:39 +09:00
Keegan McAllister
a2d9810b69 Update Rust version again
This gets us the new runtime.
2013-08-15 13:56:29 -07:00
Keegan McAllister
307f1074d3 For loops and misc changes 2013-08-15 13:56:29 -07:00
Keegan McAllister
be061a9aa0 Library changes 2013-08-15 13:55:40 -07:00
Jack Moffitt
86785d18f4 Implement asymmetric border widths. 2013-08-06 21:03:57 -06:00
Jack Moffitt
870db39836 Update to latest Rust. 2013-07-09 14:37:53 -06:00
Brian Anderson
56e5ba1b82 Update for language changes 2013-06-26 13:44:26 -07:00
Jack Moffitt
ece8791c26 Warning police. 2013-06-17 15:10:41 -06:00
Patrick Walton
f77eef5988 Basic hit testing functionality 2013-05-30 17:28:08 -07:00
Tim Kuehn
ea1a406589 base and bounds methods for DisplayItem 2013-05-30 17:11:59 -07:00