Commit graph

427 commits

Author SHA1 Message Date
Ms2ger
307d1ced3c Move thread_state to style. 2016-08-22 16:08:56 +02:00
Anthony Ramine
9c8a810d6e Use impl Trait syntax for Node::child_elements 2016-08-13 22:38:02 +02:00
Emilio Cobos Álvarez
c3a727ebda
style: Remove a few more unuseful traversals now we can. 2016-07-27 11:14:45 -07:00
Emilio Cobos Álvarez
d81fe27b11
style: Avoid propagating the restyle flag all through the dom when a node gets dirty.
This puts us in pair with stylo.
2016-07-25 10:50:04 -07:00
Shing Lyu
f754cacbd5 Only restyle viewport-relative nodes on viewport size change 2016-07-18 11:01:42 +08:00
Aravind Gollakota
1a242d8a50 script: Obtain referrer policy from header 2016-07-15 08:12:24 -07:00
Nazım Can Altınova
d6c1f7b5e3 Implement Document.referrer 2016-07-14 21:35:39 +03:00
bors-servo
80cb0cf821 Auto merge of #11872 - eddyb:back-to-roots, r=Ms2ger
Replace return_address usage for rooting with stack guards and convenience macros.

The existing `Rooted` and `RootedVec` users were migrated the the following two macros:
```rust
let x = Rooted::new(cx, value);
// Was changed to:
rooted!(in(cx) let x = value);
// Which expands to:
let mut __root = Rooted::new_unrooted(value);
let x = RootedGuard::new(cx, &mut __root);
```
```rust
let mut v = RootedVec::new();
v.extend(iterator);
// Was changed to:
rooted_vec!(let v <- iterator);
// Which expands to:
let mut __root = RootableVec::new();
let v = RootedVec::new(&mut __root, iterator);
```

The `rooted!` macro depends on servo/rust-mozjs#272.
These APIs based on two types, a container to be rooted and a rooting guard, allow implementing both `Rooted`-style rooting and `Traceable`-based rooting in stable Rust, without abusing `return_address`.

Such macros may have been tried before, but in 1.9 their hygiene is broken, they work only since 1.10.

Sadly, `Rooted` is a FFI type and completely exposed, so I cannot prevent anyone from creating their own, although all fields but the value get overwritten by `RootedGuard::new` anyway.
`RootableVec` OTOH is *guaranteed* to be empty when not rooted, which makes it harmless AFAICT.

By fixing rust-lang/rust#34227, this PR enables Servo to build with `-Zorbit`.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix rust-lang/rust#34227
- [x] These changes do not require tests because they are not functional changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11872)
<!-- Reviewable:end -->
2016-07-04 11:03:35 -07:00
Eduard Burtescu
b79a7d468e Use a stack guard and a macro for RootedVec instead of return_address. 2016-07-04 20:59:06 +03:00
Anthony Ramine
345eee92e8 Skip the root node in querySelectorAll
This accounts for https://github.com/whatwg/dom/issues/263.
2016-07-04 14:52:34 +02:00
Josh Matthews
a74ce64539 Avoid an unnecessary panic when the script task deals with a GC after the layout thread is unreachable. 2016-06-22 09:35:19 -04:00
Ms2ger
9e2e0ff98c Move the remainder of layout_interface into script_layout_interface. 2016-06-20 19:08:12 +02:00
Ms2ger
68d603a6d0 Move TrustedNodeAddress to script_layout_interface. 2016-06-20 19:08:06 +02:00
Ms2ger
7de3d165ad Introduce LayoutJS<Node>::opaque() to replace OpaqueNodeMethods::from_jsmanaged(). 2016-06-20 19:08:02 +02:00
Ms2ger
000e2de57a Move HTMLCanvasData to script_layout_interface. 2016-06-20 19:04:41 +02:00
Ms2ger
6b847eb93a Introduce LayoutNodeType and LayoutElementType enums. 2016-06-20 19:02:49 +02:00
Ms2ger
6aaf3e6a01 Move OpaqueStyleAndLayoutData to script_layout_interface. 2016-06-20 19:02:38 +02:00
Ms2ger
5cab8ff8d2 Make OpaqueStyleAndLayoutData::dispose a method on Node. 2016-06-20 19:02:37 +02:00
Patrick Walton
041cfe6d0a script: When using WebRender, keep the DOM-side scroll positions for
elements with `overflow: scroll` up to date, and take them into account
when doing hit testing.

