Commit graph

765 commits

Author SHA1 Message Date
Martin Robinson
edeb24b30f Fix scrolling on root element
eca0acf459 uncovered a bug in the way that
the scrolling area of `window` was calculated and broke scrolling on the
root element. This change does two things in order to fix that:

1. Does a partial revert of eca0acf459 in
   order to get scrolling from script working again on the window
   object.
2. Has the compositor always generate a frame for scrolls starting from
   script and waits for them. This is speculative fix for flakiness in
   root scrolling tests on CI.
2023-05-05 12:42:02 +02:00
Martin Robinson
eca0acf459 Allow script to scroll overflow: scroll elements
Before the code was only allowing `overflow: hidden` elements to scroll.
This fixes that issue and also clean up the code that deals with
detecting whether the body is a "potentially scrollable" in quirks mode.
2023-04-25 21:25:00 +02:00
Martin Robinson
3ab5e2a188 Scroll from script should trigger a reflow
Scrolling from script should flow layout and send a display list to
WebRender. This allows all of the scroll nodes to exist in WebRender
before asking it to move the node.

See https://gist.github.com/paulirish/5d52fb081b3570c81e3a.
Fixes #29659.
2023-04-25 21:25:00 +02:00
Delan Azabani
dd905d8434 clean up spurious changes and todos with no action needed 2023-03-23 18:07:39 +08:00
Delan Azabani
1f74d4c75b revert: Introduce Untransplantable trait to indicate transplantability at the type level
(8f7b0cff87f0eab921e13e6990d76e12935e8675)
2023-03-23 18:06:17 +08:00
Delan Azabani
4c7f198ee2 apply yvt/servo/fix-named-window-getter 2023-03-23 18:02:35 +08:00
Delan Azabani
fd1de05592 apply pylbrecht/servo/named.window.getter (closes #27952) 2023-03-23 18:01:26 +08:00
Emilio Cobos Álvarez
31e8e418ea Miscellaneous build / tidy fixes. 2021-02-26 17:53:55 +01:00
teymour-aldridge
ff767b13a9 Remove unused arguments from methods. 2021-02-05 14:29:45 +00:00
Jonathan Kingston
0e1479cc84 Add creation url and Secure Contexts 2020-11-25 18:30:50 +00:00
Josh Matthews
4dd7387799 dom: Add Window.js_backtrace debugging extension method. 2020-07-14 22:39:59 -04:00
bors-servo
1cd78e78f6
Auto merge of #26998 - gterzian:improve_task_cancelling, r=jdm
Use a stronger atomic guarantee when cancelling tasks

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

In the context of https://github.com/servo/servo/issues/22507

Note that the "other side" of these operations is at 0b61cfc3ae/components/script/task.rs (L102)

---
<!-- 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. -->
2020-07-06 11:11:25 -04:00
Antoine Martin
36fbbea2b5 Return Option for Window's layout channel 2020-07-03 20:00:26 +02:00
Gregory Terzian
58259c199a use a stronger atomic guarantee when cancelling tasks 2020-06-20 13:35:24 +08:00
Kunal Mohan
71401e0855 Implement GPUSwapChain and GPUCanvasContext and interface with Webrender 2020-06-13 17:46:12 +05:30
Utsav Oza
15fd256302 Store resolved font style in canvas context state 2020-06-10 22:10:44 +05:30
Utsav Oza
f3cb7a1910 Add todos for missing steps while processing parse font query 2020-06-10 22:10:43 +05:30
Utsav Oza
7883718c12 Query layout to resolve canvas font property value 2020-06-10 22:10:42 +05:30
bors-servo
ff3d5c5125
Auto merge of #26628 - gterzian:shutdown_workers, r=asajeffrey
Improve worker shutdown

<!-- Please describe your changes on the following line: -->
FIX #26548
FIX #25212

and also  a step towards https://github.com/servo/servo/issues/26502

---
<!-- 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. -->
2020-06-03 13:44:09 -04:00
Gregory Terzian
6f34b52e39 properly shutdown dedicated workers when the owning scope shuts-down 2020-06-03 12:32:45 +08:00
skrzyp1
ee6906443f reading unminified scripts from disk 2020-06-02 21:23:45 +02:00
Martin Robinson
47642e0eee Have Animations struct handle rooting nodes
Instead of having `ScriptThread` handle rooting nodes, do this in
`Animations`. This makes it easier to know when it is appropriate to
root and unroot nodes instead of relying on a certain order of events.
This also allows reducing quite a bit the amount of unsafe code.
2020-05-26 20:24:28 +02:00
Martin Robinson
873cdd1336 Implement animationiteration event
This event is triggered when an animation iterates. This change also
moves iteration out of style calculation to an "update animations" which
is the next part of having animation event handling match the HTML spec.
2020-05-21 15:19:34 +02:00
Anthony Ramine
036f123c4e Implement concept of dirty root 2020-05-19 16:26:36 +02:00
Kunal Mohan
e5065c7eb2 Share single gpu_id_hub among all threads in a process 2020-05-15 01:15:01 +05:30
Josh Matthews
097a84671a dom: Implement current window event. 2020-05-13 14:36:32 -04:00
Martin Robinson
3b0619aedd Move most animation processing to script
This is preparation for sharing this code with layout_2020 and
implementing selective off-the-main-thread animations.

We still look for nodes not in the flow tree in the layout thread.
2020-05-12 10:22:14 +02:00
Martin Robinson
3a74013abc Start having animations conform to the HTML spec
This is a small step toward fixing #19242. The main idea is that the
clock for animations should advance as the event loop ticks. We
accomplish this by moving the clock from layout and naming it the
"animation timeline" which is the spec language. This should fix
flakiness with animations and transitions tests where a reflow could
move animations forward while script was running.

This change also starts to break out transition and animation events
into their own data structure, because it's quite likely that the next
step in fixing #19242 is to no longer send these events through a
channel.
2020-05-05 20:08:44 +02:00
Martin Robinson
b585ce5b1f Use a restyle for animation ticks
This change corrects synchronization issues with animations, by
reworking the animation processing model to do a quick restyle and
incremental layout when ticking animations.

While this change adds overhead to animation ticks, the idea is that
this will be the fallback when synchronous behavior is required to
fulfill specification requirements. In the optimistic case, many
animations could be updated and applied off-the-main-thread and then
resynchronized when style information is queried by script.

Fixes #13865.
2020-05-05 15:13:35 +02:00
Utsav Oza
86a5cf75aa Update window.open() to return fallible result 2020-05-04 19:02:38 +05:30
Martin Robinson
3903c1fb98 Add support for animationend event
This is triggered when an animation finishes. This is a high priority
because it allows us to start rooting nodes with animations in the
script thread.

This doesn't yet cause a lot of tests to pass because they rely on the
existence of `Document.getAnimations()` and the presence of
`animationstart` and animationiteration` events.
2020-05-01 15:29:57 +02:00
bors-servo
39e4eb43c3
Auto merge of #26296 - ramyananth:master, r=jdm
Implementing createImageBitmap

<!-- Please describe your changes on the following line: -->
Implementing createImageBitmap method for canvas image source.

---
<!-- 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 #20650 (GitHub issue number if applicable)

<!-- 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-04-30 12:05:21 -04:00
JayalakshmiV
ef6f99d8f5 implemented CreateImageBitmap function for Canvas image source 2020-04-29 21:51:10 -04:00
Josh Matthews
7c48644cad Support navigating browsing contexts in the devtools.
Break the association between pipelines and browsing context actors.
Now there is one browsing context actor per actual browsing context,
and individual actors keep track of known pipelines as necessary.
There is also one console/performance/timeline/inspector/etc. actor
per browsing context.

This also centralizes more information in the browsing context actor.
Rather than duplicating state for the active pipeline in actors that
need to use it, each actor now remembers the name of its associated
browsing context actor and obtains that state whenever it's necessary.
2020-04-26 18:11:23 -04:00
Alan Jeffrey
c611e46381 Remove WebVR 2020-04-08 20:23:41 -05:00
Anthony Ramine
c10e839924 Don't go through the layout thread to retrieve a node's primary style 2020-04-07 14:34:47 +02:00
Anthony Ramine
185a402d9c Make DOM own the style and layout data, in an UnsafeCell
The previous Cell was a lie.
2020-04-04 13:10:19 +02:00
bors-servo
2c0bbcf2aa
Auto merge of #26077 - jdm:xr-canvas-dirty, r=asajeffrey
webgl: Don't dirty canvas element while in immersive mode.

There are various WebGL APIs that are supposed to trigger a frame composite at the end of the event loop when they're used. We enforce this via dirtying the canvas element and ensuring that reflow occurs for normal content. This is redundant when we're using immersive mode and incurs extra work by the layout thread and compositor that inhibits the immersive rendering performance.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix (part of) #26019
- [x] These changes do not require tests because we do not have infrastructure to test immersive mode on CI.
2020-03-31 22:23:32 -04:00
Josh Matthews
ab75808b8c webgl: Don't dirty canvas element while in immersive mode. 2020-03-31 17:17:51 -04: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
60ca98b753 Pass pending restyles instead of draining them from layout 2020-03-28 15:37:56 +01:00
Josh Matthews
2aa415a3ff
Force alert message to its own line. 2020-03-23 11:08:42 -04:00
Paul Rouget
21c408e0d5 Stop embedder calls and fake rAF when window not visible 2020-03-06 06:20:11 +01:00
gatowololo
24c14ac94e Factored out permission_state_invocation_results API to GlobalScope
Instead of Window
2020-02-27 00:02:04 +02:00
Gregory Terzian
eb21d5f738 implement broadcastchannel 2020-02-25 14:17:48 +08:00
Josh Matthews
1449bac0e1 Avoid accessing node global during Node's destructor. 2020-02-24 16:27:40 -05:00
Josh Matthews
f02e516f32 Remove unnecessary Option. 2020-02-24 15:58:58 -05:00
bors-servo
35b1548cb6
Auto merge of #25777 - kunalmohan:24720-ImageCache, r=jdm
Take origin from current window instead of creating a new one in event of reflow

Everytime a new `LayoutContext` was created, it created a new origin which
caused endless stream of image loads to occur in case of reflow. The reason
for this was that the existing image, although cached successfully, was not
used because the entry in hashmap did not match because of different(new)
origin.
This is solved by storing the origin of a window in enum `ScriptReflow` and
used in creating new `LayoutContext` in case of reflow.

<!-- Please describe your changes on the following line: -->
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 #24720  (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. -->
2020-02-19 13:51:30 -05:00
Kunal Mohan
4a3bf52a7c
remove option for origin and mirror changes to layout_thread_2020 2020-02-18 00:57:33 +05:30
CYBAI
403ffcf1eb Always pass InRealm to GlobalScope::from_context to avoid getting null global 2020-02-16 09:55:10 +09:00