Repository navigation
script: Implement fully exit fullscreen steps partially - #47123
Merged
Merged
Conversation
Signed-off-by: Shubham Gupta <shubhamg13.work@gmail.com>
fully exit fullscreen stepsfully exit fullscreen steps
fully exit fullscreen stepsfully exit fullscreen steps partially
Narfinger
approved these changes
Aug 10, 2026
Narfinger
left a comment
Contributor
There was a problem hiding this comment.
This seems ok but I am not that familiar with the material.
Member
Please remember that the |
Member
diff --git a/components/servo/tests/common/mod.rs b/components/servo/tests/common/mod.rs
index dbce0574f59..4305cb50696 100644
--- a/components/servo/tests/common/mod.rs
+++ b/components/servo/tests/common/mod.rs
@@ -97,6 +97,7 @@ pub(crate) struct WebViewDelegateImpl {
pub(crate) number_of_controls_hidden: Cell<usize>,
pub(crate) last_accesskit_tree_updates: RefCell<Vec<accesskit::TreeUpdate>>,
pub(crate) console_messages: RefCell<Vec<(ConsoleLogLevel, String)>>,
+ pub(crate) fullscreen: Cell<bool>,
}
#[allow(dead_code)] // Used by some tests and not others
@@ -165,6 +166,10 @@ impl WebViewDelegate for WebViewDelegateImpl {
fn show_console_message(&self, _webview: WebView, level: ConsoleLogLevel, message: String) {
self.console_messages.borrow_mut().push((level, message));
}
+
+ fn notify_fullscreen_state_changed(&self, _webview: WebView, is_fullscreen: bool) {
+ self.fullscreen.set(is_fullscreen);
+ }
}
// Used by some unit tests only. Since they compile into different binaries,
diff --git a/components/servo/tests/webview.rs b/components/servo/tests/webview.rs
index 6d8f74ebf60..a8b3d9f1ebe 100644
--- a/components/servo/tests/webview.rs
+++ b/components/servo/tests/webview.rs
@@ -1134,3 +1134,39 @@ fn test_preferences_change() {
)
);
}
+
+#[test]
+fn test_fullscreen() {
+ let servo_test = ServoTest::new();
+ let delegate = Rc::new(WebViewDelegateImpl::default());
+
+ let test_page = Url::parse(
+ "data:text/html,\
+ <button onclick='this.requestFullscreen()'>click</button>\
+ <a href=about:blank>click</a>",
+ )
+ .expect("Data URL failed to build");
+
+ let webview = WebViewBuilder::new(servo_test.servo(), servo_test.rendering_context.clone())
+ .delegate(delegate.clone())
+ .url(test_page.clone())
+ .build();
+ show_webview_and_wait_for_rendering_to_be_ready(&servo_test, &webview, &delegate);
+
+ click_at_point(&webview, Point2D::new(10., 10.));
+
+ let captured = delegate.clone();
+ servo_test.spin(move || !captured.fullscreen.get());
+
+ assert!(
+ evaluate_javascript(
+ &servo_test,
+ webview.clone(),
+ "document.querySelector('a').click();"
+ )
+ .is_ok()
+ );
+
+ let captured = delegate.clone();
+ servo_test.spin(move || captured.fullscreen.get());
+}Here's a test that should pass with your changes :) |
jdm
approved these changes
Aug 11, 2026
jdm
left a comment
Member
There was a problem hiding this comment.
Looks good assuming the test passes!
Signed-off-by: Shubham Gupta <shubhamg13.work@gmail.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
RichardTjokroutomo
pushed a commit
to RichardTjokroutomo/servo
that referenced
this pull request
Oct 6, 2026
Implement `fully exit fullscreen` steps Testing: `tests/webview.rs: test_fullscreen` Fixes: servo#45157 --------- Signed-off-by: Shubham Gupta <shubhamg13.work@gmail.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement
fully exit fullscreenstepsTesting:
tests/webview.rs: test_fullscreenFixes: #45157