Skip to content

[CP][stable] Fix bug in multisurfacerenderer where canvases do not have "position: absolute"#182299

Merged
auto-submit[bot] merged 1 commit into
flutter:flutter-3.41-candidate.0from
mdebbar:cp_stable_position_absolute
Feb 18, 2026
Merged

[CP][stable] Fix bug in multisurfacerenderer where canvases do not have "position: absolute"#182299
auto-submit[bot] merged 1 commit into
flutter:flutter-3.41-candidate.0from
mdebbar:cp_stable_position_absolute

Conversation

@mdebbar

@mdebbar mdebbar commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

This CP pull request was created manually.

Cherry-pick of #181053

Issue Link:

What is the link to the issue this cherry-pick is addressing?

Closes #182292

Changelog Description:

Fix bug in multisurfacerenderer where canvases do not have "position: absolute"

Impact Description:

Platform views not visible on Safari and Firefox.

Risk:

What is the risk level of this cherry-pick?

  • Low
  • Medium
  • High

Test Coverage:

Are you confident that your fix is well-tested by automated tests?

  • Yes
  • No

Validation Steps:

What are the steps to validate that this fix works?

Follow repro steps in #182292

@mdebbar mdebbar added the cp: review Cherry-picks in the review queue label Feb 12, 2026
@flutter-dashboard

Copy link
Copy Markdown

This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter.

Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed.

@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. platform-web Web applications specifically labels Feb 12, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively addresses a critical bug causing platform views to be invisible on Safari and Firefox by ensuring canvases have the position: absolute CSS property. The changes also include valuable refactoring in the Renderer class, extracting view listener setup into a dedicated method for improved modularity and readability. The debugClear method has been enhanced to provide a more robust state reset for testing, including proper listener cancellation and rasterizer disposal. A new, well-structured test case has been added to validate the position: absolute fix, demonstrating a commitment to correctness and test coverage. Overall, these changes significantly improve the stability and maintainability of the web rendering engine.

..width = cssWidth
..height = cssHeight;
..height = cssHeight
..position = 'absolute';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This addition directly addresses the bug where canvases were not visible on certain browsers due to missing position: absolute. This is a critical fix for rendering correctness.

Comment on lines +354 to +355
_onViewCreatedListener.cancel();
_onViewDisposedListener.cancel();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Cancelling the _onViewCreatedListener and _onViewDisposedListener in debugClear is crucial for preventing potential memory leaks and ensuring a clean state reset, especially in test environments. This improves correctness and maintainability.

Comment thread engine/src/flutter/lib/web_ui/lib/src/engine/renderer.dart
Comment thread engine/src/flutter/lib/web_ui/lib/src/engine/renderer.dart
Comment thread engine/src/flutter/lib/web_ui/lib/src/engine/renderer.dart
Comment thread engine/src/flutter/lib/web_ui/lib/src/engine/renderer.dart
@LongCatIsLooong

Copy link
Copy Markdown
Contributor

@mdebbar it looks like this didn't merge cleanly could you please add an additional reviewer?

@harryterkelsen harryterkelsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@walley892 walley892 added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 18, 2026
@auto-submit auto-submit Bot merged commit 6c0baae into flutter:flutter-3.41-candidate.0 Feb 18, 2026
162 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 21, 2026
@mdebbar mdebbar deleted the cp_stable_position_absolute branch February 24, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App cp: review Cherry-picks in the review queue engine flutter/engine related. See also e: labels. platform-web Web applications specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants