Commit graph

972 commits

Author SHA1 Message Date
Josh Matthews
02ce6188aa Update devtools page titles. 2020-04-28 15:40:38 -04:00
Anthony Ramine
8a0775fc89 Kill ServoLayoutElement::note_dirty_descendant
There is no need to set the dirty descendants flag unsafely from the layout side
for elements with pending restyles, we can do that on the DOM side when draining
the restyles from the Document.
2020-04-04 15:00:04 +02:00
bors-servo
af1ebe79ef
Auto merge of #26083 - servo:layout-2020-more-cleanups, r=jdm
More layout cleanups from the introduction of a lifetime in LayoutDom<T>

What can I say, the follow-up fixes just kept coming to my door one by one, I couldn't just tell them to go away.
2020-04-01 12:05:16 -04:00
Anthony Ramine
0c0027ecfd Make LayoutDocumentHelpers::style_shared_lock be safe
StyleSharedRwLock is Sync.
2020-04-01 11:40:55 +02:00
Josh Matthews
6ab7a50b31 Cache the result of retrieving an element's client rectangle from layout. 2020-03-31 17:15:44 -04:00
Anthony Ramine
72c0771299 Make a bunch of LayoutDocumentHelpers be safe
The other methods are actually unsafe.
2020-03-31 21:39:45 +02:00
Anthony Ramine
9b2debe678 Give a lifetime parameter to LayoutDocumentHelpers 2020-03-29 19:29:02 +02:00
Anthony Ramine
dba6a635e5 Give a lifetime parameter to LayoutDom 2020-03-28 15:37:57 +01:00
Anthony Ramine
60ca98b753 Pass pending restyles instead of draining them from layout 2020-03-28 15:37:56 +01:00
Anthony Ramine
df0118dd10 Move PendingRestyle to the style_layout_interface crate 2020-03-28 14:00:53 +01:00
Akshat Agarwal
2e1009da75 Removed createTouch and createTouchList 2020-03-24 03:41:42 +05:30
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Paul Rouget
21c408e0d5 Stop embedder calls and fake rAF when window not visible 2020-03-06 06:20:11 +01:00
bors-servo
134d1f9f31
Auto merge of #25428 - pshaughn:livebyname, r=jdm
make Document.getElementsByName a live collection

Another new case for NodeList; this and the labels live collection in #25424 are in the pipeline simultaneously, so one of them will need a merge resolution when the other one lands.

Iterating over many same-named elements is potentially slower than it has to be, since getting the nth element from the live view always starts from the start of the tree.

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

<!-- 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-28 11:43:55 -05:00
Josh Matthews
f02e516f32 Remove unnecessary Option. 2020-02-24 15:58:58 -05:00
Manish Goregaokar
f3e1aba4e3 Add profiling for WebXR 2020-02-22 22:00:05 -08:00
Patrick Shaughnessy
007a6cd050 make Document.getElementsByName a live collection 2020-02-15 10:16:29 -05:00
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