Commit graph

6625 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
2ac1327e4b
style: Make border-spacing serialization consistent, and move it to precomputed_type. 2017-09-17 21:33:17 +02:00
bors-servo
6f97dd1c96 Auto merge of #18539 - emilio:dom-conversion-fixes, r=nox
script: a couple DOM conversion fixes

Fixes https://github.com/servo/servo/issues/18535

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18539)
<!-- Reviewable:end -->
2017-09-17 11:57:05 -05:00
Emilio Cobos Álvarez
91f238f326
script: Properly throw when "this" is not an object in a generic call. 2017-09-17 18:42:27 +02:00
Emilio Cobos Álvarez
5281fc1a44
script: Add a comment about some conversion that looks fishy. 2017-09-17 18:42:24 +02:00
Emilio Cobos Álvarez
b29e56eefc
script: Fix code generation for named getters.
Fixes part of #18535
2017-09-17 18:42:23 +02:00
Simon Sapin
aa5b3ae452 Upgrade to rustc 1.22.0-nightly (277476c4f 2017-09-16) 2017-09-17 15:27:09 +02:00
bors-servo
7cc0af37cf Auto merge of #18512 - tromey:preserve-style-sheet-source-url, r=SimonSapin
Preserve sourceURL comment on style sheets

In addition to the sourceMappingURL comment, there is a second special
comment, "sourceURL", that can be used to set the "display name" of a
style sheet for developer tools.  This name is also used as the base
URL for the source-map URL resolution algorithm.  sourceURL is
described here:
https://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/
The devtools feature bug is here:
https://bugzilla.mozilla.org/show_bug.cgi?id=880831

This patch changes servo to preserve and expose this value for use in M-C.

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

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

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18512)
<!-- Reviewable:end -->
2017-09-15 08:07:49 -05:00
bors-servo
1b9a5ea719 Auto merge of #18504 - servo:media, r=emilio
Some minor HTMLMediaElement improvements

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18504)
<!-- Reviewable:end -->
2017-09-14 20:51:51 -05:00
bors-servo
4268037424 Auto merge of #18503 - servo:globalism, r=emilio
Simplify WorkerGlobalScope::process_event

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18503)
<!-- Reviewable:end -->
2017-09-14 18:17:55 -05:00
Tom Tromey
c48226ff6f Preserve sourceURL comment on style sheets
In addition to the sourceMappingURL comment, there is a second special
comment, "sourceURL", that can be used to set the "display name" of a
style sheet for developer tools.  This name is also used as the base
URL for the source-map URL resolution algorithm.  sourceURL is
described here:
https://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/
The devtools feature bug is here:
https://bugzilla.mozilla.org/show_bug.cgi?id=880831

This patch changes servo to preserve and expose this value for use in M-C.
2017-09-14 12:39:18 -06:00
Emilio Cobos Álvarez
0a9309aa96
style: Unify how servo and Gecko handle UA sheets. 2017-09-14 20:33:43 +02:00
Anthony Ramine
518e34e7c8 Use an enum for the ready state of media elements 2017-09-14 15:30:20 +02:00
Anthony Ramine
86b25cd6b5 Use an enum for the network state of media elements 2017-09-14 14:23:06 +02:00
Anthony Ramine
87bb5ba381 Fix some HTMLMediaElement spec links 2017-09-14 13:52:25 +02:00
Anthony Ramine
35d86afcc8 Simplify WorkerGlobalScope::process_event
This method does not need to dispatch to interfaces derived from
WorkerGlobalScope, given they end up doing exactly the same thing
in all workers.
2017-09-14 13:37:33 +02:00
bors-servo
bb2030a493 Auto merge of #18494 - frewsxcv:frewsxcv-size-hint, r=jdm
Implement `size_hint` for more iterators.

```
implement size hint for
more iterators because why
not we like fast things
```

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18494)
<!-- Reviewable:end -->
2017-09-13 19:38:32 -05:00
Corey Farwell
9cd4535364 Implement size_hint for more iterators.
```
implement size hint for
more iterators because why
not we like fast things
```
2017-09-13 20:29:27 -04:00
bors-servo
d461347adf Auto merge of #18484 - emilio:per-origin-sheets, r=SimonSapin
style: Store stylesheets per origin

This is the first step that will allow us to cache UA sheets across documents.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18484)
<!-- Reviewable:end -->
2017-09-13 14:59:16 -05:00
Emilio Cobos Álvarez
82c58d0a05
script: Fix stylesheet adoption. 2017-09-13 17:11:24 +02:00
Emilio Cobos Álvarez
02d1264047
style: Store stylesheets per origin.
This will allow us to cache UA sheets across documents.

MozReview-Commit-ID: 5rYIKTmC6iw
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-13 16:01:35 +02:00
Anthony Ramine
24cf15a014 Store microtask queues in their global (fixes #18467) 2017-09-13 15:02:45 +02:00
Anthony Ramine
7481ce177f Store a Rc<MicrotaskQueue> directly on Window 2017-09-13 14:27:45 +02:00
Anthony Ramine
7f9f95b7ce Store microtask queues in Rc<T> 2017-09-13 14:27:42 +02:00
Anthony Ramine
fe29037e89 Avoid a clone in ScriptThread::new 2017-09-13 14:27:40 +02:00
Anthony Ramine
65dfd6bf63 Clean up DissimilarOriginWindow::origin
It's not dead code, and it should use Castable instead of directly reaching
to the globascope field.
2017-09-13 14:27:36 +02:00
Anthony Ramine
1c46135c75 Reformat DissimilarOriginWindow::new 2017-09-13 10:53:05 +02:00
Anthony Ramine
b8ae82ffb8 Reformat GlobalScope::new_inherited 2017-09-13 10:53:03 +02:00
Anthony Ramine
3764217ca6 Reformat WorkerGlobalScope::new_inherited 2017-09-13 10:53:01 +02:00
Anthony Ramine
71df1d5d9b Reformat WorkletGlobalScope::new_inherited 2017-09-13 10:53:00 +02:00
Anthony Ramine
0822a74f94 Reformat Window::new 2017-09-13 10:50:09 +02:00
Tom Tromey
4768597b13 Remove get_location_with_offset
Now that rust-cssparser reports 1-based locations, bump the required
cssparser version and remove get_location_with_offset.  Previously,
some code paths were not calling get_location_with_offset; see
https://bugzilla.mozilla.org/show_bug.cgi?id=1398869 for some
background.
2017-09-12 07:35:55 -06:00
bors-servo
3cad8d4662 Auto merge of #18446 - bzbarsky:update-cssparser, r=SimonSapin
Update rust-cssparser to 0.20.2.

This reduces memory consumption of list-valued properties in the common case of one entry in the list.

<!-- 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: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18446)
<!-- Reviewable:end -->
2017-09-11 10:33:24 -05:00
Boris Zbarsky
b2c56345d7 Update rust-cssparser to 0.20.2.
This reduces memory consumption of list-valued properties in the common case of one entry in the list.
2017-09-11 10:55:27 -04:00
bors-servo
e7f45028dc Auto merge of #18431 - mbrubeck:pdb-size, r=SimonSapin
Use SmallBitVec to optimize size of PropertyDeclarationBlock

https://bugzilla.mozilla.org/show_bug.cgi?id=1398322

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18431)
<!-- Reviewable:end -->
2017-09-11 08:57:07 -05:00
Matt Brubeck
a5a0e9ffe8 Use SmallBitVec for important flags in PDB 2017-09-11 06:53:05 -07:00
bors-servo
6a09b1d21a Auto merge of #18372 - tigercosmos:userTimingApi, r=ferjm
TEST: fix and add case of po-observe.any.js

<!-- Please describe your changes on the following line: -->
1. implementing step 3 from the [`PerformanceObserver.observe()`](https://w3c.github.io/performance-timeline/#dom-performanceobserver-observe()) method spec properly.
2. also add cases about step 1 & 2

work on the top of #18283

 r? @ferjm
---
<!-- 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 #18285 (github issue number if applicable).

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18372)
<!-- Reviewable:end -->
2017-09-11 05:26:46 -05:00
bors-servo
40c8a6389a Auto merge of #17083 - danielj41:javascript-url-global-3, r=jdm
"javascript:" urls: execute in correct global scope

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

