Commit graph

5232 commits

Author SHA1 Message Date
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
bors-servo
b81749bee3 auto merge of #1415 : dhedlund/servo/constellation_deadlock, r=pcwalton
Constellation blocks on SetId by sending a Port through the compositor channel and waits for a response.  If the compositor is in the process of shutting down, it will not look in the queue again.  The compositor requires the constellation to be shut down first, so it sends a message to shut down and blocks until the constellation finishes, deadlocking.

Only very short lived executions would've been likely to see this deadlock.

_It is technically still possible to trigger a SetId message between when the compositor finishes running and when the constellation shuts down, but the window for exposure is greatly reduced.  I've only seen it with "-o" so far._
2013-12-15 11:25:26 -08:00
Daniel Hedlund
183c387d8b Drain compositor_chan on shutdown, causes deadlocks on constellation
Constellation blocks on SetId by sending a Port through the compositor
channel and waits for a response.  If the compositor is in the process of
shutting down, it will not look in the queue again.  The compositor
requires the constellation to be shut down first, so it sends a message
to shut down and blocks until the constellation finishes, deadlocking.

Only very short lived executions would've been likely to see this deadlock.
2013-12-14 21:57:32 -08:00
bors-servo
8c3c547c07 auto merge of #1414 : dhedlund/servo/issue_941, r=larsbergstrom
Moving another window on top of servo window, or switching screen would result in a blank window until the app was resized.  This was due to a missing glfw callback.

Fixes #941.
2013-12-14 17:13:26 -08:00
Daniel Hedlund
c44001b64c Add glfw window_refresh_callback, windows now redraw on linux
Fixes #941.
2013-12-14 16:08:58 -08:00
Daniel Hedlund
608cd612df Adjust PNG encoder color type to match what's read from gl2
This should fix images produced by the -o flag.
2013-12-14 15:06:02 -08:00
Patrick Walton
10150b0ec5 script: Don't do anything before the window size comes in.
This fixes the `getBoundingClientRect()` content test.
2013-12-13 18:35:48 -08:00
bors-servo
c5d81f13c1 auto merge of #1388 : hyunjunekim/servo/cssissues, r=kmcallister
Fixed this issue ( https://github.com/mozilla/rust/issues/10683 )
2013-12-13 15:40:13 -08:00
bors-servo
a9980b992c auto merge of #1408 : pcwalton/servo/stop-going-to-dom-for-iframes, r=larsbergstrom
r? @larsbergstrom
2013-12-13 15:19:16 -08:00
Patrick Walton
971f77d2c6 layout: Stop going to the DOM for iframe sizes 2013-12-13 15:10:04 -08:00
bors-servo
aa1ebbbdb0 auto merge of #1405 : pcwalton/servo/defuture, r=larsbergstrom
This will allow us to stop going to the DOM in order to handle iframe
sizing. Instead we can just store the pipeline and frame IDs of iframes
inside the flow tree itself.

r? @kmcallister
2013-12-13 11:28:10 -08:00
Patrick Walton
21e8c72a75 constellation: Stop using futures for frame sizes.
This will allow us to stop going to the DOM in order to handle iframe
sizing. Instead we can just store the pipeline and frame IDs of iframes
inside the flow tree itself.
2013-12-13 10:43:27 -08:00
bors-servo
499aa97fa4 auto merge of #1403 : Ms2ger/servo/exec, r=metajack 2013-12-13 09:40:26 -08:00
Ms2ger
9e2af4aae1 Mark some rust files as non-executable. 2013-12-13 18:34:57 +01:00
bors-servo
c67669fe73 auto merge of #1349 : dhedlund/servo/issue_222, r=jdm,me
Fixes #222.

Implements 'text-align' inheritance for inline elements.  The text alignment code has been changed a couple of times since the ticket was originally opened and was improved to inherit the text-align property from from an ancestor element.  This addressed the issue, so long as no inline elements had a text-align property defined.  Both Firefox and Chromium ignore any text-align properties attached to inline elements, but none of the specs are explicit about ignoring the property or inheriting only from non-inline elements:
http://www.w3.org/TR/CSS2/visuren.html#inline-formatting
http://www.w3.org/TR/CSS2/text.html#propdef-text-align

This is my first stab at writing any code that touches the DOM node tree.  Based on a few observations, I made the assumption that the `self.base.node` of a InlineFlow always corresponds to a BlockFlow-based node, no matter how deep inline DOM elements are nested; there was no obvious way to traverse Flow-traited objects directly and I'm not sure if it's possible to get from a FlowData struct back to a non-child {Block,Inline}Flow (probably intentionally).

I could've kept traversing the node tree directly, checking against each node style to ensure it didn't have an inline display property, but I could not create a scenario where the `base.node` was ever an inline.  It also feels like a code smell to be walking up the tree at all, especially for stylesheet properties.  Feels like it should eventually be handled in style::properties directly as being conditional inherited?
2013-12-13 09:07:11 -08:00
bors-servo
2ecafee5a5 auto merge of #1401 : saneyuki/servo/unused, r=metajack
Fix this warning:
```
servo/src/components/gfx/platform/macos/font_list.rs:6:4: 6:42 warning: unused import, #[warn(unused_imports)] on by default
servo/src/components/gfx/platform/macos/font_list.rs:6 use font_context::FontContextHandleMethods;
```
2013-12-13 08:43:15 -08:00