Commit graph

306 commits

Author SHA1 Message Date
Arthur Marble
883902bd97 Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
Aneesh Agrawal
56fbfd46a4 Excise SubpageId and use only PipelineIds
SubpageId was originally introduced in 2013 to help iframes keep track of
their associated (children) pipelines. However, since each pipeline
already has a PipelineId, and those are unique, those are sufficient
to keep track of children.
2016-09-13 15:37:38 -04:00
Aneesh Agrawal
b9b25b6f82 Consistently use parent_pipeline_id
Instead of containing_pipeline_id, use parent_pipeline_id because it is
more clear that it refers to the immediate parent.
2016-09-13 15:24:13 -04:00
Aneesh Agrawal
9d097e7d15 Use fn pipeline_id consistently, not fn pipeline
Consistently use the name 'pipeline_id' to refer to a function that
returns an (optional) PipelineId.

This was prompted by discovering both fn pipeline and fn pipeline_id
doing the same job in htmliframeelement.rs.

Note that there is fn pipeline in components/compositing/compositor.rs,
but that actually returns an Option<&CompositionPipeline>, not any kind
of PipelineId.
2016-09-13 15:17:40 -04:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Lars Bergstrom
bdf4563c6a Remove static usage at compile-time of GIT_INFO to enable builds outside of a git repo 2016-08-27 06:31:28 -05:00
Connor Brewster
f131818763 Implement beginnings of joint session history
Fix backward navigation

make use of history iterator

Add frame iterator
add different back logic

cleanup navigation_info

Add extra explanation for iter logic

Remove forward history on full frame tree

Rename navigation to traversal where appropriate

check full tree for can go back/forward

simplify frame iter logic

remove FrameIterator

cleanup history iter

reduce amount of vec allocations

removed extra parenthesis

Remove history iterator

cleanup after rebasing

avoid recursive vec allocation
remove full_frame_tree
remove_forward_history_in_frame_tree -> clear_joint_session_future
2016-07-21 20:51:38 -06:00
Alan Jeffrey
c889900cff Removed panic channel, replaced by integrated logging and issue reporting. 2016-07-20 21:56:43 -05:00
Alan Jeffrey
72aa4f2f62 Allow window elements as well as iframes to the the target of mozbrowser events. 2016-07-18 11:23:03 -05:00
Kuba Birecki
85f4da18a6 Inline DOM element creation into box expressions in components/script/dom/ 2016-07-14 08:44:22 +02: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
0db1faf876 Switch to using the new rooted!/RootedGuard API for rooting. 2016-07-04 20:59:01 +03:00
Corey Farwell
22928f50ac Refactor util::prefs operations to be methods on static struct. 2016-07-02 16:43:39 -04:00
bors-servo
307844a8c1 Auto merge of #12136 - ConnorGBrewster:servo_version_reporter, r=asajeffrey
Send servo version in mozbrowser error.

<!-- Please describe your changes on the following line: -->
Adds support for sending a version string to b.html so we can put the servo version in the auto generated issue reports.

r? @asajeffrey

---
<!-- 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] These changes fix #12083 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because sending servo version on mozbrwosererror for issue reporter.

<!-- 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/12136)
<!-- Reviewable:end -->
2016-07-02 12:33:57 -07:00
Patrick Trottier
7be78a3e54 Removing u8 from HTMLIframeElement
Remove u8 in HTMLIframeElement.rs

Remove u8 from IframeElement.rs

u8 removal

trying to pass test - uri

Update htmliframeelement.rs

u8 removal

removing u8 from Rust HTMLIFrameElement
2016-07-01 18:40:25 -04:00
Connor Brewster
ed678cb7f1 Send servo version in mozbrowser error.
Also moved servo version to util for usage by the --version flag
and for sending the version to browser.html with mozbrowsererror
2016-07-01 16:39:22 -06:00
Patrick Trottier
97eb594cc2 URI to URL
trying to pass test - uri
2016-06-20 20:18:42 -04:00
bors-servo
6166d8e74f Auto merge of #11544 - jdm:privatebrowsing, r=asajeffrey
Implement private browsing for mozbrowser

<!-- Please describe your changes on the following line: -->
Support the `mozprivatebrowsing` attribute on mozbrowser iframes. This separates the non-private and private sessions in terms of cookies, HSTS lists, cached HTTP credentials, HTTP connection pools, and web storage. The private session is shared between all private mozbrowsers, and lasts until shutdown.

---
<!-- 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

<!-- 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/11544)
<!-- Reviewable:end -->
2016-06-20 14:32:17 -05:00
Sagar Muchhal
7e2b4d163b Propagate privacy information of iframes to corresponding pipelines. Make iframes of differing privacy values be considered cross-origin.
Make the constellation hand out separate private and public channels for the pipeline content to communicate with the resource thread as necessary.
2016-06-20 14:55:01 -04:00
Ms2ger
9e2e0ff98c Move the remainder of layout_interface into script_layout_interface. 2016-06-20 19:08:12 +02:00
bors-servo
d620ab71c4 Auto merge of #10225 - jmr0:visibility_api, r=jdm
Implement non-visible pipeline and iframe visibility methods

This addresses #9566 and a good part of #9751, specifically:

* Pipeline has a notion of visibility
* IFrame setVisible/getVisible interface with IFrame's pipeline visibility
* IFrame mozbrowservisibilitychange responds to changes in visibility
* Pipeline visibility is used to limit animations (requestAnimationFrame does not tick animations when hidden) and to increase timer intervals (currently set to a minimum of 1 second while hidden)

Absent for now are any changes to the Document API and general implementation of the Page Visibility API, since the more interesting parts require knowledge of whether the user agent is minimized, OS screen locked, etc.

cc @paulrouget @jdm

<!-- 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/10225)
<!-- Reviewable:end -->
2016-06-16 08:53:56 -05:00
jmr0
2bff131535 Implement non-visible pipeline and iframe visibility methods 2016-06-15 23:28:07 -04:00
bors-servo
278c1a7da7 Auto merge of #11720 - canaltinova:sandbox, r=nox
Fix the type of HTMLIFrameElement.sandbox

<!-- Please describe your changes on the following line: -->

---
<!-- 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] These changes fix #11598 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/11720)
<!-- Reviewable:end -->
2016-06-11 23:40:11 -05:00
Nazım Can Altınova
47984a52c6 Add Sandbox field to HTMLIFrameElement 2016-06-11 01:59:59 +03:00
Nazım Can Altınova
41230fe03d Change sandbox to sandbox_allowance in HTMLIFrameElement 2016-06-11 01:24:20 +03:00
Jansen Jan
fda011923e Support WindowProxy return values in bindings
unscopable
2016-06-09 23:42:27 +02:00
bors-servo
a80767993b Auto merge of #11616 - ConnorGBrewster:navigation_delta, r=asajeffrey
Add support for navigating by a delta

<!-- Please describe your changes on the following line: -->
This adds support for passing a delta with `NavigationDirection`. This will be used with `history.go`

r? @asajeffrey

---
<!-- 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] These changes do not require tests because I am unsure how to write a test for this

<!-- 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/11616)
<!-- Reviewable:end -->
2016-06-07 14:16:13 -05:00
Ms2ger
684510bc94 Stop re-exporting AttrValue. 2016-06-07 13:15:23 +02:00
Ms2ger
06a1d04ca6 Move LengthOrPercentageOrAuto to style::attr. 2016-06-06 08:54:34 +02:00
Connor Brewster
c0ea1f16a8 Added support for navigating by a delta 2016-06-04 18:47:38 -06:00
bors-servo
530b5a649e Auto merge of #11468 - rebstar6:refPol4, r=nox
Implement meta referrer policy delivery (3)

<!-- Please describe your changes on the following line: -->

---
<!-- 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] These changes fix #10311 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/11468)
<!-- Reviewable:end -->
2016-06-02 21:51:10 -05:00
Rebecca
687d0cd7c3 Add meta-referrer support for documents 2016-06-02 21:48:09 -04:00
Alan Jeffrey
835b6a9017 Fire a mozbrowseropenwindow event when an html anchor has a non-self target. 2016-06-02 09:44:35 -05:00
Anthony Ramine
704646698f Fix permissions of mozbrowser and BrowserElementPrivileged (fixes #11498) 2016-05-30 11:23:42 +02:00
bors-servo
2f9796fa69 Auto merge of #11329 - c-rhodes:11320, r=jdm
Report use statements that use {} with only one entry

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 --faster` does not report any errors
- [X ] These changes fix #11320  (github issue number if applicable).

Either:
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

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/11329)
<!-- Reviewable:end -->
2016-05-27 07:11:17 -05:00
bors-servo
073c5e3b6b Auto merge of #11308 - nox:guarded, r=jdm
Implement [Func]

First part of #11292, this just includes support of `[Func]`.

<!-- 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/11308)
<!-- Reviewable:end -->
2016-05-27 04:45:06 -05:00
Cullen Rhodes
40acd24e8f Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
Anthony Ramine
694deabcd5 Use [Func] on HTMLIFrameElement.mozbrowser 2016-05-27 00:55:05 +02:00
Anthony Ramine
34dfc28e98 Move mozbrowser_enabled to util::prefs 2016-05-27 00:55:04 +02:00
Alan Jeffrey
d92dfe1b8c Record the frame type (IFrame or MozBrowserIFrame) in the pipeline. 2016-05-26 12:55:55 -05: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
Ms2ger
cc2b2b50a7 Remove ConstellationChan.
It's a pointless abstraction that propagates the obsolete chan terminology,
swaps the order in which the sender and receiver are returned, and hides a
source of panics.
2016-05-19 17:13:44 +02:00
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
Ms2ger
735480c184 Stop using JSAutoRequest. 2016-05-13 15:34:38 +02:00
Connor Brewster
cbc5ca65a8 remove page and move functionality to browing context
Allow for adding history items

Fixed nested iframe test failure

Cleanup and small refactors

fixup
2016-05-11 12:46:59 -06:00
Ms2ger
eba74554f3 Add and update some FIXME comments about origin handling with iframes. 2016-05-02 12:34:08 +02:00
Ms2ger
68076fbd7b Return a Url from HTMLIFrameElement::get_url.
Since Url::origin() always returns an opaque origin for about: urls, I don't
believe this changes behaviour.
2016-05-02 12:32:44 +02:00
Keith Yeung
3110647852 Make IFrameLoadInfo take an Option<LoadData> instead of Option<Url> 2016-04-30 21:43:01 -04:00
bors-servo
990dd72da7 Auto merge of #10837 - asajeffrey:add-mozbrowsererror-details, r=Manishearth
Add detail to mozbrowsererror events.

Part of #10334. Once #10824 lands, we can include the panic reason and backtrace in the error report.

<!-- 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/10837)
<!-- Reviewable:end -->
2016-04-29 09:18:39 -07:00
Ms2ger
897be5f6ee Reduce channel cloning. 2016-04-29 14:55:52 +02:00