Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update WebView history properties on JS-based navigation #12907

Merged
merged 4 commits into from
Jul 18, 2023

Conversation

MartinZikmund
Copy link
Member

@MartinZikmund MartinZikmund commented Jul 17, 2023

GitHub Issue (If applicable): closes #

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

What is the new behavior?

Copilot Summary

🤖 Generated by Copilot at 0638fbd

This pull request improves the web view controls for the Uno platform by adding a dispatcher property to the IWebView interface, implementing it for the WebView and WebView2 controls, and fixing some issues with the history management and event raising of the native web view classes. It also adds a new sample page to the UITests.Shared project to demonstrate the navigation properties of the WebView2 control.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@MartinZikmund MartinZikmund self-assigned this Jul 17, 2023
@github-actions github-actions bot added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform area/automation Categorizes an issue or PR as relevant to project automation labels Jul 17, 2023
…y changes

When JS-based navigation changes the history properties, we can't recognize this in WebView using conventional navigation events. However, it should still influence history properties.
@MartinZikmund MartinZikmund force-pushed the dev/mazi/webview-navigation-behavior branch from 0638fbd to 89ca036 Compare July 18, 2023 06:07
@nventive-devops
Copy link
Contributor

The build 86148 found UI Test snapshots differences: android-28-net7: 0, android-28-net7-Snap: 69, ios: 41, ios-Snap: 98, skia-gtk-screenshots: 13, skia-wpf-screenshots: 13, wasm: 31, wasm-automated-net7.0-UWP-Benchmarks: 0, wasm-automated-net7.0-UWP-Default: 37, wasm-automated-net7.0-UWP-RuntimeTests: 0, wasm-automated-net7.0-WinUI-RuntimeTests: 0

Details
  • android-28-net7: 0 changed over 1

  • android-28-net7-Snap: 69 changed over 1040

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Default_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected
    • Dialogs_UITests_Shared_MessageDialogTests_MessageDialogTest_UITests_Shared_MessageDialogTests_MessageDialogTest
    • ItemsRepeater_UITests_Windows_UI_Xaml_Controls_Repeater_UniformGridLayout_Simple_UITests_Windows_UI_Xaml_Controls_Repeater_UniformGridLayout_Simple
    • ListView_ListViewIncrementalLoading_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewIncrementalLoading
    • ListView_ListViewLargeLegacy_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewLargeLegacy
    • ListView_ListView_Padding_Unconstrained_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Padding_Unconstrained
    • Default_Uno_UI_Samples_UITests_Image_Image_Margin_Uno_UI_Samples_UITests_Image_Image_Margin
    • ListView_ListView_WithFlipView_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_WithFlipView
    • Pickers_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming
    • Default_Uno_UI_Samples_UITests_Image_Image_UseTargetSize_Uno_UI_Samples_UITests_Image_Image_UseTargetSize
    • Grid_CenteredGridinGridwiththreefixedsizechildren_Uno_UI_Samples_Content_UITests_GridTestsControl_CenteredGridinGridwiththreefixedsizechildren
    • MUX_UITests_Microsoft_UI_Xaml_Controls_SplitButtonTests_SplitButtonPage_UITests_Microsoft_UI_Xaml_Controls_SplitButtonTests_SplitButtonPage
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats
    • NavigationView_FluentStyle_NavigationViewSample_SamplesApp_Samples_Microsoft_UI_Xaml_Controls_NavigationViewTests_FluentStyle_FluentStyle_NavigationViewSample
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_NoSize_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_NoSize
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_FromMsAppData_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_FromMsAppData
    • ListView_HorizontalListView_Templates_SamplesApp_Windows_UI_Xaml_Controls_ListView_HorizontalListView_Templates
    • ListView_ListViewHeaderImage_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewHeaderImage
    • ListView_ListView_TextBox_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_TextBox
    • ListView_ListViewChangeHeight_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewChangeHeight
  • ios: 41 changed over 270

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ComboBoxTests_ToggleDisabled_ComboBox_Disabled
    • ListView_ObservableCollection_Creation_Count_Scrolled2
    • Screenshots_Image_Stretch_Alignment_Taller_Mode-2
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-2
    • ListView_ObservableCollection_Creation_Count_Added_above
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • Keyboard_Textbox_NoScrollViewer_Validation_1_-_Remove_Focus_on_filledTextBox
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • Screenshots_Image_Stretch_Alignment_Smaller_Mode-2
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • ListView_ObservableCollection_Creation_Count_Removed_above
    • ContentPresenter_Template_Uno_UI_Samples_Content_UITests_ContentPresenter_ContentPresenter_Template
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-1
    • When_MultipleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • BasicExpressionTest_UITests_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBox_ExpressionTest
    • ListView_ObservableCollection_Creation_Count_Added
    • Flyout_ShowAt_Window_Content_UITests_Windows_UI_Xaml_Controls_FlyoutTests_Flyout_ShowAt_Window_Content
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-0
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-3
    • Keyboard_Textbox_NoScrollViewer_Validation_0_-_Remove_Focus_on_normalTextBox
  • ios-Snap: 98 changed over 1031

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Brushes_ImageBrushAlignmentXY_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushAlignmentXY
    • Default_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation
    • ToolTip_ToolTip_DynamicContent_UITests_Windows_UI_Xaml_Controls_ToolTip_ToolTip_DynamicContent
    • WebView_WebView2_JavascriptInvoke_SamplesApp_Microsoft_UI_Xaml_Controls_WebView2Tests_WebView2_JavascriptInvoke
    • Brushes_UITests_Shared_Windows_UI_Xaml_Media_ImageBrushTests_ImageBrush_SameWithDelay_UITests_Shared_Windows_UI_Xaml_Media_ImageBrushTests_ImageBrush_SameWithDelay
    • ContentControl_ContentControl_Nested_TemplatedParent_Uno_UI_Samples_Content_UITests_ContentControlTestsControl_ContentControl_Nested_TemplatedParent
    • Default_UITests_Toolkit_ElevatedView_CornerRadius_UITests_Toolkit_ElevatedView_CornerRadius
    • Progress_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • WebView_UITests_Windows_UI_Xaml_Controls_WebView_WebView_Title_UITests_Windows_UI_Xaml_Controls_WebView_WebView_Title
    • Border_NonUniformThicknessandRadius_Uno_UI_Samples_UITests_BorderTestsControl_NonUniformThicknessandRadius
    • Brushes_ImageBrushWithRotateTransform_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushWithRotateTransform
    • ContentPresenter_ContentPresenter_Padding_Uno_UI_Samples_Content_UITests_ContentPresenter_ContentPresenter_Padding
    • Icons_UITests_Microsoft_UI_Xaml_Controls_ImageIconTests_ImageIconPage_UITests_Microsoft_UI_Xaml_Controls_ImageIconTests_ImageIconPage
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Equal_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Equal
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Smaller_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Smaller
    • Scrolling_UITests_Windows_UI_Xaml_Controls_ScrollViewerTests_ScrollViewer_SnapPoints_UITests_Windows_UI_Xaml_Controls_ScrollViewerTests_ScrollViewer_SnapPoints
    • UIElement_UITests_Windows_UI_Xaml_UIElementTests_UIElement_Layout_Bug2879_UITests_Windows_UI_Xaml_UIElementTests_UIElement_Layout_Bug2879
    • ComboBox_ComboBox_Picker_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ComboBox_ComboBox_Picker
    • GridView_Uno_UI_Samples_Content_UITests_GridView_GridView_Vertical_MaxItemWidth_Uno_UI_Samples_Content_UITests_GridView_GridView_Vertical_MaxItemWidth
    • ItemsRepeater_UITests_Windows_UI_Xaml_Controls_Repeater_ItemsRepeater_Basics_UITests_Windows_UI_Xaml_Controls_Repeater_ItemsRepeater_Basics
  • skia-gtk-screenshots: 13 changed over 1112

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • MediaPlayerElement-Mini player.png
    • MUX-WinUIProgressRingPage.png
    • MUX-WinUIProgressRing_CustomSources.png
    • PipsPager-PipsPagerExamples.png
    • Progress-ProgressRingHeightTest.png
    • NavigationView-NavigationViewRS4Page.png
    • ListView-ListViewSelectedItems.png
    • Progress-WindowsProgressRing_GH1220.png
    • Progress-WinUIProgressRingPage.png
    • Progress-WinUIProgressRing_CustomSources.png
    • Progress-WinUIProgressRing_Features.png
    • Pickers-CalendarView_Theming.png
    • WinUI-PipsPagerExamples.png
  • skia-wpf-screenshots: 13 changed over 1112

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Progress-WinUIProgressRingPage.png
    • Progress-WinUIProgressRing_CustomSources.png
    • Progress-WinUIProgressRing_Features.png
    • MUX-WinUIProgressRingPage.png
    • MUX-WinUIProgressRing_CustomSources.png
    • Progress-ProgressRingHeightTest.png
    • Pickers-CalendarView_Theming.png
    • ListView-ListViewSelectedItems.png
    • PipsPager-PipsPagerExamples.png
    • MUX-TabViewPage.png
    • Progress-WindowsProgressRing_GH1220.png
    • TabView-TabViewPage.png
    • WinUI-PipsPagerExamples.png
  • wasm: 31 changed over 1037

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • MUXControlsTestApp.PipsPagerExamples
    • UITests.Microsoft_UI_Xaml_Controls.ProgressRing.WinUIProgressRing_CustomSources
    • UITests.Microsoft_UI_Xaml_Controls.ProgressRing.WinUIProgressRing_Features
    • MUXControlsTestApp.NavigationViewMinimalPage
    • SamplesApp.Samples.Windows_UI_Xaml_Controls.NavigationViewTests.NavigationView_BasicNavigation
    • UITests.Windows_Media.MediaPlayerTests
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • UITests.Windows_UI_Xaml_Shapes.Offscreen_Shapes
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListView_Expandable_Item_Large
    • MUXControlsTestApp.NavigationViewTopNavPage
    • UITests.Microsoft_UI_Xaml_Controls.TabViewTests.TabViewPage
    • UITests.Shared.Windows_UI_Xaml_Controls.ListView.ListView_With_ListViews_Count_Measure
    • UITests.Windows_UI_Xaml.UIElementTests.UIElement_InitializationSequence
    • UITests.Windows_UI_Xaml_Controls.ProgressRing.WindowsProgressRing_GH1220
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Microsoft_UI_Xaml_Controls.ProgressRing.WinUIProgressRingPage
    • MUXControlsTestApp.NavigationViewAnimationPage
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Mkv_Extension
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Mov_Extension
  • wasm-automated-net7.0-UWP-Benchmarks: 0 changed over 1

  • wasm-automated-net7.0-UWP-Default: 37 changed over 1920

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • MediaPlayerElement_Sources_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Sources
    • Brushes_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList
    • Default_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected
    • MediaPlayerElement_Using_ogg_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Ogg_Extension
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • LoopingSelector_UITests_Windows_UI_Xaml_Controls_LoopingSelectorTests_LoopingSelector_Short_UITests_Windows_UI_Xaml_Controls_LoopingSelectorTests_LoopingSelector_Short
    • Brushes_Uno_UI_Samples_UITests_ImageBrushTestControl_Ellipse_Uno_UI_Samples_UITests_ImageBrushTestControl_Ellipse
    • ColorPicker_WinUIColorPickerPage_UITests_Shared_Microsoft_UI_Xaml_Controls_ColorPickerTests_WinUIColorPickerPage
    • Image_Image_Stretch_None_Uno_UI_Samples_UITests_ImageTestsControl_Image_Stretch_None
    • PipsPager_MUXControlsTestApp_PipsPagerExamples_MUXControlsTestApp_PipsPagerExamples
    • Pickers_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming
    • Screenshots_Image_Stretch_Alignment_Taller_Mode-2
    • ListView_ListViewSelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • MediaPlayerElement_MediaPlayerElement_Stretch_Fill_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Stretch_Fill
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_ProgressRingHeightTest_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_ProgressRingHeightTest
    • MediaPlayerElement_Using_3gp_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_3gp_Extension
    • MediaPlayerElement_Using_avi_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Avi_Extension
    • MediaPlayerElement_Using_flv_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Flv_Extension
  • wasm-automated-net7.0-UWP-RuntimeTests: 0 changed over 1

  • wasm-automated-net7.0-WinUI-RuntimeTests: 0 changed over 1

@MartinZikmund MartinZikmund merged commit 4db1a0a into master Jul 18, 2023
@MartinZikmund MartinZikmund deleted the dev/mazi/webview-navigation-behavior branch July 18, 2023 12:45
@MartinZikmund
Copy link
Member Author

@Mergifyio backport release/stable/4.9

@mergify
Copy link
Contributor

mergify bot commented Jul 18, 2023

backport release/stable/4.9

✅ Backports have been created

jeromelaban added a commit that referenced this pull request Jul 19, 2023
…4.9/pr-12907

fix: Update `WebView` history properties on JS-based navigation (backport #12907)
@jeromelaban
Copy link
Member

@Mergifyio backport legacy/4x

@mergify
Copy link
Contributor

mergify bot commented Jul 19, 2023

backport legacy/4x

✅ Backports have been created

MartinZikmund added a commit that referenced this pull request Jul 28, 2023
fix: Update `WebView` history properties on JS-based navigation (backport #12907)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/automation Categorizes an issue or PR as relevant to project automation platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants