Repository navigation
android: Merge setExperimentalMode methods - #47652
Merged
Merged
Conversation
Signed-off-by: veyndan <veyndan@gmail.com>
jdm
approved these changes
Aug 30, 2026
RichardTjokroutomo
pushed a commit
to RichardTjokroutomo/servo
that referenced
this pull request
Oct 6, 2026
Currently, calling `setExperimentalModeInit` only works if `ServoView` **has not** initialised `Servo` yet, and calling `setExperimentalMode` only works if `ServoView` **has** already initialised `Servo`. Calling these functions outside their allowed lifecycles just produces no-ops. As a library consumer, this requires knowledge of the `ServoView` class internals, and can be confusing when no-ops occur. The need for this knowledge can be removed by just having a single `setExperimentalMode` that internally knows how to set the experimental mode given whichever state the class is in. Since `MainActivity#onCreate` has always been erroneously calling both `setExperimentalModeInit` _and_ `setExperimentalMode` (via `updateSettingsIfNecessary(true)`, the deletion of the `setExperimentalModeInit` invocation is enough for this to work. Testing: There are no automated tests for Android. Signed-off-by: veyndan <veyndan@gmail.com>
Psychpsyo
pushed a commit
to Psychpsyo/servo
that referenced
this pull request
Oct 12, 2026
Currently, calling `setExperimentalModeInit` only works if `ServoView` **has not** initialised `Servo` yet, and calling `setExperimentalMode` only works if `ServoView` **has** already initialised `Servo`. Calling these functions outside their allowed lifecycles just produces no-ops. As a library consumer, this requires knowledge of the `ServoView` class internals, and can be confusing when no-ops occur. The need for this knowledge can be removed by just having a single `setExperimentalMode` that internally knows how to set the experimental mode given whichever state the class is in. Since `MainActivity#onCreate` has always been erroneously calling both `setExperimentalModeInit` _and_ `setExperimentalMode` (via `updateSettingsIfNecessary(true)`, the deletion of the `setExperimentalModeInit` invocation is enough for this to work. Testing: There are no automated tests for Android. Signed-off-by: veyndan <veyndan@gmail.com>
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.
Currently, calling
setExperimentalModeInitonly works ifServoViewhas not initialisedServoyet, and callingsetExperimentalModeonly works ifServoViewhas already initialisedServo. Calling these functions outside their allowed lifecycles just produces no-ops.As a library consumer, this requires knowledge of the
ServoViewclass internals, and can be confusing when no-ops occur. The need for this knowledge can be removed by just having a singlesetExperimentalModethat internally knows how to set the experimental mode given whichever state the class is in.Since
MainActivity#onCreatehas always been erroneously calling bothsetExperimentalModeInitandsetExperimentalMode(viaupdateSettingsIfNecessary(true), the deletion of thesetExperimentalModeInitinvocation is enough for this to work.Testing: There are no automated tests for Android.