mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #20329 - gterzian:before_unload, r=cbrewster
Implement beforeunload event and infrastructure <!-- Please describe your changes on the following line: --> Implementation of: 1. https://html.spec.whatwg.org/multipage/#prompt-to-unload-a-document, and 2. https://html.spec.whatwg.org/multipage/#unload-a-document --- <!-- 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 #10787 and fix #20485 and fix #20588 and fix #20496 (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/20329) <!-- Reviewable:end -->
This commit is contained in:
commit
1d8283e010
37 changed files with 341 additions and 113 deletions
|
@ -262,6 +262,8 @@ pub enum ConstellationControlMsg {
|
|||
Resize(PipelineId, WindowSizeData, WindowSizeType),
|
||||
/// Notifies script that window has been resized but to not take immediate action.
|
||||
ResizeInactive(PipelineId, WindowSizeData),
|
||||
/// Notifies the script that the document associated with this pipeline should 'unload'.
|
||||
UnloadDocument(PipelineId),
|
||||
/// Notifies the script that a pipeline should be closed.
|
||||
ExitPipeline(PipelineId, DiscardBrowsingContext),
|
||||
/// Notifies the script that the whole thread should be closed.
|
||||
|
@ -335,6 +337,7 @@ impl fmt::Debug for ConstellationControlMsg {
|
|||
AttachLayout(..) => "AttachLayout",
|
||||
Resize(..) => "Resize",
|
||||
ResizeInactive(..) => "ResizeInactive",
|
||||
UnloadDocument(..) => "UnloadDocument",
|
||||
ExitPipeline(..) => "ExitPipeline",
|
||||
ExitScriptThread => "ExitScriptThread",
|
||||
SendEvent(..) => "SendEvent",
|
||||
|
|
|
@ -145,6 +145,8 @@ pub enum ScriptMsg {
|
|||
TouchEventProcessed(EventResult),
|
||||
/// A log entry, with the top-level browsing context id and thread name
|
||||
LogEntry(Option<String>, LogEntry),
|
||||
/// Discard the document.
|
||||
DiscardDocument,
|
||||
/// Notifies the constellation that this pipeline has exited.
|
||||
PipelineExited,
|
||||
/// Send messages from postMessage calls from serviceworker
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue