Commit graph

3647 commits

Author SHA1 Message Date
Ms2ger
e64ee3557e Pass a Namespace to Element::get_attribute. 2013-12-23 12:21:18 +01:00
bors-servo
acdc0e1afa auto merge of #1436 : SimonSapin/servo/font-size-em, r=kmcallister
Font-based units in the font-size property refer to the font-size of the parent, not itself.
2013-12-20 15:31:06 -08:00
Simon Sapin
7049f2b165 Add a test for percentages in font-size 2013-12-20 17:01:28 +01:00
bors-servo
34746fe974 auto merge of #1431 : brunoabinader/servo/document-body, r=jdm
Implement Document's 'body' attribute (getter and setter). Proper
implementation of setter requires Node::ReplaceChild(), which is
currently a stub and will be done on a later step.

This patch is for:
https://github.com/mozilla/servo/issues/1428
2013-12-20 07:28:07 -08:00
Bruno de Oliveira Abinader
ce434dfb3e Implement Document's 'body' attribute
Implement Document's 'body' attribute (getter and setter). Proper
implementation of setter requires Node::ReplaceChild(), which is
currently a stub and will be done on a later step.

This patch is for:
https://github.com/mozilla/servo/issues/1428
2013-12-20 10:58:03 -04:00
Simon Sapin
2c179cdce3 Fix #1435: em units in font-size
Font-based units in the font-size property refer to the font-size
of the parent, not itself.
2013-12-20 13:01:13 +01:00
bors-servo
824c7ac613 auto merge of #1424 : pcwalton/servo/harden-layout, r=pcwalton
This changeset gets rid of the `FooView` phantom type in favor of a more brute force approach that just whitelists methods that layout is allowed to call. The set is surprisingly small now that layout isn't going to the DOM for much.

If this approach turns out not to scale, we can do something fancier, but I'd rather just have it be safe and secure first and then refactor later for programmer happiness.

r? @kmcallister
2013-12-17 18:16:05 -08:00
Patrick Walton
436b1e891d script: Eliminate the phantom type in Node, as it is no longer needed
for enforcing layout memory safety.
2013-12-17 18:07:41 -08:00
Patrick Walton
8f886e599e layout: Stop exposing raw Element types to layout as well.
This should make layout memory-safe as is, though we will need to do
more stuff for incremental reflow and parallelism.
2013-12-17 18:07:41 -08: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
bors-servo
da4cff034b auto merge of #1429 : pradeep90/servo/master, r=pcwalton
The problems that were caused because of Yellow River seem to be fixed.