#### Summary

This pull request makes `javascript:` urls execute in the correct global scope.

#### Example

```html
<script> var x = 4; </script>

<!-- this branch: logs "4" -->
<!-- master: undefined variable error -->
<a href="javascript:console.log(x)">link</a>
```

#### Questions

I'm new to servo and rust, so I'm unsure about these changes. In particular:
  * What's the appropriate place to evaluate the js?
    * I moved it to `handle_navigate`, but I'm not sure if this will catch all occurrences of `javascript:` urls. I also don't know if this will execute in the correct thread and the correct window.
  * What should I do with the result of the js evaluation?
    * I just ignored it. The previous behavior displayed it as the content of a new page load.

---
<!-- 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 #15147, #16718

<!-- Either: -->
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17083)
<!-- Reviewable:end -->
2017-09-09 04:39:43 -05:00
tigercosmos
3877e9162f fix observer comparing and test 2017-09-09 03:00:42 +08:00
bors-servo
867d542261 Auto merge of #18370 - pylbrecht:observer, r=ferjm
An observer disconnected after a mark must receive the mark

<!-- Please describe your changes on the following line: -->
I worked on top of #18283 as suggested [here](https://github.com/servo/servo/issues/18284#issuecomment-326043873).

r? @ferjm

<!-- 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 #18284 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18370)
<!-- Reviewable:end -->
2017-09-08 13:04:26 -05:00
bors-servo
fef2cfde8c Auto merge of #18341 - ferjm:bug1384225.media.errors, r=jdm
stylo: Error reporting for unknown media features

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [bug 1384225](https://bugzilla.mozilla.org/show_bug.cgi?id=1384225)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18341)
<!-- Reviewable:end -->
2017-09-08 11:14:51 -05:00
P. Albrecht
354ed65c21 Observer receives pending marks before removed 2017-09-08 15:36:43 +02:00
Fernando Jiménez Moreno
337a90329c stylo: Error reporting for unknown media features 2017-09-08 12:48:50 +02:00
Anthony Ramine
0c33d6168e Panic from the default impl of Runnable::handler
This will allow us to make sure that tasks using main_thread_handler don't
actually get consumed through a call to the bare handler method.
2017-09-08 10:21:28 +02:00
Anthony Ramine
53d30d85b3 Reformat some task-related functions 2017-09-08 10:19:06 +02:00
Anthony Ramine
35a7252254 Kill UserInteractionTask
Just use a bare Runnable value.
2017-09-08 10:17:23 +02:00
Anthony Ramine
9252f2b8a2 Kill DOMManipulationTask
Just use a bare Runnable value.
2017-09-08 10:06:18 +02:00
Daniel Johnson
709cd3a0b6 "javascript:" urls: remove unnecessary block
Remove this block and unindent the code one level.

Doing this required cloning `load_data.url` so that we could
later mutate `load_data.url` in the same block.
2017-09-07 17:03:41 -07:00
bors-servo
e9336b39a6 Auto merge of #18411 - servo:rename-preshint-method, r=emilio
Rename VirtualMethods::attribute_is_mapped

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18411)
<!-- Reviewable:end -->
2017-09-07 15:56:01 -05:00
bors-servo
867a982fa7 Auto merge of #18407 - servo:kill-is-cancelled, r=emilio
Kill Runnable::is_cancelled ⚔️

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18407)
<!-- Reviewable:end -->
2017-09-07 14:53:35 -05:00
bors-servo
1e93749941 Auto merge of #18283 - ferjm:user.timing.api, r=jdm
User Timing API

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #18109
- [X] There are tests for these changes. I enabled the peformance-timeline API WPTs but some of them are still failing because of implementation bugs or missing APIs (Resource Timing, for instance) the tests are dependent of. I'll file issues to fix them.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18283)
<!-- Reviewable:end -->
2017-09-07 12:45:46 -05:00