Commit graph

1155 commits

Author SHA1 Message Date
bors-servo
4f36472b6f
Auto merge of #25674 - pshaughn:selection, r=jdm
Selection DOM interface (but not actual UI selections)

This is work towards #7492.

I put new tests in the mozilla-specific directory rather than the main tree because I'm not sure how upstreamable they are; I'd like opinions on that point.

This adds a new exposed interface, which I understand from tests/mozilla/interfaces.html is something requiring specific approval from someone allowed to give that approval.

Things that aren't done here:
- The spec doesn't describe what selection/script-and-style-elements.html wants, and what it wants seems to require some sort of layout query.
- Actual UI interactions are not present at all; selection.rs has a few TODOs saying which methods I believe the eventual UI code should call for what actions, but there are a lot of fine points here that I don't know about.
- I haven't touched Node; you can ask if a node's in the Selection's Range the same way you'd ask about any other Range, but there's not a faster path just for selection layout.
2020-02-14 09:43:10 -05:00
bors-servo
f020536215
Auto merge of #25548 - pshaughn:docnamedgetter, r=jdm
Add SupportedPropertyNames to Document (also fix iframe getting)

Existing test of named-getting an iframe now succeeds. I added a new test for Object.getOwnPropertyNames(document) based on my understanding of the spec; that test could use a second opinion.

UPDATE: This was trying to do too many things in one PR as originally submitted. It is now using #25572 as a base, and I suggest reviewing that PR before this one to avoid duplicating review effort.

---
<!-- 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 #7273 for all implemented named getters, fix #25146, and fix the iframe case only of #25145.

<!-- 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. -->
2020-02-13 20:11:20 -05:00
Patrick Shaughnessy
5ef3358951 Selection interface working for synthetic operations 2020-02-13 20:09:27 -05:00
bors-servo
e697e6cca7
Auto merge of #25488 - pshaughn:clickactivate, r=jdm
Event dispatch rewritten to align to spec, activate on clicks better

I went over the changes to the event dispatch spec that had accumulated over the past few years, rewriting dispatch/invoke/inner-invoke almost completely and modifying other code where it was relevant. Most of the remaining obvious deviations from spec are things that will only come up when we start handling events in shadow DOM.

I am pushing now because I want to see CI test results, but please do not approve this PR just if automated test improvements look good. I may have broken some actual UI interactions in the course of fixing synthetic events, and some manual testing is needed, including checking that manual interactions with interactive content continue to fire the events they're supposed to.

---
<!-- 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 #25384 and fix #22783 and fix #25199

<!-- Either: -->
- [ ] There are automated tests for the synthetic-click parts of these changes, BUT the effects on real UI events need some manual testing before merging

<!-- 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. -->
2020-02-13 17:37:12 -05:00
Patrick Shaughnessy
e48eac6879 Doc named getter improvements 2020-02-13 15:37:03 -05:00
Patrick Shaughnessy
f29e22f131 Names should now be consistently atoms 2020-02-13 11:21:46 -05:00
Patrick Shaughnessy
01aba1fcc4 Event dispatch rewritten to resemble spec more often, activate on clicks better 2020-02-12 15:57:37 -05:00
Kunal Mohan
5a3e1b8e69
rename compartment to realm 2020-01-24 20:52:36 +05:30
Kunal Mohan
f7db4b7f80
Modify script to prevent further violations of snake_case 2020-01-18 14:22:15 +05:30
Kunal Mohan
02c1612cb0
Add accountable-refcell as optional build time feature 2020-01-08 09:44:41 +05:30
bors-servo
e185423fc7
Auto merge of #25310 - pshaughn:attr_node, r=Manishearth
Attr is a Node, with consequences for many Node methods

<!-- Please describe your changes on the following line: -->
Attr is now a Node, as current WHATWG specs require. I think I did some unidiomatic things to make compareDocumentPosition work and it could use a look by someone more familiar with how to write concise Rust code. I also think the new cases in compareDocumentPosition lack tests; it is possible to compare the position of two attributes, or of an attribute and an element, and I don't think any tests are exercising that functionality.

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

