Repository: flutter/flutter
File: engine/src/flutter/lib/web_ui/lib/src/engine/pointer_binding.dart (Dart)

Code before:
    // Special handling only for full-page Flutter apps running inside an iframe.
    // Custom element apps (Flutter embedded as a component) should let the
    // browser handle normal scroll flow.
    if (isInIframe && isFullPage) {
      // Full-page app in an iframe: always preventDefault to block native
      // scroll chaining. Without this, both the iframe content AND the parent
      // window would scroll simultaneously when the user scrolls.
      event.preventDefault();

      // Scroll parent window only when Flutter scrollables can't use the event:
      // - _lastWheelEventAllowedDefault: at least one scrollable is at boundary
      // - !_lastWheelEventHandledByWidget: no scrollable consumed the event
      //
      // For nested scrollables, inner widgets set _lastWheelEventHandledByWidget
      // to true, preventing parent window scroll even if outer is at boundary.
      //
      // Fixes GitHub issue #156985
      final bool shouldScrollParent =
          _lastWheelEventAllowedDefault && !_lastWheelEventHandledByWidget;
      if (shouldScrollParent) {
        scrollParentWindow(wheelEvent.deltaX, wheelEvent.deltaY);
      }
    } else {
      // Original behavior for:
      // 1. Apps NOT in an iframe (normal page)
      // 2. Custom element apps in an iframe (Flutter as a component)
      //
      // Only preventDefault when a scrollable widget handles the event.
      // This preserves native scroll behavior when Flutter can't scroll.
      if (!_lastWheelEventAllowedDefault) {
        event.preventDefault();
      }
    }
  }

  /// For browsers that report delta line instead of pixels such as FireFox
  /// compute line height using the default font size.
  ///
  /// Use Firefox to test this code path.
  double _computeDefaultScrollLineHeight() {
    const kFallbackFontHeight = 16.0;
    final DomHTMLDivElement probe = createDomHTMLDivElement();
    probe.style
      ..fontSize = 'initial'
      ..display = 'none';
    domDocument.body!.append(probe);
    String fontSize = domWindow.getComputedStyle(probe).fontSize;
    double? res;
    if (fontSize.contains('px')) {
      fontSize = fontSize.replaceAll('px', '');
      res = double.tryParse(fontSize);

Review comment (suggestion):
```suggestion
      // 2. Mulit-view mode inside an iframe
```

Code after:
      // 1. Apps NOT in an iframe (normal page)
      // 2. Multi-view mode inside an iframe
      //
      // Only preventDefault when a scrollable widget handles the event.
      // This preserves native scroll behavior when Flutter can't scroll.
      if (!_lastWheelEventAllowedDefault) {
        event.preventDefault();
      }
    }
  }

  /// For browsers that report delta line instead of pixels such as FireFox
  /// compute line height using the default font size.
  ///
  /// Use Firefox to test this code path.
  double _computeDefaultScrollLineHeight() {
    const kFallbackFontHeight = 16.0;
    final DomHTMLDivElement probe = createDomHTMLDivElement();
    probe.style
      ..fontSize = 'initial'
      ..display = 'none';
    domDocument.body!.append(probe);
    String fontSize = domWindow.getComputedStyle(probe).fontSize;
    double? res;
    if (fontSize.contains('px')) {
      fontSize = fontSize.replaceAll('px', '');
      res = double.tryParse(fontSize);
    }
    probe.remove();
    return res == null ? kFallbackFontHeight : res / 4.0;
  }
}

@immutable
class _SanitizedDetails {
  const _SanitizedDetails({required this.buttons, required this.change});

  final ui.PointerChange change;
  final int buttons;

  @override
  String toString() => '$runtimeType(change: $change, buttons: $buttons)';
}

class _ButtonSanitizer {
  int _pressedButtons = 0;

  /// Transform [DomPointerEvent.buttons] to Flutter's PointerEvent buttons.
  int _htmlButtonsToFlutterButtons(int buttons) {
    // Flutter's button definition conveniently matches that of JavaScript
    // from primary button (0x1) to forward button (0x10), which allows us to