A HashMap allows easily looking up a timer and canceling it in
Window.ClearTimeout.
Fixes#1477.
Source-Repo: https://github.com/servo/servo
Source-Revision: 3eac31394cb509ce7e4fa61a3543f6ec22c8bde4
For review only - don't approve yet (need to squash and land submodule updates first).
critic? @metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: f7aa6e3d9b8bfcc0565624f1094241b3b8658bd8
The specs currently have only Document; this may well change, but the split won't be along the lines we've implemented right now. In the meantime, this simplifies our code quite a bit.
Source-Repo: https://github.com/servo/servo
Source-Revision: 22760b6665c75f6908bcfd7cad4de111187ac6f7
We probably leak some threads and resources, e.g. when the script task crashes and doesn't get a chance to send layout data back to layout to be deallocated.
Not tested with iframes yet.
Source-Repo: https://github.com/servo/servo
Source-Revision: f1de0b738134f153a398866f76d1b5d0213d3c02
Fix#790 partially.
I am sure I need to merge with @jdm's event handler for dom.
As son as the event handler is implemented, I will fix.
And this is implement Hover Event. If over element, Currently Full reflow.
After PR, will make partial reflow.
Thank you!
Source-Repo: https://github.com/servo/servo
Source-Revision: ccfd595d6ebd0dcd7a81d1ef9fa05801cd955f8a
Add a LoadComplete message so that script informs the constellation, which can then inform the compositor (and anyone else, later) about the completion of loading a page. This is important for ref tests, which should not emit a PNG until load has completed, even if we perform a composite before then.
Note that we must *also* wait for the `ready_state` to indicate that additionally layout has completed any associated reflow with the page, otherwise we could get the `LoadComplete` while the final reflow is still in progress and thus would write out the `n-1`'th reflow result.
r? @pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: e9a0c8184f1af460583fe5ab2615e01d08ffc22f
This builds on top of #1560 (… which I realize now may confuse Critic)
This refactors Namespace to reduce the overall amount of copying and conversion. In particular, it makes parsed selectors contain Namespace enums rather than strings.
Source-Repo: https://github.com/servo/servo
Source-Revision: edda06115ac61c691e7762bcdb3e70b48b1c65bc
The old code was used by both layout and script, but was erroneously
borrowing for the layout case (which causes parallelism
problems). script now uses only `value_ref()` or `get_attribute()`, and
layout now has its own unsafe version that dances around the borrows of
`@mut Attr`.
Source-Repo: https://github.com/servo/servo
Source-Revision: d11e4318871e8ed237292985f30063f719bbfb0d
Pointers to DOM nodes from layout could go stale if incremental reflow
does not correctly destroy dead nodes. Therefore, we ask the JavaScript
garbage collector to verify that each DOM node is indeed a valid pointer
before calling event handlers on it, and fail otherwise.
Depends on the `get-addressable-gc-thing` branches of `mozjs` and `rust-mozjs`.
r? @jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: c876335d227d4f826b5ece66fb388134cf29fce4
Passing these around as strings is an anti-pattern, IMO.
Source-Repo: https://github.com/servo/servo
Source-Revision: cb336a18317195512a276971856081cb8ef86b0e
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
Source-Repo: https://github.com/servo/servo
Source-Revision: 824c7ac613ebb80bb432ff6425c5e25c642b6afb
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
Source-Repo: https://github.com/servo/servo
Source-Revision: aa1ebbbdb0243f098921103f02bb9b7dbcc40441
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
Source-Repo: https://github.com/servo/servo
Source-Revision: 144737ce1b582952a894f29e30e16134c73b2464
To test this, execute the followings:
test_local_bookmark.html#text1
test_local_bookmark.html#text2
test_local_bookmark.html#text3
test_local_bookmark.html#top
test_local_bookmark.html#h3
test_local_bookmark.html#num
acid2.html#top
- The link from acid2.html works now. ( `<a href="#top">`)
Thanks to @metajack!
Source-Repo: https://github.com/servo/servo
Source-Revision: 0c4b10cc2cccd2263ad9e9b1c7e84d5093d26195
This replaces flow construction with a strict bottom-up tree traversal,
allowing for parallelism. Each step of the traversal creates a flow or
a `ConstructionItem`, similar to how Gecko works. {ib} splits are
handled by not creating `InlineFlow`s until the containing block is
reached.
This should be able to be incrementalized by storing the `Flow` from
layout to layout, and performing fixups during flow construction
and/or wiping containing blocks in a previous pass.
r? @larsbergstrom
Source-Repo: https://github.com/servo/servo
Source-Revision: 736a258c26b6118c617e6dccb65d75988bcf5ee9
This will fix#1201.
This maybe the work in progress.
@jdm:
* Should we pass `DOMString` directly to `dom::utils::null_str_as_...`?
* Do you have any good idea to update the comment in `CodegenRust.py`?
Source-Repo: https://github.com/servo/servo
Source-Revision: 7f13566d57b90468b0ab2a58fd2e4ba387510e4b
It's good enough for now, since we don't track document resources at all. Should be good enough for #841.
Source-Repo: https://github.com/servo/servo
Source-Revision: da4ca510496c5596ddc3593909ebd1db2f5bf957
Most work courtesy of @kmcallister.
I already reviewed Keegan's work, so just the last two commits need attention.
Source-Repo: https://github.com/servo/servo
Source-Revision: 352acbb8335fcf78f2d62dc781fa9d86b9368f9c
The bit I don't like about these changes is that I ended up hiding the document node from the CSS selecting/matching code, so it continues thinking of the document's first child as the root. When I tried to send the full tree including the document node to layout, the layout code refused to create any child flows. When I sent the document's first child without hiding the document, it saw inherited values for properties like font-family, and later tried to treat the document node as an Element when searching for named nodes.
Source-Repo: https://github.com/servo/servo
Source-Revision: 13644ccab1942c053c3fd5e4a19bb75d9ebe8739
This upgrades to this morning's master. We have unfortunately broken the Android build, but I will update that in a second pull request as I think it's more than a single upgrade behind.
Source-Repo: https://github.com/servo/servo
Source-Revision: 797143a1d3e09b4ddd35a1ce5948be424ec3f9ef
This doesn't resolve the big questions of how Servo will represent strings; it's just about doing the conversion correctly for our existing types.
Source-Repo: https://github.com/servo/servo
Source-Revision: ebe1c1353ca0ffe1f0e195f4ed66abb982f303ee
I believe this is all the preparatory work discussed in #1006 and #1057: The new 'style' crate implements the whole style system (including parsing, matching and cascading) and only depends on cssparser and util, so that gfx, script and main can all depend on it.
Next: porting the layout code to this. (Really, this time! I think.)
Source-Repo: https://github.com/servo/servo
Source-Revision: 6db57e6f72c85cd5233f431817f9344aed8eab87
--HG--
rename : servo/src/components/gfx/geometry.rs => servo/src/components/util/geometry.rs
Turns out that documents without a window `fail!` a lot, because we need the `cx` all over.
Source-Repo: https://github.com/servo/servo
Source-Revision: 509934cf65acb1061cf4b012556ff6782e3203c9
In preparation for removing it as part of making Document a Node.
Source-Repo: https://github.com/servo/servo
Source-Revision: 8d3c7a2ded69f035f8fc98a38dd337237cb7db2a
I'm not happy about `is_in_doc`, but that should improve once @jdm lands his document-as-node changes.
Source-Repo: https://github.com/servo/servo
Source-Revision: b0ac5911ec8e818ff88e8177aa97415e7729141c
There are still a few instances of "wrapper"-ish names scattered throughout the code, but this is a good start.
Source-Repo: https://github.com/servo/servo
Source-Revision: 89dd9dd8eb2e473dffd5ad2d5d75012b15f75570
Fixes#1004. I haven't seen the other ones be reported, but I saw often saw `task <unnamed> failed at 'RenderChan.send: render port closed', /home/jdm/sdb/servo/src/components/gfx/render_task.rs:76`, `task <unnamed> failed at 'receiving on closed channel', /home/jdm/sdb/servo/src/compiler/rust/src/libstd/rt/comm.rs:487`, and failed assertions due to layout running after we had begun tearing down the window.
Source-Repo: https://github.com/servo/servo
Source-Revision: 096af85834e25d86487e82851331d93374782eac
This appears to fix the problem with the Rust logo stopping during the demo.
Though this is the right way to spawn a SpiderMonkey thread, I'm not entirely sure why this fixes the problem in all scenarios. With enough threads (i.e. `RUST_THREADS=32`), and running with some Rust patches that are available on master (which I applied during testing), I would expect work stealing to not allow starvation here. In my tests though I see the problem even with lots of threads, so this may yet indicate a scheduler bug. Still, SpiderMonkey should get its own thread.
Source-Repo: https://github.com/servo/servo
Source-Revision: be5deb2a680524b7f802d20bb058175b3853489b
Fixes#967 and #965
This has been wrong for a long time. Previously, only the pipeline associated with the root frame evicted would be shut down. 1) It shouldn't necessarily be closed, because there could be references to it still in the navigation context, and 2) Presumably none of the children pipelines of the root frame were ever exiting.
It's hard to test this right now because #965 covers up other pipeline exiting issues, but when that's fixed, a pathological case in which things would have broken down would be:
1) Load a page with an iframe that contains a link
2) Click the link
3) Press backspace to navigate back
4) Navigate to any new page, at which point the forward page would be evicted from the navigation context, and the outer frame's pipeline would be shut down improperly.
5) Press backspace, at which point there is no longer a pipeline for the old page, because it was shut down prematurely. Presumably this would cause a crash.
I also changed the FrameTree function ```find_mut``` to ```find``` because find_mut implies it's doing something to cause mutability, but the mutability is caused by the type of object being iterated over, nothing else.
Additionally, script was exiting completely when receiving an exit message. Instead, it needs to handle exit messages according to who sent it. It should only close the subframes of the frame whose pipeline sent the exit message. This is now fixed.
Inexplicably, script was also closing the compositor upon receiving an exit message. This doesn't seem like it'd ever be the right thing to do. *Edit: this is _only_ the right thing to do when received from the window.* I've fixed that. I don't think anyone shuts down the compositor now. *Edit: the script shuts down the compositor only when receiving an exit from the window.*
Source-Repo: https://github.com/servo/servo
Source-Revision: 401176b72d9ac9e4493ca27fca5aa5450500a333
* Profiler is now close to a no-op when ```-p``` is not passed in
* The profiler's printing ```Timer``` now stops looping when the profiler is closed
* Most task ```Chans``` are now newtype ```structs```
* Some more ```Cell``` removals in places where ```spawn_with``` is appropriate
Source-Repo: https://github.com/servo/servo
Source-Revision: e576a1cf7eb3191e6a740b8537517b28fbb4950c
Cells are generally less readable, and spawn_with makes many of them unnecessary.
Source-Repo: https://github.com/servo/servo
Source-Revision: b85497b76a7e002f816333fa2aa5fd2096ffce41
Haven't figured out what to do about page_from_context yet, but this is a big improvement.
Source-Repo: https://github.com/servo/servo
Source-Revision: 8994dc3a1e2b62fe0fee65f84f46ac3fe17dbb9c
The rust-mozjs change is just updating it to tip; do not be alarmed.
Source-Repo: https://github.com/servo/servo
Source-Revision: 39252b25f792ae1b9c7e7d269083b18d29d9101a
The new runtime isn't quite mature enough to deal with it, and this
is faster anyway.
Rebased to land #728.
Source-Repo: https://github.com/servo/servo
Source-Revision: 693bbaf095e3db607ab12b9217be2a7fd9e6350b
Fixes#455 (for now)
Also add a comment about how what we're doing here is unsafe (for reasons that are mostly unrelated to the warning)
r? @tkuehn
Source-Repo: https://github.com/servo/servo
Source-Revision: 13afd25679a3d39692a3dc745339d978a6d133b7
This will be necessary for the constellation to properly assign sizes to iframes when a parent layout performs reflow.
Source-Repo: https://github.com/servo/servo
Source-Revision: feee4ddcb23a072e60bfe76cbaa738215e065ad6
There are several mechanical changes here that make this look more intimidating than it is. DOMStrings are now passed by reference, and Event and Event_ have swapped names. Finally, there are the various places that need to use `document.with_base |doc| { document.foo }` instead of `document.foo`.
Source-Repo: https://github.com/servo/servo
Source-Revision: 0c105b5307bb69e8d43a1c6263b09c1b8e52c355
Completed:
* Replace pipeline navigation context with frame tree navigation context
* Reuse script task for same origin iframes
* Block on size future for iframe reflow
* Remove global script context
* Change codegen to use specific page context rather than script context.
Still to do:
* Compositor's handling of relative frame positions
* Compositor currently only asks for tiles from outermost frame
* Window events are forwarded to the outermost frame's script. Should be routed to proper script via constellation.
* Layout's sending of updated iframe sizes to constellation or size future (initial size only) as reflow is performed
Source-Repo: https://github.com/servo/servo
Source-Revision: d9e71edb10973b0bd1739ac3221f1d87aec421ec
Stuff I found in the process of working on incremental layout.
Source-Repo: https://github.com/servo/servo
Source-Revision: f34a13a8b566d42a94f2127a3e3c6e6a36fb8180
r? @metajack this includes the rust-azure pointer change
Source-Repo: https://github.com/servo/servo
Source-Revision: b0495eb7fdf01245b3dfeb62ba0764e1ff9f2c75
This code replaces glut with glfw. The motivation here is address the GPU driver bugs on Linux when using multiple `Display *` pointers with shared GL contexts instead of a single common one. GLFW has native access methods which provide access to its `Display *`, which appears to be unique among all the similar toolkits.
Details:
- Adds glfw and glfw-rs to the build
- Removes GLUT code and replaces it with GLFW versions
- Fixes hard coded initial window values
- Fixes clean targets
- Event loop doesn't block on windowing events anymore
Source-Repo: https://github.com/servo/servo
Source-Revision: 34a35054e9e113b9033fc050eaf25c82223c9aff
When loading pages, the constellation spawns a new script<-->layout<-->renderer pipeline that loads in the background while scripts continue executing on the currently loaded page.
Source-Repo: https://github.com/servo/servo
Source-Revision: 213d9a011a63842434df4e8ce3c359d08232aefa
Performance will be better and benchmarking easier if we don't run layout an extra unnecessary time when loading a page from the commandline. This is happening because we always send a resize event to the script task from the compositor whenever the platform tells us one happened, even if the window size didn't change. This PR fixes this by checking that the window size is actually different before sending the event.
Source-Repo: https://github.com/servo/servo
Source-Revision: fed4f951c19f5c8cfc474814c7e8ca6ebc257232