(See #1319).
2013-12-17 17:13:07 -08:00
S Pradeep Kumar
f9c7c485ea Re-enable parallel selector matching.
The problems that were caused because of Yellow River seem to be fixed.

(See #1319).
2013-12-18 09:55:28 +09:00
bors-servo
d4fcbf5e1d auto merge of #1425 : saneyuki/servo/compositor, r=metajack
Related: #1351.
2013-12-17 14:56:24 -08:00
bors-servo
e4495453c8 auto merge of #1422 : pcwalton/servo/less-generic-trees, r=metajack
r? @metajack
2013-12-17 13:49:17 -08:00
Patrick Walton
199ca33b72 script: Make trees less generic 2013-12-17 13:46:14 -08:00
bors-servo
44a8b0987c auto merge of #1427 : brunoabinader/servo/is-in-doc, r=jdm
Added a flags variable inside Node to represent boolean flags, with
is_in_doc being the first of them. It is updated whenever a node is
appended or removed from a parent.

This patch is for:
https://github.com/mozilla/servo/issues/1030
2013-12-17 12:41:10 -08:00
Bruno de Oliveira Abinader
cfb73ed123 Make Node::is_in_doc O(1)
Added a flags variable inside Node to represent boolean flags, with
is_in_doc being the first of them. It is updated whenever a node is
appended or removed from a parent.

This patch is for:
https://github.com/mozilla/servo/issues/1030
2013-12-17 16:32:43 -04:00
bors-servo
0e14745762 auto merge of #1426 : pcwalton/servo/opaque-node-range, r=larsbergstrom
These were stored in inline flows. This was caught by my WIP changes to
harden layout (yay for Rust!)

r? @larsbergstrom
2013-12-17 10:01:21 -08:00
Patrick Walton
423f5b8540 layout: Make NodeRange use OpaqueNode for memory safety.
These were stored in inline flows. This was caught by my WIP changes to
harden layout (yay for Rust!)
2013-12-17 09:54:28 -08:00
bors-servo
45c092cea4 auto merge of #1377 : SimonSapin/servo/encoding, r=kmcallister
Depends on https://github.com/mozilla-servo/rust-cssparser/pull/33 being merged.

Also (unrelated) pass around a base URL for stylesheets.

Adds a new dependency:
Upstream: https://github.com/lifthrasiir/rust-encoding
Servo’s fork: https://github.com/mozilla-servo/rust-encoding

As of this writing, upstream’s master branch targets Rust 0.8, and its rust-0.9-pre branch targets Rust master. Servo uses a Rust version in-between those. I pushed a rust-servo branch to our fork that backports from rust-0.9-pre, and also included some changes that have yet to be merged in upstream pull requests.
2013-12-17 09:04:28 -08:00
Simon Sapin
c4c332b234 Remove the bootstrap.css test. It’s not actually useful. 2013-12-17 17:55:42 +01:00
Tetsuharu OHZEKI
369c5b8329 Rename compositor files. 2013-12-17 20:44:58 +09:00
Tetsuharu OHZEKI
45b297bd0b Rename main/compositing/mod.rs to main/compositing/compositor_task.rs. 2013-12-17 20:20:24 +09:00
Tetsuharu OHZEKI
56ba7fc343 Introduce 'NullCompositor'. 2013-12-17 20:06:05 +09:00
Tetsuharu OHZEKI
513ff0259a Remove the needless comment. 2013-12-17 19:53:53 +09:00
bors-servo
ad7f3a95d4 auto merge of #1410 : pcwalton/servo/opaque-node, r=pcwalton
This shuts off all layout access to the DOM after flow tree construction, which will allow us to run script concurrently with layout during reflow and display list construction—even without the COW DOM. It also gets us closer to making `AbstractNode` noncopyable, which is important for safety because the JS GC will not trace layout.

r? @kmcallister
2013-12-16 15:25:12 -08:00
Patrick Walton
89af9017ef layout: Replace AbstractNodes in layout with OpaqueNode, preventing
DOM access during reflow.
2013-12-16 15:17:15 -08:00
Patrick Walton
550c370c4f layout: Change a couple of Box::new calls that accessed the nodes into
`Box::transform`.
2013-12-16 15:02:15 -08:00
Patrick Walton
b39861bf34 layout: Stop going to the DOM for vertical align font sizing. 2013-12-16 15:02:15 -08:00
Patrick Walton
5b685bc1bd layout: Stop going to the DOM for text alignment.
Verified against the existing text alignment reftests.
2013-12-16 15:02:15 -08:00
Patrick Walton
6be8482eef layout: Stop going to the DOM to guess width. 2013-12-16 15:02:15 -08:00
bors-servo
9aeb1fb475 auto merge of #1420 : saneyuki/servo/compositor, r=pcwalton
This change compositor code to objective, short scope, reducing closure functions. It will increase maintainability.

Related: #1351.
2013-12-16 15:01:17 -08:00
Tetsuharu OHZEKI
cba47ba740 Introduce 'IOCompositor' to clean up compositor code. 2013-12-17 04:34:15 +09:00
Tetsuharu OHZEKI
8487c02a39 Pass parameters directly to 'run_compositor()'. 2013-12-17 03:45:10 +09:00
bors-servo
1593d2f695 auto merge of #1407 : ibnc/servo/positioned_box_offsets, r=metajack
For #1406

Not really sure about some of my naming conventions, but offset was kinda taken in box.rs :/

Also this doesn't fully implement the offsets, but I'll do that alongside #782.
2013-12-16 10:01:14 -08:00
Isabelle Carter
708bf471d0 Added recognition of positioned offsets
top, bottom, right, and left
2013-12-16 11:53:10 -06:00
bors-servo
01e4ac5266 auto merge of #1419 : saneyuki/servo/create, r=pcwalton
This hide initializing steps of `CompositorTask` to make it easy to handle variables which related to compositor code.

Related: #1351.
2013-12-16 08:19:17 -08:00
Tetsuharu OHZEKI
43b3d7bcfe Add CompositorTask::create() to initialize and start CompositorTask. 2013-12-16 20:38:25 +09:00
bors-servo
5302d870f4 auto merge of #1418 : dhedlund/servo/composite_when_ready, r=pcwalton
The rendergl::render_scene() function is being called more often than it needs to be, sometimes before the renderer has finished.  This could result in PNG images that are drawn before the frame trees set in SetIds is rendered.
2013-12-16 00:10:18 -08:00
Daniel Hedlund
16b5afb1b5 Track whether first render has run, not whether it's currently idle 2013-12-15 16:08:30 -08:00
Daniel Hedlund
1aed7a390e Add comments and improve performance of a comparison 2013-12-15 15:52:52 -08:00
bors-servo
a31535a46e auto merge of #1411 : dhedlund/servo/_1097_2, r=pcwalton
Pipeline now blocks on `Pipeline.exit()` and waits for confirmation that RenderTask and LayoutTask were successfully destructed (they're created inside a block which ensures they go out of scope before the message is sent.

Other notable changes include:
* The blocking recv in main/servo.rc that waits for a constellation exit confirmation was moved out of the spawn and into the main thread.  `Constellation::start()` spawns a new task, so there's no need to block in that task once the ExitMsg is sent off.

* Application initialization was moved out of `run_compositor` and into `CompositorTask`, so it could be stored with the compositor task and not go out of scope until the program's main block finishes.

I had to use SharedPort<()> objects to work around the fact that pipelines get cloned, even though it feels like pipelines should probably be ref counted instead.  I went down that route for a few hours but got bogged down trying to wrap my head around some region/lifetime issues; I would be happy to work on that part again, but would need some mentoring to help me figure out what I was doing wrong and possibly why.  The current solution doesn't feel too bad though.

Fixes #1097.
2013-12-15 15:28:17 -08:00
Daniel Hedlund
e7a591a7e1 Ensure render and layout tasks get destructed before main thread finishes
Fixes #1097.
2013-12-15 14:25:41 -08:00
Daniel Hedlund
a9af374942 Don't perform composite unless renderer has indicated it's idle
The rendergl::render_scene() function is being called more often than
it needs to be, sometimes before the renderer has finished.  This
could result in PNG images that are drawn before the frame trees set
in SetIds is rendered.
2013-12-15 13:38:25 -08:00
bors-servo
44404766da auto merge of #1413 : dhedlund/servo/png_color_type, r=pcwalton
This should fix images produced by the -o flag.

The gl2::read_pixels call was asking for pixel data in RGB8 but was then telling the PNG encoder that the data was RGBA8.  The value was originally set correctly, but was changed when support was added for drawing transparent PNGs.

We could instead adjust the gl2::read_pixels call to return RGBA8 so we can write transparent screenshots, but I'm not sure if there's a use case for that.
2013-12-15 12:10:18 -08:00
bors-servo
6eb3f9241f auto merge of #1393 : pcwalton/servo/optimize-css, r=pcwalton
This is a 27% improvement in CSS selector matching performance.

r? @SimonSapin
2013-12-15 11:49:24 -08:00
Patrick Walton
a5f16f5bbc style: Reduce allocations in selector matching.
This is a 27% improvement in CSS selector matching performance.
2013-12-15 11:35:19 -08:00