<!-- Either: -->
- [ ] There are tests for these changes (existing cases of Node methods are well-tested, and there is a WPT test specifically for whether Attr is Node, but I'm not sure about new Node method cases)

<!-- 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. -->
2020-01-07 18:13:40 -05:00
Patrick Shaughnessy
3bd30afcf3 Just the code, no metadata for now 2020-01-02 10:23:44 -05:00
Patrick Shaughnessy
67e9fc8c0a Attr is a Node, with consequences for many Node methods 2019-12-23 19:10:16 -05:00
Patrick Shaughnessy
8184a25c17 createElement can now take an ignored string for options 2019-12-23 11:35:32 -05:00
bors-servo
bac9903fbe
Auto merge of #24123 - gterzian:redo_blob, r=jdm
Restructure Blob, structured serialization

<!-- Please describe your changes on the following line: -->
FIX #24052 and also address the "cloning" half of FIX #23917

---
<!-- 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/24123)
<!-- Reviewable:end -->
2019-12-19 16:16:56 -05:00
Patrick Shaughnessy
ec70f42638 Removed createEvent cases, removed now-unused new_uninitializeds 2019-12-12 11:33:32 -05:00
takumi
de939eb96d implement composition event creation in Document.createEvent 2019-12-12 10:45:22 +09:00
Gregory Terzian
6e8a85482c re-structure blob, structured serialization 2019-12-11 22:46:50 +08:00
Josh Matthews
aa7a52c05e
dom: Unindent Document::set_activity. 2019-11-21 10:14:28 -05:00
Simon Sapin
bea73951db Use #![register_tool] instead of #![register_attr]
CC https://github.com/rust-lang/rust/issues/66079
2019-11-15 17:24:42 +01:00
bors-servo
f3b1f0d308
Auto merge of #24624 - garasubo:fix-keypress-trigger, r=paulrouget
Fix keypress trigger condition

Fix #22346

keypress event should be triggered for keys representing character
values. So, we should trigger this event for enter key.
This event should not trigger for IME inputs.

TODO:
- It seems we don't handle composition events correctly. To implement this keypress condition correctly, we should fix that first. In my current implementation, onkeypress event will be trigger when the user press Enter key to send inputs in IME (onCompotionEnd).
- I don't update any tests, and I couldn't find any tests related to this change in WPT. It might be better to add some tests for it, but I don't know what is the appropriate way.

<!-- 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 #___ (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. -->
2019-11-14 06:51:33 -05:00
takumi
b30fc2d19e Solve #22346
keypress event should be triggered for keys representing character
values. So, we should trigger this event for enter key.
This event should not trigger for IME inputs.
2019-11-03 18:07:25 +09:00
Patrick Walton
a358bca766 Use surfman for managing GL surfaces
Co-authored-by: Alan Jeffrey <ajeffrey@mozilla.com>
Co-authored-by: Zakor Gyula <gyula.zakor@h-lab.eu>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2019-11-01 08:47:11 -05:00
takumi
3af931004f Fix the condition to keep original logic
Address this PR comment: https://github.com/servo/servo/pull/24489/files#diff-30a18e04d7e0b66aafdf192e416cad44R1472
This commit was failed to add in PR #24489.

Issue: #22782
2019-10-25 22:17:25 +09:00
bors-servo
e26530341b
Auto merge of #24489 - garasubo:refactor-submission, r=nox
Refactor submission

This is my first contribution, so please correct me if I'm wrong

I refactored the code as described #22782.

---
<!-- 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 #22782  (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. -->
2019-10-22 22:05:09 -04:00
Gregory Terzian
2f8932a6a1 continue messageport, transferable, postmessage options 2019-10-19 14:28:18 +08:00
takumi
7ce40080bf [WIP] solve #22782
TODO: write tests for my change
2019-10-18 15:00:03 +09:00
Michael Howell
b8f3e8bb2e Add simple implementation of content-security-policy on scripts / styles
This needs a lot more hooks before it'll actually be a good
implementation, but for a start it can help get some feedback on if this
is the right way to go about it.

Part of servo/servo#4577
2019-10-16 19:46:45 +00:00
Josh Matthews
c53680b282 webgl: Lazily clear the canvas right before the first webgl command of the next frame. 2019-10-10 09:57:20 -04:00
Kris Tokarz
b567cc76e5 Change setBody to be less strict when getting the immediate child
Step four of the dom document body calls for throwing an exception
if no document element was found. The current setBody implementation
was looking for a document element that is also an html element. It
has been updated to use GetDocumentElement which returns any document
element.
2019-09-29 07:34:36 -04:00
Fernando Jiménez Moreno
d7bebce537 Suspend/resume media activity based on document activity 2019-09-19 18:39:36 +02:00
Bastien Orivel
ec6b478775 Update Window::open and document::open parameters to match the spec
Fixes #24012
2019-08-24 17:22:44 +02:00
Simon Sapin
9392180007 Update to url 2.0 2019-08-17 10:03:44 +02:00
Simon Sapin
c38c964f1b Upgrade to rustc 1.38.0-nightly (dddb7fca0 2019-07-30) 2019-07-31 13:34:01 +02:00
marmeladema
2c5d0a6ebc Convert CGTraitInterface to use safe JSContext instead of raw JSContext 2019-07-24 08:24:50 +01:00
Emilio Cobos Álvarez
3d57c22e9c Update euclid.
There are a few canvas2d-related dependencies that haven't updated, but they
only use euclid internally so that's not blocking landing the rest of the
changes.

Given the size of this patch, I think it's useful to get this landed as-is.
2019-07-23 23:09:55 +02:00
Fernando Jiménez Moreno
ef02196dd8 More detach shadow changes 2019-07-22 17:40:17 +02:00
Fernando Jiménez Moreno
f8ae394cad Remove extra hash-map lookup unregistering media controls 2019-07-22 17:40:16 +02:00
Fernando Jiménez Moreno
e344203c11 Only allow UA widgets as children of media elements
Do not allow pseudo-elements for replaced elements
2019-07-22 17:40:15 +02:00
Fernando Jiménez Moreno
23def72787 Implement method to remove media controls 2019-07-22 17:40:15 +02:00
Fernando Jiménez Moreno
1c02fc94a8 Barebones media UI 2019-07-22 17:40:14 +02:00
Robert Snakard
35bca991ad Implement WheelEvent Interface
Note: The WheelEvent interface supports rotation in all 3 spatial
dimensions. This implementation only supports two due to limitations
in the Glutin compositor.

The wheelevent interface is a dom interface that triggers for any
attached device that can rotate in one or more spatial dimensions.
Traditionally this is the mouse wheel though other devices could be
used as well. E.g. the trackball on a trackball mouse.
2019-06-09 13:25:01 -04:00
est31
8b6ed3d182 Remove unused code from script* crates 2019-06-02 07:12:26 +02:00
George Roman
be3cb00c77 Implement MouseEvent buttons attribute 2019-05-16 10:59:20 +03:00
bors-servo
852223b08a
Auto merge of #23253 - BartGitHub:refactor-promise-compartment, r=jdm
Refactor promise compartment

<!-- Please describe your changes on the following line: -->
This PR adds a mechanism to verify that certain code is executed inside a ```JSAutoCompartment```, and applies this to the ```Promise::new_in_current_compartment``` constructor.

r? @jdm

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

<!-- Either: -->
- [x] These changes do not require tests because they do not change existing functionality.

<!-- 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/23253)
<!-- Reviewable:end -->
2019-04-29 13:59:04 -04:00
Fernando Jiménez Moreno
d0b2e826ef Move StylesheetSetRef to script 2019-04-26 12:00:26 +02:00
Fernando Jiménez Moreno
e4f34fde1b Rename StylesheetSet to StylesheetSetRef 2019-04-26 12:00:26 +02:00
Fernando Jiménez Moreno
59c634b259 Set dirty descendants if node is connected 2019-04-26 12:00:26 +02:00
Fernando Jiménez Moreno
8eba587547 Merge Node::shadow_including_inclusive_ancestors into inclusive_ancestors 2019-04-26 11:42:38 +02:00
Fernando Jiménez Moreno
bdd2f32c0f Minor tweaks: rename composed_parent_node_ref, remove or update outdated comments... 2019-04-26 11:42:37 +02:00