Commit graph

7016 commits

Author SHA1 Message Date
bors-servo
c9ba16f9fb Auto merge of #19868 - CYBAI:specific-assertion, r=emilio
Use specific assertions

Similar to #19865
r? jdm

Note: Should I squash all the commits into one commit?

---
- [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 it should not break anything

<!-- 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/19868)
<!-- Reviewable:end -->
2018-01-25 18:06:33 -06:00
CYBAI
5104d2947f Use specific negative assertion for DOM XMLHttpRequest 2018-01-26 02:23:49 +08:00
CYBAI
2a17230623 Use specific negative assertion for DOM Window Proxy 2018-01-26 02:23:39 +08:00
CYBAI
f372bc0f40 Use specific negative assertion for DOM HTMLCollection 2018-01-26 02:11:02 +08:00
CYBAI
1ba2b67b00 Use specific negative assertion for DOM globalscope 2018-01-26 02:08:11 +08:00
CYBAI
5475059df7 Use specific negative assertion for DOM document 2018-01-26 02:07:47 +08:00
CYBAI
1f9ce9e5d7 Use specific negative assertion for DOM bindings utils 2018-01-26 02:07:27 +08:00
CYBAI
40e40e0f8b Use specific assertion for DOM XMLHttpRequest 2018-01-26 01:18:58 +08:00
CYBAI
15a1faff03 Use specific assertion for DOM webgl shader 2018-01-26 01:18:58 +08:00
CYBAI
9a358014f9 Use specific assertion for DOM servoparser 2018-01-26 01:18:57 +08:00
CYBAI
0e6f446a61 Use specific assertion for DOM servoparser async_html 2018-01-26 01:18:56 +08:00
CYBAI
5486335708 Use specific assertion for DOM create 2018-01-26 01:18:56 +08:00
CYBAI
9ee27d62ae Use specific assertion for DOM binding refcounted 2018-01-26 01:18:55 +08:00
CYBAI
1c31370a08 Use specific assertion for DOM binding interface 2018-01-26 01:18:55 +08:00
CYBAI
34babb6dcf Use specific assertion for DOM attr 2018-01-26 01:18:54 +08:00
Anthony Ramine
de426baecc Make the private callback methods taking a raw this pointer unsafe 2018-01-25 12:07:13 +01:00
Anthony Ramine
74dabbdc62 Kill dead callback codegen code 2018-01-25 11:45:17 +01:00
Anthony Ramine
f903da0a7b Make callbacks' new methods unsafe
They take raw pointers to contexts and objects.
2018-01-25 11:25:23 +01:00
Anthony Ramine
cd8f96cc9e Change ToCss to take a CssWriter<W>
This more concrete wrapper type can write a prefix the very first time something
is written to it. This allows removing plenty of useless monomorphisations caused
by the former W/SequenceWriter<W> pair of types.
2018-01-23 10:41:42 +01:00
Bobby Holley
5526947500 Avoid the generic writer parameter for PropertyDeclaration serialization.
MozReview-Commit-ID: JR3IcL1NRHO
2018-01-22 14:58:05 -08:00
Simon Sapin
b78ac6ba6a Use safe NonZero constructor instead of an explicit null check 2018-01-22 17:41:26 +01:00
Simon Sapin
10ec5a2bb0 Replace NonZero<*{const,mut} _> with std::ptr::NonNull 2018-01-22 17:41:25 +01:00
Simon Sapin
52eda6082f Replace NonNullJSObjectPtr with std::ptr::NonNull<JSObject> 2018-01-22 17:41:25 +01:00
Simon Sapin
897a5b39c5 Fix some "unnecessary parentheses" warnings 2018-01-22 17:41:25 +01:00
bors-servo
bccb757bcd Auto merge of #19803 - jonleighton:issue-19765, r=emilio
Implement Element::has_css_layout_box()

r? emilio

