aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
Commit message (Collapse)AuthorAgeFilesLines
...
| * 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.
| * "javascript:" urls: evaluate in iframe src attributeDaniel Johnson2017-08-281-25/+23
| | | | | | | | | | | | | | | | - generalize the eval_js_url function so it can be called from multiple places. - call it in htmliframeelement. - if the js eval results in a non-string result, then it won't navigate to a new page, so don't block on the new page loading.
| * "javascript:" urls: clean up js evaluation codeDaniel Johnson2017-08-281-48/+50
| | | | | | | | | | | | - move it to its own function - move the `url = "about:blank" code into the same block - move the `use` statement to the top of the file
| * "javascript:" urls: clean up after aborting a page loadDaniel Johnson2017-08-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: After aborting on a 204 or 205 status code, you could no longer follow links on the page. Cause: `constellation.rs` ignores new LoadUrl requests since the aborted one is in its `pending_changes` list. Solution: Send a message to constellation that lets it clean up its `pending_changes` list.
| * "javascript:" urls: run in correct globalDaniel Johnson2017-08-221-44/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make some changes to javascript scheme url evaluation to bring it closer to https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigating-across-documents - Evaluate the js before the page load so that it happens in the correct `window` global. - If the result is not a string, the response should be a 204. This required saving some data in load_data, since it's not possible to modify the response at the point where we're evaluating the js.
* | Panic from the default impl of Runnable::handlerAnthony Ramine2017-09-081-1/+3
| | | | | | | | | | This will allow us to make sure that tasks using main_thread_handler don't actually get consumed through a call to the bare handler method.
* | Reformat some task-related functionsAnthony Ramine2017-09-081-10/+12
| |
* | Kill UserInteractionTaskAnthony Ramine2017-09-081-5/+1
| | | | | | | | Just use a bare Runnable value.
* | Kill DOMManipulationTaskAnthony Ramine2017-09-081-5/+1
| | | | | | | | Just use a bare Runnable value.
* | Kill Runnable::is_cancelled ⚔️Anthony Ramine2017-09-071-13/+19
| |
* | Make Performance Timeline API work in WorkersFernando Jiménez Moreno2017-09-051-10/+6
| |
* | move name implementation as default implementation to the trait and remove ↵toidiu2017-09-031-3/+1
| | | | | | | | overrides.
* | change function signature to get type name via intrinsicstoidiu2017-09-031-1/+2
| |
* | Add paint metrics to Performance Timeline APIFernando Jiménez Moreno2017-08-231-2/+20
|/
* Wait for actual paint before setting paint related metricsFernando Jiménez Moreno2017-08-221-1/+3
|