Closes #11648.
2016-06-10 18:43:04 -07:00
Anthony Ramine
b7f5e8d013 Update Rust to 1.11.0-nightly (ec872dc8a 2016-06-07) 2016-06-08 14:03:57 +02:00
Ms2ger
858ea2eb9a Move the definition of ServoThreadSafeLayoutNode::iframe_pipeline_id to script. 2016-06-07 11:39:28 +02:00
Ms2ger
5859109197 Move the definition of ServoThreadSafeLayoutNode::canvas_data to script. 2016-06-07 11:10:40 +02:00
Ms2ger
ef3c6a7773 Move the definition of ServoThreadSafeLayoutNode::image_url to script. 2016-06-07 10:57:20 +02:00
Ms2ger
093b7b7710 Move the definition of ServoThreadSafeLayoutNode::selection to script. 2016-06-07 10:30:52 +02:00
Anthony Ramine
b45f1918d1 Remove JS::from_rooted 2016-05-31 14:43:58 +02:00
Thiago Pontes
766ad5e092 use USVStrings instead of DOMString for urls in Node and Document 2016-05-28 14:53:31 -04:00
bors-servo
3ec20d9cf5 Auto merge of #11472 - jdm:wip, r=mbrubeck
Report blank lines that follow an open brace

This automates something that I find myself frequently commenting on in PRs.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes OR

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11472)
<!-- Reviewable:end -->
2016-05-27 18:14:25 -05:00
Josh Matthews
3cb8af20c2 Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
Ms2ger
e94f3d4fe0 Remove the LayoutChan type.
It is a pointless abstraction.
2016-05-27 15:33:04 +02:00
Anthony Ramine
cdc7bca944 Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
2016-05-24 10:54:57 +02:00
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
mrmiywj
6ade433196 Make Node::BaseURI use the document's base URL
update expectations
2016-05-14 14:44:06 +08:00
Ms2ger
a5be5a82c1 Move some code from ServoThreadSafeLayoutNode::text_content into script. 2016-05-09 14:26:30 +02:00
Matt Brubeck
1e23d90631 Upgrade to bitflags 0.6.0 and selectors 0.5.6
Types generated by `bitflags!` are now private by default.  This PR marks them
`pub` where necessary.
2016-04-30 10:14:03 -07:00
Ms2ger
897be5f6ee Reduce channel cloning. 2016-04-29 14:55:52 +02:00
Arnaud Marant
ed42cc72a4 Implements Node::isSameNode
Fixes #10746

Adapted the tests from dom/nodes/Node-isEqualNode.html
2016-04-23 22:03:25 +02:00
Léo Stefanesco
00b3f7930e Implement Node::rootNode 2016-04-22 13:18:50 +02:00
Zhen Zhang
fefdaf76de Implement ScrollTop and ScrollLeft getters:
Add new compositor message to get scroll_offset;
Add new layout query for computed value of overflow-x/y;
Implement layer_id method for ThreadSafeLayoutNode;
Add new layout query for layer_id;
Implement script interface for getting scrollTop and scrollLeft, as well as relavant helper functions.
2016-04-19 12:27:35 +08:00
Corey Farwell
2c9b00ef6b Extract out 'is the html body element' CSSOM concept. 2016-04-11 10:51:00 -04:00
Ms2ger
71f56d6744 Simplify PrecedingNodeIterator::next(). 2016-04-11 10:29:32 +02:00
Ms2ger
489d2e5e49 Update uuid. 2016-04-07 09:00:22 +02:00
Corey Farwell
bf4db405e4 Remove get_* on getters as per RFC 0344.
https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#gettersetter-apis

https://github.com/servo/servo/issues/6224
2016-03-31 21:12:38 -04:00
Ms2ger
b1cd28e9c6 Store the encoding in the Document rather than its name. 2016-03-18 16:22:52 +01:00
Daniel Robertson
16d2778ece Add scrollWidth/Height to element interface
Add the scrollWidth and scrollHeight extensions to the element
interface.
2016-03-11 18:22:16 +00:00
Emilio Cobos Álvarez
3662491d8f Refactor mouseover code to be more performant
This increases mouseover/out performance drastically on my machine.
2016-03-02 20:14:15 +01:00
Emilio Cobos Álvarez
3e36739e38 script: Fix remaining bugs from Range.deleteContents 2016-02-28 19:27:42 +01:00
benshu
0785d91ae4 Completed implementation of devtools' getLayout. 2016-02-24 13:51:47 -05:00
Matt Brubeck
973918967f Dirty elements whose selectors are affected by sibling changes
This fixes incremental layout of nodes that match pseudo-class selectors such
as :first-child, :nth-child, :last-child, :first-of-type, etc.

* Fixes #8191
* Fixes #9063
* Fixes #9303
* Fixes #9448

This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134
2016-02-23 17:31:38 -08:00
bors-servo
ee158cc65f Auto merge of #9603 - Ms2ger:document-bc, r=jdm
Store a pointer to the browsing context in the Document.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9603)
<!-- Reviewable:end -->
2016-02-19 12:49:35 +05:30
bors-servo
2374e9d30e Auto merge of #9526 - schuster:node-remove, r=nox
My updates so far for issue #8465. See comments there for more information.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9526)
<!-- Reviewable:end -->
2016-02-19 03:14:28 +05:30