Here's my initial attempt to fix #19430. It seems surprisingly simple so I am wondering whether I have missed something! (Or maybe it just actually is quite simple...)

Some things I am unsure about:

1. The spec seems vague about what a [CSS layout box](https://drafts.csswg.org/cssom-view/#css-layout-box) actually is. Indeed it says: "The terms CSS layout box and SVG layout box are not currently defined by CSS or SVG."
2. One thing the spec *does* say explicitly is "For the purpose of the requirements in this specification, elements that have a computed value of the display property that is table-column or table-column-group must be considered to have an associated CSS layout box (the column or column group, respectively)." I am unclear about the relevance of this, since [overflow does not apply](https://drafts.csswg.org/css-overflow-3/#overflow-properties) to an [internal table element](https://drafts.csswg.org/css-display-3/#layout-specific-display). Therefore I haven't done anything about this explicitly, but maybe I'm missing some nuance.

<!-- 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/19803)
<!-- Reviewable:end -->
2018-01-19 14:37:57 -06:00
bors-servo
0d7d02fca7 Auto merge of #19817 - emilio:matching-context-visited, r=nox
style: Track the visited-handling-mode on the MatchingContext.

This fixes bugs where we're not passing the value around correctly, like from
::-moz-any.

This is a fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1431539.

<!-- 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/19817)
<!-- Reviewable:end -->
2018-01-19 12:50:00 -06:00
Fernando Jiménez Moreno
f46fbe4599 Remove gecko-media dependency 2018-01-19 15:06:52 +01:00
Emilio Cobos Álvarez
8e25c9e674
style: Track the visited-handling-mode on the MatchingContext.
Instead of on the stack.

This fixes bugs where we're not passing the value around correctly, like from
::-moz-any.

