servo/components
bors-servo ddc85098af
Auto merge of #22051 - mandreyel:track-focused-bc-of-each-tlbc, r=cbrewster
Update Constellation to track each browser's focused browsing context

Since there may be multiple browsers (top-level browsing contexts), each has a focused browsing context. However, we were not keeping track of each browser's focused browsing context, so e.g when switching tabs the `Constellation::focused_browsing_context_id` would not be set to the switched-to browser's focused browsing context.

This PR introduces a `browser_ids` `HashMap` in constellation, that maps each of the top-level browsing context's ids to their currently focused browsing context's id, so that when the active browser is changed with the `SelectBrowser` message, we can look up and restore the selected browser's focused browsing context.

This is a wip. For one, I'm not a fan of adding another hash map to constellation, and since there already is a hash map for keeping track of a browser's joint session history, we could introduce some `Browser` struct to hold data for a browser like its session history and focused browsing context (and possibly more later). But wanted to implement the bare-bones logic to first ensure correctness and will refactor later. Also, we may need new tests but I'm not sure.

---
<!-- 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 #17401 (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/22051)
<!-- Reviewable:end -->
2018-11-05 13:23:30 -05:00
..
allocator Format component allocator #21373 2018-08-16 15:44:54 +08:00
atoms style: Add the safe area constant names as atoms. 2018-11-05 12:36:14 +01:00
bluetooth Add a build switch to disable the native bluetooth backend. 2018-10-30 19:26:42 -04:00
bluetooth_traits Add lots of derived Debug impls 2018-10-29 09:21:37 -05:00
canvas Update remaining references to cssparser 0.24. 2018-11-05 12:33:37 +01:00
canvas_traits Update remaining references to cssparser 0.24. 2018-11-05 12:33:37 +01:00
channel add servo_channel crate 2018-09-12 11:25:45 +08:00
compositing Removed unused in_scroll_transaction and removed import of std::time:Instant since it was only used by in_scroll_transaction. 2018-11-04 13:00:39 -05:00
config Add lots of derived Debug impls 2018-10-29 09:21:37 -05:00
constellation Remove Constellation::focused_browsing_context_id 2018-11-02 21:44:32 +01:00
debugger Replace mpsc with crossbeam/servo channel, update ipc-channel 2018-09-12 13:33:32 +08:00
deny_public_fields Format components debugger and deny_public_fields #21373 2018-09-01 09:44:53 +08:00
devtools Update hyper to 0.12 2018-11-01 19:17:36 +01:00
devtools_traits Update hyper to 0.12 2018-11-01 19:17:36 +01:00
dom_struct Format components dom_struct, domobject_derive and embedder_traits #21373 2018-09-03 08:19:25 +08:00
domobject_derive Format components dom_struct, domobject_derive and embedder_traits #21373 2018-09-03 08:19:25 +08:00
embedder_traits Auto merge of #21881 - pyfisch:keyboard-types, r=paulrouget 2018-10-17 05:36:08 -04:00
fallible Partially revert #21746. 2018-09-22 18:51:42 +02:00
geometry Move malloc_size_of_derive to proper position 2018-09-04 11:29:38 +08:00
gfx Auto merge of #22028 - asajeffrey:debug-all-the-things, r=emilio 2018-10-29 14:17:02 -04:00
gfx_traits Format gfx_traits #21373 2018-09-09 10:11:08 +08:00
hashglobe Format hashglobe #21373 2018-09-09 10:14:36 +08:00
jstraceable_derive Format jstraceable_derive #21373 2018-09-10 11:03:38 +08:00
layout Directly build WebRender LineDisplayItem 2018-10-28 22:23:36 +01:00
layout_thread Make layout use available image data before querying the image cache. 2018-10-12 21:55:09 -04:00
layout_traits Replace mpsc with crossbeam/servo channel, update ipc-channel 2018-09-12 13:33:32 +08:00
malloc_size_of style: Implement the env() function with hardcoded zeros for safe-area-inset. 2018-11-05 12:33:16 +01:00
malloc_size_of_derive Rustfmt malloc_size_of & derive 2018-09-05 10:32:44 +02:00
metrics Auto merge of #21325 - gterzian:crossbeam_integration, r=SimonSapin,jdm 2018-09-12 13:33:45 -04:00
msg Add lots of derived Debug impls 2018-10-29 09:21:37 -05:00
net Update hyper to 0.12 2018-11-01 19:17:36 +01:00
net_traits Update hyper to 0.12 2018-11-01 19:17:36 +01:00
pixels Share some code between 2D canvas and WebGL 2018-10-09 14:57:02 +02:00
profile Update hyper to 0.12 2018-11-01 19:17:36 +01:00
profile_traits Add lots of derived Debug impls 2018-10-29 09:21:37 -05:00
rand Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
range format components/range using rustfmt 2018-09-12 12:32:31 +05:30
remutex format components/remutex 2018-09-12 12:37:11 +05:30
script Update remaining references to cssparser 0.24. 2018-11-05 12:33:37 +01:00
script_layout_interface Update remaining references to cssparser 0.24. 2018-11-05 12:33:37 +01:00
script_plugins Format components/script_plugins 2018-09-13 01:01:35 +09:00
script_traits Update hyper to 0.12 2018-11-01 19:17:36 +01:00
selectors style: Implement the env() function with hardcoded zeros for safe-area-inset. 2018-11-05 12:33:16 +01:00
servo Add a build switch to disable the native bluetooth backend. 2018-10-30 19:26:42 -04:00
servo_arc Fix tidy issues. 2018-09-18 11:46:01 +02:00
size_of_test Format component size_of_test 2018-09-10 21:31:38 +09:00
std_test_override Make mach test-unit not recompile components after mach build 2018-10-07 13:27:23 +02:00
style style: Fix servo build. 2018-11-05 12:44:54 +01:00
style_derive style: Teach ComputeSquaredDistance derive about #[animation(constant)]. 2018-09-15 17:56:41 +02:00
style_traits style: Implement the env() function with hardcoded zeros for safe-area-inset. 2018-11-05 12:33:16 +01:00
url Remove Origin::unicode_serialization 2018-10-12 10:25:03 +02:00
webdriver_server Update hyper to 0.12 2018-11-01 19:17:36 +01:00
webvr Replace mpsc with crossbeam/servo channel, update ipc-channel 2018-09-12 13:33:32 +08:00
webvr_traits Add lots of derived Debug impls 2018-10-29 09:21:37 -05:00