Commit graph

4860 commits

Author SHA1 Message Date
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
Daniel Hedlund
555e04475e InlineFlow should always inherit text-width from base style
Fixes #222.
2013-12-13 08:18:44 -08:00
Tetsuharu OHZEKI
0f98647edc Remove unused import. 2013-12-13 23:50:09 +09:00
bors-servo
c168e04fe1 auto merge of #1399 : pcwalton/servo/store-image-dimensions, r=kmcallister
the DOM for them.

r? @kmcallister
2013-12-12 18:22:18 -08:00
bors-servo
03269a8387 auto merge of #1398 : pcwalton/servo/propagate-text-decoration, r=pcwalton
going to the DOM.

r? @SimonSapin
2013-12-12 17:58:21 -08:00
Patrick Walton
42cc04684f layout: GC unused box methods 2013-12-12 17:54:51 -08: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
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
Simon Sapin
b6b89639dc Upgrade to rust-encoding upstream. 2013-12-13 00:40:56 +00:00
bors-servo
7b3c3542a3 auto merge of #1396 : pcwalton/servo/acid1-reftest, r=metajack
r? @metajack
2013-12-12 15:37:53 -08:00
bors-servo
144737ce1b auto merge of #1394 : kmcallister/servo/style-damage, r=pcwalton
This fixes the computation of restyle damage on `color-change-text.html`, which can be seen with `RUST_LOG=servo::layout::layout_task`.

However we can't prune the layout traversals yet, because we don't reuse `Flow` objects between reflows, so we have no old values to fall back to.

I think this used to work because `FlowContexts` (as they were called then) were stored in a DOM node's `LayoutData` and reused.  But it's possible that it never really worked, and my testing when I landed the restyle damage code was insufficient (I didn't understand the layout code nearly as well back then).

r? @pcwalton
2013-12-12 15:17:27 -08:00
Patrick Walton
413a91c2d9 test: Implement a reftest for Acid1. 2013-12-12 15:11:26 -08:00
bors-servo
87acc5d493 auto merge of #1387 : pcwalton/servo/ref-count-style, r=pcwalton
This has no difference in CSS selector matching performance and results
in a 31% speedup in constraint solving on the rainbow page.

r? @kmcallister
2013-12-12 14:50:25 -08:00
Keegan McAllister
53747638a1 Disable remaining reflow traversal pruning for now
We don't reuse Flow objects between reflows, so we have no old values to fall
back to.

I think this used to work because FlowContexts (as they were called then) were
stored in a DOM node's LayoutData and reused.  But it's possible that it never
really worked, and my testing when I landed the restyle damage code was
insufficient (I didn't understand the layout code nearly as well back then).
2013-12-12 14:44:34 -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
Keegan McAllister
0238410b47 Allow setting id, class, style without a full reflow
Instead we do selector matching again, then diff the style structs to set the
"restyle damage" bits which are used to prune reflow traversals.

Also don't force a reflow when timers finish, because individual DOM methods
should already take care of that.
2013-12-12 14:43:26 -08:00
Keegan McAllister
93e10eaf20 Call Element::after_set_attr only for null namespace 2013-12-12 14:43:26 -08:00
Keegan McAllister
39fc9eb868 Get rid of reflow_all
This refactoring should not alter behavior.
2013-12-12 14:43:26 -08:00
Keegan McAllister
dd0bb08927 Print restyle damage for debugging 2013-12-12 14:43:24 -08:00
Keegan McAllister
c3c87e3d44 Propagate up the right bits of style damage
The call to propagate_up was lost in eb1b40db13.
2013-12-12 11:52:35 -08:00
bors-servo
6679baadef auto merge of #1392 : Ms2ger/servo/Node-new_inherited, r=metajack
To match existing style for constructors that don't wrap.
2013-12-12 06:58:14 -08:00
Ms2ger
7f4283f4bc Rename some 'new' functions to 'new_inherited'. 2013-12-12 14:34:58 +01:00
bors-servo
3fe50711d4 auto merge of #1390 : pcwalton/servo/decontentboxwidth, r=metajack
Shaves 4 bytes off the size of `Box`.
2013-12-11 22:10:30 -08:00