This is a fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1431539.
2018-01-19 13:22:37 +01:00
Jon Leighton
902edb925e Implement Element::has_css_layout_box()
Calling scroll() on an element which is not rendered (by a parent with
display: none) would previously cause a crash. In fact, we should
terminate the algorithm
[https://drafts.csswg.org/cssom-view/#dom-element-scroll] at step 10 in
this situation.

The fix hinges on implementing Element::has_css_layout_box() correctly,
rather than just returning true in all cases as we did previously.

Fixes #19430.
2018-01-18 18:31:16 +01:00
Pyfisch
af52233ae5 Introduce MaxRect trait
It is implemented for LayoutRect and Rect<Au>.
Replaces the max_rect() function from servo_geometry.
2018-01-17 23:29:57 +01:00
bors-servo
fa82a6bbce Auto merge of #19397 - cbrewster:create_element_for_token, r=jdm,nox
Implement the create an element for token algorithm

<!-- 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 #19392 and fix #19393 (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/19397)
<!-- Reviewable:end -->
2018-01-17 10:57:06 -06:00
tigercosmos
b29230bd76 implement range input sanitization 2018-01-17 16:27:21 +08:00
Fernando Jiménez Moreno
d600f246f4 Do not fire pending callbacks on disconnected performance observer 2018-01-15 09:42:31 +01:00
Josh Matthews
c55f25b3aa Take throw-on-dynamic-markup-insertion-counter into account when check script safety. 2018-01-11 11:14:41 -05:00
Connor Brewster
4593195b49 Implement throw-on-dynamic-markup-insertion-counter 2018-01-11 11:14:10 -05:00
Connor Brewster
43526c80bb Add a check for when the js execution stack is empty 2018-01-11 11:14:10 -05:00
Connor Brewster
87475b11d3 Implement the create an element for token algorithm 2018-01-11 11:14:10 -05:00
Simon Sapin
4d459bce32 Fix tyvar_behind_raw_pointer warnings
https://github.com/rust-lang/rust/issues/46906
2018-01-10 20:54:35 +01:00
Anthony Ramine
6f9003c052 Properly handle CR in textarea placeholders (fixes #19717) 2018-01-10 15:34:54 +01:00
Nathan
5b6e821559 input type=number validations 2018-01-09 20:08:09 -06:00
Manoj
a07ae15abc Remove out of date comments from domimplementation 2018-01-08 23:23:46 +01:00
bors-servo
d41f720ee4 Auto merge of #19647 - tigercosmos:x3, r=jdm
replace DocumentSource::NotFromParser with DocumentSource::FromParser

<!-- Please describe your changes on the following line: -->
per https://github.com/servo/servo/pull/4297/files#r158729975

---
<!-- 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: -->
- [ ] 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/19647)
<!-- Reviewable:end -->
2018-01-08 11:23:21 -06:00
bors-servo
02f1864770 Auto merge of #19722 - adrian17:master, r=emilio
Remove js.mem.gc.refresh_frame_slices.enabled pref

Clean up after gecko [bug 1421358](https://bugzilla.mozilla.org/show_bug.cgi?id=1421358), which removed the pref entirely.

<!-- 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/19722)
<!-- Reviewable:end -->
2018-01-08 04:52:09 -06:00
bors-servo
7f36b59762 Auto merge of #19602 - tigercosmos:r1, r=KiChjang
implement valid DatetimeLocal input

<!-- Please describe your changes on the following line: -->
implement valid Date time Local input

part of #19172

---
<!-- 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 #19587 fix #19603(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/19602)
<!-- Reviewable:end -->
2018-01-07 05:10:47 -06:00
tigercosmos
b43424111e implement valid Date time Local input 2018-01-07 18:31:32 +08:00
Adrian Wielgosik
7b0b2aae77 Remove js.mem.gc.refresh_frame_slices.enabled pref
Clean up after gecko bug 1421358
2018-01-06 23:11:48 +01:00
tigercosmos
97482f9b91 replace DocumentSource::NotFromParser with DocumentSource::FromParser 2018-01-06 22:53:45 +08:00
bors-servo
989d2fd532 Auto merge of #19644 - Xanewok:root-seq-any, r=jdm
Root sequence<any> params using CustomAutoRooter

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

Attempt at https://github.com/servo/servo/issues/16678. At the moment this pulls an external [remove-handle-conv](https://github.com/Xanewok/rust-mozjs/tree/remove-handle-conv) branch for rust-mozjs (removing `FromJSValConvertible` implementation for `HandleValue` and adding one for `*mut JSObject`)

In short, this roots the `sequence<any>` and `sequence<object>` function arguments using `CustomAutoRooter` (introduced in https://github.com/servo/rust-mozjs/pull/382).

As per https://github.com/servo/servo/issues/16678#issuecomment-302224110 the underlying vector contains raw gc thing pointers instead of handles. To do that, this introduces new possible `isMember = "AutoRoot"` value in CodegenRust.py.
The rooted argument is passed to a function wrapped in a `CustomAutoRooterGuard` [RAII root guard](ed5e37a288/src/rust.rs (L586-L588)) (e.g. as `CustomAutoRooterGuard<Vec<JSVal>>`)

I felt quite out of my depth when trying to adapt CodegenRust.py code, so I'd appreciate any help with how can be done better/in a more clean manner.
Also the name `CustomAutoRooterGuard` is quite lengthy, so I'm also open to changing it (`AutoRoot`? `AutoRootGuard`?)

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

<!-- Either: -->
- [X] 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/19644)
<!-- Reviewable:end -->
2018-01-05 14:02:53 -06:00
Igor Matuszewski
a01d1eabef Root sequence<{any,object}> IDL arguments using CustomAutoRooter
Also pulls in mozjs 0.1.10 to support the change.
2018-01-05 18:21:25 +01:00
Emilio Cobos Álvarez
f3ea248188
style: Remove TNode::set_can_be_fragmented and TNode::can_be_fragmented.
Replace them instead by a computed value flag, the same way as the
IS_IN_DISPLAY_NONE_SUBTREE flag works.
2018-01-04 14:45:54 +01:00