Skip to content

android: Merge setExperimentalMode methods - #47652

Merged
jdm merged 1 commit into
servo:mainfrom
veyndan:merge-setExperimentalMode
Aug 30, 2026
Merged

jdm merged 1 commit into
servo:mainfrom
veyndan:merge-setExperimentalMode

Conversation

@veyndan

@veyndan veyndan commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

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>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 30, 2026
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Aug 30, 2026
@jdm
jdm added this pull request to the merge queue Aug 30, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 30, 2026
Merged via the queue into servo:main with commit b095c0f Aug 30, 2026
36 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 30, 2026
@veyndan
veyndan deleted the merge-setExperimentalMode branch August 30, 2026 17:54
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants