Commit graph

54 commits

Author SHA1 Message Date
Tetsuharu OHZEKI
0fccf5e386 Split TCast::to into TCast::to_unchecked and TCast::to. 2014-03-20 23:41:59 +09:00
Lars Bergstrom
bbac8aa5c3 Rust upgrades 2014-03-18 09:30:35 -05:00
S Pradeep Kumar
070be51910 Implement position: absolute for replaced elements.
Add reftests for replaced and nested absolute flows.
2014-03-04 11:08:46 +09:00
S Pradeep Kumar
75f1142107 Implement mini-traversal for absolute flow assign-height.
This only traverses absolute flows, nothing else.

+ Also, a separate mini-traversal for store overflow.
+ Store descendants with position 'absolute' and 'fixed' in BaseFlow.
+ Bubble up links to absolute and fixed descendants during Flow Construction.
+ Set Rawlink to the CB in absolute descendants.
+ store_overflow() now uses absolute descendants' overflows too.
+ Add reftests for 'absolute' and 'fixed' static y position.
+ Add reftests for overflow (they all fail now).
+ Put absolute flow display items under their CB's ClipDisplayItem.
+ Paint borders in Box_ before the actual box stuff (minor fix in lieu of paint-order).
2014-03-03 16:12:45 +09:00
S Pradeep Kumar
c4d177a354 Implement position: absolute for non-replaced elements.
+ Re-implement fixed positioning using the absolute positioning code.
+ Add reftests for absolute positioning and fixed positioning.
+ Refactor assign_widths in BlockFlow to isolate the calculation of
widths and margins.
+ Pass down details of the Containing Block for absolute and fixed flows
during layout. Use it to calculate the static position of absolute flows.
+ Defer calculation of absolute flow dimensions till we build the
display list.
2014-03-03 11:27:49 +09:00
bors-servo
021d32368d auto merge of #1781 : hgentry/servo/mozilla-servo, r=metajack
Simple change. I hope I'm using github correctly; I'm not too familiar with the PR system. Fixes #1777.
2014-02-28 11:37:40 -05:00
hgentry
39e571ae4e Renamed HTMLIframeElementTypeId to HTMLIFrameElementTypeId 2014-02-27 15:35:27 -05:00
Patrick Walton
014cf702e4 layout: Rewrite the float context.
This rewrites the float context to avoid dynamic failures resulting from
`.clone()` misuse. It also renames the float context to the simpler
`Floats`. The new version is modeled on WebKit's `FloatingObjects`.
2014-02-26 20:37:20 -08:00
Patrick Walton
282bd1d031 layout: Construct flows in parallel, without a leaf set 2014-02-24 18:12:44 -08:00
Ms2ger
870ccd95d2 Remove DocumentTypeId. 2014-02-24 22:35:28 +01:00
Josh Matthews
625325434b Implement JSManaged for DOM objects. 2014-02-24 15:16:42 -05:00
Junyoung Cho
ab589403ed Fix: whitespace is considered as spaces(U+0020), tabs(U+0009), and line breaks(U+000D U+000A) 2014-02-21 21:20:48 +09:00
Junyoung Cho
327e1e20a9 Prevent '&nbsp' from stripping as whitespace 2014-02-21 17:30:15 +09:00
Youngmin Yoo
13f9a66632 Impl Basic support for object element 2014-02-20 17:31:16 +09:00
Adam Sinnett
ffcd3833de Change Text, Comment and ProcessingInstructions parent name from element to characterdata
All other node's parent type names reflect the actual type of the parent. This change extends that convention to the indicated nodes.

closes #1594
2014-02-15 13:52:33 -08:00
Patrick Walton
1678cc9a88 layout: Implement basic style sharing.
No improvement on the rainbow page, but necessary for some other
optimizations we want to do.
2014-02-14 17:37:50 -08:00
Patrick Walton
758f5ba755 style: Separate out style structs into inherited and initial structs.
This doesn't make much of a difference in performance, but will be
necessary for style struct sharing.
2014-02-14 17:37:12 -08:00
Bruno de Oliveira Abinader
aa4b5bb948 Implement ProcessingInstruction DOM interface
Spec:
http://dom.spec.whatwg.org/#interface-processinginstruction

Closes #1619.
2014-02-06 14:41:55 -04:00
Patrick Walton
18c025a8ed layout: Lazily create boxes for whitespace, speculating that they won't
be needed.

33% win in flow construction on the rainbow page.
2014-02-06 09:34:14 -08:00
Patrick Walton
d34ebf521d layout: Refactor flow construction to move around large structs less.
5% perf win, and a net loss in lines of code.
2014-02-04 23:09:14 -08:00
Patrick Walton
17eea6bb45 layout: Enforce that flow construction is thread-safe.
Closes #1584.
2014-01-31 17:54:13 -08:00
Patrick Walton
a8e35fbeac layout: Use the concurrent hash map for the leaf sets.
64% improvement in style recalc.
2014-01-30 15:11:35 -08:00
Patrick Walton
b27f4a8969 layout: Introduce a DOM leaf set as a prerequisite for parallel flow
construction.

This will be very slow until we have the concurrent hash table, but we
might as well get it in.
2014-01-29 21:05:50 -08:00
Patrick Walton
e579daefc2 layout: Stop adding flows to the leaf set that are obviously never going
to be leaves.

60% improvement in flow tree construction time on the rainbow page.
2014-01-29 15:01:26 -08:00
patrick kim
c2ced790ba implement inline border 2014-01-27 12:45:23 +09:00
Patrick Walton
18a2050a64 layout: Port parallel layout over to a generic "work queue"
infrastructure.

The work queue accepts abstract generic "work units", which in this case
are layout operations. The same speedups have been observed.
2014-01-24 20:50:30 -08:00
Patrick Walton
5cc744d25d layout: Destroy flows properly under display: none.
Fixes a crash on http://en.wikipedia.org/wiki/South_China_Sea

It plants a destructor bomb on flows so that this can't happen again.
2014-01-24 10:37:46 -08:00
patrick kim
815d222e00 change position of setting inline_data for "<span>asdf<div>b</div></span>" case 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
Isabelle Carter
084c7fb734 Position fixed displays out of normal flow. 2014-01-16 15:14:55 -06:00
Isabelle Carter
f58fd54875 Flagging of blocks as fixed displays 2014-01-16 15:00:28 -06:00
patrick kim
6364103d29 some refactor & add comment 2014-01-16 09:34:38 +09:00
patrick kim
25a3da6180 initial implement for inline background 2014-01-15 13:39:33 +09:00
Patrick Walton
ff213b6ad7 layout: Rename FlowData to BaseFlow to match other types 2014-01-13 14:13:14 -08:00
Jack Moffitt
a7ef1cd35e Upgrade to latest Rust. 2014-01-12 19:45:45 -07:00
Patrick Walton
9e2b63ddd3 layout: Move the LayoutNode wrapper from script into layout. 2013-12-17 18:07:41 -08:00
Patrick Walton
c506e52c7c layout: Add a lifetime to LayoutNode to prevent layout from stuffing
them into evil places.
2013-12-17 18:07:41 -08:00
Patrick Walton
ee9873bdb5 script: Harden layout a bit more by mostly prohibiting it from seeing
`AbstractNode` at all.

It can still see it by calling `with_element` for now, although that
needs to be fixed.
2013-12-17 18:07:12 -08:00
Patrick Walton
be69a503fe script: Eliminate the phantom type in favor of just whitelisting methods
that layout can safely call.

This is simpler. Currently, the set of methods is not safe, but I plan
to lock it down more soon.
2013-12-17 18:07:12 -08:00
Patrick Walton
199ca33b72 script: Make trees less generic 2013-12-17 13:46:14 -08:00
Patrick Walton
971f77d2c6 layout: Stop going to the DOM for iframe sizes 2013-12-13 15:10:04 -08:00
Patrick Walton
dc8504fd12 layout: Store image dimensions inside image boxes instead of going to
the DOM for them.
2013-12-12 17:51:31 -08:00
Patrick Walton
4c8383c38b layout: Reference count ComputedValues structures like Gecko does.
This has no difference in CSS selector matching performance and results
in a 31% speedup in constraint solving on the rainbow page.
2013-12-12 14:44:24 -08:00
Patrick Walton
dcacab8149 layout: Don't delete non-text boxes from the list of input boxes when
flushing text clumps. Fixes this page:

    http://en.wikipedia.org/wiki/Yellow_River

This is not the most efficient thing to do; a FIXME has been added
noting what is most correct.
2013-12-11 14:35:13 -08:00
patrick kim
0026eb0899 remove @ in LayoutTask.FontContext 2013-12-11 11:42:14 +09:00
Patrick Walton
1ba71432ee layout: Change ~Box to Box.
63% improvement in box building on the rainbow page.
2013-12-10 18:00:38 -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
patrick kim
f187035e25 remove @ in LayoutTask.FontContext 2013-12-10 08:59:43 +09:00
Keegan McAllister
dda6d2b53c Convert LayoutContext.image_cache from @mut to MutexArc
LocalImageCache isn't Freeze so we have to use unsafe_access,
which exists for MutexArc and not RWArc.
2013-12-06 11:31:49 -08:00