aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
Commit message (Collapse)AuthorAgeFilesLines
* constellation: Make setting up the WebGL state fallible.Emilio Cobos Álvarez2018-03-091-3/+3
| | | | | | | | | | This fixes a regression caused by the glutin update. We now are creating EGL contexts in Linux Wayland, instead of X context, so the GLContextFactory assumption of one GL back-end per platform is broken. This just works around it, for now, but in general I think not relying on available WebGL state is a good thing, and we do that already for WebVR anyway.
* Auto merge of #20012 - ↵bors-servo2018-02-271-2/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | alexfjw:avoid_Window-GetComputedStyle_when_checking_for_display-none, r=emilio Avoid `Window::GetComputedStyle` when checking for `display: none` <!-- Please describe your changes on the following line: --> Refactored Window::GetComputedStyle to use Element::Style. Not sure which tests are relevant, but I've ran the dom, fetch & 2dcontext wpt tests. They don't seem to give errors. --- <!-- 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 #19885. <!-- Either: --> - [x] These changes do not require tests because it's a refactoring task <!-- 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/20012) <!-- Reviewable:end -->
| * Avoid `Window::GetComputedStyle` when checking for `display: none`Alex Fong2018-02-261-2/+1
| |
* | remove mozbrowser codePaul Rouget2018-02-131-48/+16
| |
* | remove forcetouch supportPaul Rouget2018-02-111-15/+1
|/
* Updated content_type of Document and XMLDocument from DOCString to MimeNupur Baghel2018-02-091-1/+1
|
* Print url of recorded PWMFernando Jiménez Moreno2017-12-071-1/+2
|
* Use FetchCanceller for document loadsManish Goregaokar2017-11-221-3/+10
|
* added navigation start for interactive metricsddh2017-11-141-0/+4
|
* changed f64 to u64 for navigation start timing until it had to be floatddh2017-11-011-3/+3
|
* Bump bitflags to 1.0 in every servo crateBastien Orivel2017-10-301-2/+2
|
* added pipelines to all task sourcesddh2017-10-251-55/+59
| | | | changed task sources to accept pipeline ids
* added time to interactive metrics, refactored metrics to use traitsddh2017-10-241-16/+103
| | | | changed task macro to take pipeline info
* Auto merge of #18968 - mbrubeck:try, r=emiliobors-servo2017-10-211-4/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | Use try syntax for Option where appropriate - [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 they are refactoring only <!-- 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/18968) <!-- Reviewable:end -->
| * Use try syntax for Option where appropriateMatt Brubeck2017-10-201-4/+1
| |
| * Auto merge of #18809 - Eijebong:bitflags, r=noxbors-servo2017-10-191-2/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update bitflags to 1.0 in every servo crate It still needs dependencies update to remove all the other bitflags versions. - [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's a dependency update <!-- 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/18809) <!-- Reviewable:end -->
| | * Update bitflags to 1.0 in every servo crateBastien Orivel2017-10-191-2/+2
| | | | | | | | | | | | | | | It still needs dependencies update to remove all the other bitflags versions.
* | | Do not trace Rust values when thread is shutting down.Josh Matthews2017-10-201-2/+1
|/ /
* | Auto merge of #18944 - servo:jemallocator2, r=noxbors-servo2017-10-191-2/+2
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | Stop relying on linking details of std’s default allocator We’ve been bitten before by symbol names changing: https://github.com/servo/heapsize/pull/46, and upstream is planning to stop using jemalloc by default: https://github.com/rust-lang/rust/issues/33082#issuecomment-309781465 So use the (relatively) new `#[global_allocator]` attribute to explicitly select the system allocator on Windows and jemalloc (now in an external crate) on other platforms. This choice matches current defaults. <!-- 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/18944) <!-- Reviewable:end -->
| * Stop relying on linking details of std’s default allocatorSimon Sapin2017-10-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | We’ve been bitten before by symbol names changing: https://github.com/servo/heapsize/pull/46 and upstream is planning to stop using jemalloc by default: https://github.com/rust-lang/rust/issues/33082#issuecomment-309781465 So use the (relatively) new `#[global_allocator]` attribute to explicitly select the system allocator on Windows and jemalloc (now in an external crate) on other platforms. This choice matches current defaults.
* | Auto merge of #18933 - mrobinson:wr-text-index, r=jdmbors-servo2017-10-191-4/+13
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use WebRender to compute text index on click events This is the second half of switching over to WebRender for hit testing. Now that WebRender gives us the location of the hit tested point in the display item, we can use that to calculate text index. <!-- 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 - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because they shouldn't change behavior. <!-- 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/18933) <!-- Reviewable:end -->
| * Use WebRender to compute text index on click eventsMartin Robinson2017-10-181-4/+13
| | | | | | | | | | | | This is the second half of switching over to WebRender for hit testing. Now that WebRender gives us the location of the hit tested point in the display item, we can use that to calculate text index.
* | Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-3/+7
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`. `malloc_size_of` is better -- it handles various cases that `heapsize` does not -- so this patch changes Servo to use `malloc_size_of`. This patch makes the following changes to the `malloc_size_of` crate. - Adds `MallocSizeOf` trait implementations for numerous types, some built-in (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`). - Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't support that operation. - For `HashSet`/`HashMap`, falls back to a computed estimate when `enclosing_size_of_op` isn't available. - Adds an extern "C" `malloc_size_of` function that does the actual heap measurement; this is based on the same functions from the `heapsize` crate. This patch makes the following changes elsewhere. - Converts all the uses of `heapsize` to instead use `malloc_size_of`. - Disables the "heapsize"/"heap_size" feature for the external crates that provide it. - Removes the `HeapSizeOf` implementation from `hashglobe`. - Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of` doesn't derive those types, unlike `heapsize`.
* Auto merge of #18704 - mrobinson:wr-hit-testing, r=jdm,glennw,mbrubeckbors-servo2017-10-171-22/+51
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to using WebRender hit testing This trades quite a bit of complicated code in Servo for few more messages and a significant performance improvement. In particular, WebRender can search the entire display list at once instead of ping-ponging down the pipeline tree. This allows us to send mouse events to the correct pipeline immediately. <!-- 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 - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because they should not change behavior. <!-- 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/18704) <!-- Reviewable:end -->
| * Switch to using WebRender hit testingMartin Robinson2017-10-171-22/+51
| | | | | | | | | | | | | | | | This trades quite a bit of complicated code in Servo for few more messages and a significant performance improvement. In particular, WebRender can search the entire display list at once instead of ping-ponging down the pipeline tree. This allows us to send mouse events to the correct pipeline immediately.
* | Fix commonmark Markdown warnings in docs, part 1Matt Brubeck2017-10-171-4/+4
|/ | | | | | | | Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is passed to rustdoc. This is mostly a global find-and-replace for bare URIs on lines by themselves in doc comments.
* Implement DOM to textureImanol Fernandez2017-10-161-0/+7
|
* Remove use of unstable box syntax.Simon Sapin2017-10-161-3/+3
| | | | | | | | | | | | | | | | | | | | http://www.robohornet.org gives a score of 101.36 on master, and 102.68 with this PR. The latter is slightly better, but probably within noise level. So it looks like this PR does not affect DOM performance. This is expected since `Box::new` is defined as: ```rust impl<T> Box<T> { #[inline(always)] pub fn new(x: T) -> Box<T> { box x } } ``` With inlining, it should compile to the same as box syntax.
* Combine ReflowGoal and ReflowQueryTypeMartin Robinson2017-09-301-12/+5
| | | | | This simplifies the logic in the layout_thread and makes it clearer which types of reflows generate display lists and cause display updates.
* Move STACK_ROOTS to dom::bindings::rootAnthony Ramine2017-09-271-2/+1
|
* Move script_runtime::StackRootTLS to root::ThreadLocalStackRootsAnthony Ramine2017-09-271-3/+3
|
* Rename Root<T> to DomRoot<T>Anthony Ramine2017-09-261-29/+29
| | | | | | | In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>, where Root<T> will be able to handle all the things that need to be rooted that have a stable traceable address that doesn't move for the whole lifetime of the root. Stay tuned.
* Rename DOMRefCell<T> to DomRefCell<T>Anthony Ramine2017-09-261-17/+17
| | | | | | | | I don't want to do such a gratuitous rename, but with all the other types now having "Dom" as part of their name, and especially with "DomOnceCell", I feel like the other cell type that we already have should also follow the convention. That argument loses weight though when we realise there is still DOMString and other things.
* Rename MutNullableJS<T> to MutNullableDom<T>Anthony Ramine2017-09-261-3/+3
|
* Rename JS<T> to Dom<T>Anthony Ramine2017-09-261-15/+15
|
* Rename dom::bindings::js to dom::bindings::rootAnthony Ramine2017-09-261-2/+2
|
* Remove sources of panic when laying out an iframe without a nested browsing ↵Alan Jeffrey2017-09-221-12/+29
| | | | context.
* Rename Task to TaskBoxAnthony Ramine2017-09-201-1/+1
|
* Move Task to its own moduleAnthony Ramine2017-09-181-59/+0
|
* Introduce MainThreadScriptMsg::DispatchJobQueueAnthony Ramine2017-09-171-23/+13
| | | | This removes the last remaining use of Task::run_with_script_thread
* Remove uses of AsyncJobHandler from script_threadAnthony Ramine2017-09-171-3/+3
|
* Introduce MainThreadScriptMsg::RegisterPaintWorkletAnthony Ramine2017-09-171-9/+43
| | | | | This avoids the need for a generic task to send messages to the layout thread through the main script thread.
* Rename Runnable to TaskAnthony Ramine2017-09-161-28/+33
| | | | | | | | | | | | The changes are: * `*Runnable` -> `*Task`; * `RunnableMsg` -> `Task`; * `RunnableWrapper` -> `TaskCanceller`; * `MainThreadRunnable` -> `MainThreadTask`; * `wrap_runnable` -> `wrap_task`; * `get_runnable_wrapper` -> `task_canceller`; * `handler` -> `run`; * `main_thread_handler` -> `run_with_script_thread`.
* Introduce MainThreadScriptMsg::MainThreadRunnableAnthony Ramine2017-09-161-5/+10
| | | | | This will allow us to separate the types for tasks that must run on the main script thread and regular tasks.
* Put the name of runnables in Debug for CommonScriptMsgAnthony Ramine2017-09-161-0/+7
|
* Store a Rc<MicrotaskQueue> directly on WindowAnthony Ramine2017-09-131-0/+1
|
* Store microtask queues in Rc<T>Anthony Ramine2017-09-131-2/+3
|
* Avoid a clone in ScriptThread::newAnthony Ramine2017-09-131-29/+31
|
* Auto merge of #17083 - danielj41:javascript-url-global-3, r=jdmbors-servo2017-09-091-44/+78
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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 -->
| * "javascript:" urls: remove unnecessary blockDaniel Johnson2017-09-071-32/+30
| | | | | | | | | | | | | | 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.