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: Make sure that an element can invalidate itself in Measure/Arrange #7428

Merged
merged 2 commits into from
Nov 4, 2021

Conversation

dr1rrb
Copy link
Member

@dr1rrb dr1rrb commented Nov 3, 2021

Bug fix

What kind of change does this PR introduce?
Make sure that an element can invalidate itself (and its parents) while it's being measured / arranged

What is the current behavior?

The Is<Measure|Arrange>Dirty flags are reset after the actual measure / arrange, so if the element or one of its children do Invalidate<Measure|Arrange> (or alters the visual tree in a way which cause an invalidate), the flag is reset immediately after, preventing any new layouting phase.

What is the new behavior?

The Is<Measure|Arrange>Dirty flags are reset before the actual measure.

PR Checklist

@dr1rrb dr1rrb requested a review from a team November 3, 2021 16:15
@gitpod-io
Copy link

gitpod-io bot commented Nov 3, 2021

Copy link
Member

@carldebilly carldebilly left a comment

Choose a reason for hiding this comment

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

@dr1rrb dr1rrb self-assigned this Nov 3, 2021
@dr1rrb dr1rrb added the ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met label Nov 3, 2021
@dr1rrb dr1rrb force-pushed the dev/dr/cylicInvalidate branch from 4f4d18b to 266ae34 Compare November 4, 2021 15:27
@nventive-devops
Copy link
Contributor

The build 35678 found UI Test snapshots differences: android-28-net6: 0, android-28-xamarin: 29, android-28-xamarin-Snap: 25, ios: 11, ios-Snap: 42, skia-gtk-screenshots: 42, wasm: 21, wasm-automated-net5.0-Benchmarks: 0, wasm-automated-net5.0-Default: 4, wasm-automated-net5.0-RuntimeTests: 0

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

  • android-28-xamarin: 29 changed over 813

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ComboBox_Dropdown_Background_ComboBox_open
    • DatePicker_PickerFlyout_PlacementstopRight_True_False_True_UITests_Windows_UI_Xaml_Controls_DatePicker_DatePicker_Placement
    • FocusManager_FocusDirection_Up_Validation_Uno_UI_Samples_Content_UITests_FocusTests_FocusManager_FocusDirection
    • FocusManager_GetFocusedElement_TextBoxMultiLine_Validation_FocusManager_-_GetFocusedElement_-_TextBoxMultiLine_-_2_-_After_Selection
    • FocusManager_GetFocusedElement_TextBoxSingleLine_LostFocus_Validation_Uno_UI_Samples_Content_UITests_FocusTests_FocusManager_GetFocus_Automated
    • FocusManager_GetFocusedElement_ComboBoxItem_LostFocus_Validation_FocusManager_-_LostFocus_-_ComboBoxItem_-_2_-_Click_outside
    • InputScope_Should_Not_Validate_Input_Uno_UI_Samples_Content_UITests_TextBoxControl_Input_InputScope_CurrencyAmount
    • ComboBoxTests_Fullscreen_Popup_Generic_Opened
    • FocusManager_GetFocusedElement_ComboBox_LostFocus_Validation_FocusManager_-_LostFocus_-_ComboBox_-_2_-_Click_outside
    • FocusManager_GetFocusedElement_ComboBox_Validation_FocusManager_-_GetFocusedElement_-_ComboBox_-_2_-_After_Selection
    • FocusManager_GetFocusedElement_TextBoxSingleLine_Validation_FocusManager_-_GetFocusedElement_-_TextBoxSingleLine_-_2_-_After_Selection
    • FocusManager_GetFocusedElement_ToggleButton_LostFocus_Validation_Uno_UI_Samples_Content_UITests_FocusTests_FocusManager_GetFocus_Automated
    • ComboBoxTests_Fullscreen_Popup_Generic_Closed
    • CommandBar_LongTitle_Validation_CommandBar_-_LongTitle_-_3_-_Orientation_Portrait
    • CommandBar_LongTitle_Validation_CommandBar_-_LongTitle_-_4_-_Orientation_Landscape
    • FocusManager_GetFocusedElement_CheckBox_LostFocus_Validation_Uno_UI_Samples_Content_UITests_FocusTests_FocusManager_GetFocus_Automated
    • FocusManager_GetFocusedElement_ComboBoxItem_Validation_FocusManager_-_GetFocusedElement_-_ComboBoxItem_-_2_-_After_Selection
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • RadioButtons_Disable_Validation_UITests_Shared_Windows_UI_Xaml_Controls_RadioButtonTests_RadioButton_IsEnabled_Automated
  • android-28-xamarin-Snap: 25 changed over 929

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ComboBox_UITests_Shared_Windows_UI_Xaml_Controls_ComboBox_ComboBox_DropDownPlacement_UITests_Shared_Windows_UI_Xaml_Controls_ComboBox_ComboBox_DropDownPlacement
    • ColorPicker_ColorPickerSample_UITests_Microsoft_UI_Xaml_Controls_ColorPickerTests_ColorPickerSample
    • Default_Uno_UI_Samples_UITests_Image_Image_UseTargetSize_Uno_UI_Samples_UITests_Image_Image_UseTargetSize
    • Image_UniformToFill100x100_Uno_UI_Samples_UITests_ImageTestsControl_UniformToFill100x100
    • Map_MapControl_Uno_UI_Samples_Content_UITests_MapControl_MapControl
    • GridTestsControl_CenteredGridinGridwiththreefixedsizechildren_Uno_UI_Samples_Content_UITests_GridTestsControl_CenteredGridinGridwiththreefixedsizechildren
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats
    • NavigationView_MUXControlsTestApp_NavigationViewPage_MUXControlsTestApp_NavigationViewPage
    • NavigationView_MUXControlsTestApp_NavigationViewRS4Page_MUXControlsTestApp_NavigationViewRS4Page
    • Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressBar_WinUIProgressBarSimple_UITests_Microsoft_UI_Xaml_Controls_ProgressBar_WinUIProgressBarSimple
    • Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage
    • Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_CustomSources_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_CustomSources
    • MediaPlayerElement_Original_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Original
    • ScrollViewer_UITests_Windows_UI_Xaml_Controls_ScrollViewerTests_ScrollViewer_Padding_UITests_Windows_UI_Xaml_Controls_ScrollViewerTests_ScrollViewer_Padding
    • Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_Features_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_Features
    • Progress_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • TabView_UITests_Microsoft_UI_Xaml_Controls_TabViewTests_TabViewPage_UITests_Microsoft_UI_Xaml_Controls_TabViewTests_TabViewPage
    • WebView_WebView_WithHeaders_Uno_UI_Samples_Content_UITests_WebView_WebView_WithHeaders
    • UIElement_TransformToVisual_Simple_UITests_Shared_Windows_UI_Xaml_UIElementTests_TransformToVisual_Simple
    • Transform_TransformToVisual_Translate2d_SamplesApp_Wasm_Windows_UI_Xaml_Media_Transform_TransformToVisual_Translate2d
  • ios: 11 changed over 286

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Keyboard_Textbox_InsideScrollViewer_Validation_1_-_Remove_Focus_on_filledTextBox
    • Large_Image_With_Margin_Ready
    • Large_Image_With_Margin_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Margin_Large
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • Keyboard_Textbox_NoScrollViewer_Validation_0_-_Remove_Focus_on_normalTextBox
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • ComboBoxTests_Kidnapping_UITests_Shared_Windows_UI_Xaml_Controls_ComboBox_ComboBox_ComboBoxItem_Selection
    • NativeCommandBar_Size_thirdOrientation
    • When_MaxLines_Changed_Without_TextWrapping_UITests_Shared_Windows_UI_Xaml_Controls_TextBlockControl_SimpleText_MaxLines_Different_Font_Size
    • When_MaxLines_Changed_With_TextWrapping_UITests_Shared_Windows_UI_Xaml_Controls_TextBlockControl_SimpleText_MaxLines_Different_Font_Size
    • TextBox_RoundedCorners_UITests_Shared_Windows_UI_Xaml_Controls_TextBoxTests_TextBox_RoundedCorners
  • ios-Snap: 42 changed over 920

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Animations_DoubleAnimationUsingKeyFrames_TranslateX_GenericApp_Views_Content_UITests_Animations_DoubleAnimationUsingKeyFrames_TranslateX
    • ComboBox_ComboBox_Picker_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ComboBox_ComboBox_Picker
    • Animations_DoubleAnimation_RenderTransformOrigin_GenericApp_Views_Content_UITests_Animations_DoubleAnimation_RenderTransformOrigin
    • Border_Border_Simple_No_Background_With_TextBox_Uno_UI_Samples_UITests_BorderTestsControl_Border_Simple_No_Background_With_TextBox
    • ContentControlTestsControl_ContentControl_Nested_TemplatedParent_Uno_UI_Samples_Content_UITests_ContentControlTestsControl_ContentControl_Nested_TemplatedParent
    • ContentPresenter_ContentPresenter_Background_Uno_UI_Samples_Content_UITests_ContentPresenter_ContentPresenter_Background
    • ContentControlTestsControl_ContentControl_SetNull_Uno_UI_Samples_Content_UITests_ContentControlTestsControl_ContentControl_SetNull
    • Default_UITests_Windows_UI_Xaml_Controls_ToolTip_ToolTip_Long_Text_UITests_Windows_UI_Xaml_Controls_ToolTip_ToolTip_Long_Text
    • Default_Uno_UI_Samples_UITests_Image_Image_Margin_Uno_UI_Samples_UITests_Image_Image_Margin
    • ContentPresenter_ContentPresenter_TextProperties_Uno_UI_Samples_Content_UITests_ContentPresenter_ContentPresenter_TextProperties
    • Flyout_Flyout_ToggleMenu_UITests_Shared_Windows_UI_Xaml_Controls_Flyout_Flyout_ToggleMenu
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Taller_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Taller
    • Image_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Horizontal_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Horizontal
    • Image_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Vertical_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Vertical
    • ListView_ListViewHeaderImage_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewHeaderImage
    • ListView_ListView_ChangeView_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_ChangeView
    • ListView_ListView_Expandable_Item_Large_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Expandable_Item_Large
    • ImageBrushTestControl_ImageBrushAlignmentXY_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushAlignmentXY
    • ListView_ListViewScrollIntoViewSnapPoints_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewScrollIntoViewSnapPoints
    • ListView_ListViewVariableItemHeight_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewVariableItemHeight
  • skia-gtk-screenshots: 42 changed over 972

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Automation-AutomationProperties_Name
    • Gesture recognizer-Pointer Events test bench
    • CommandBar-Long Title
    • Image-Image_Stretch_Algmnt_Inf_Horizontal
    • ImageBrushTestControl-ImageBrush_StreamSource
    • ImageBrushTestControl-ImageBrushStretch
    • NavigationView-NavigationViewStretchPage
    • NavigationView-PaneLayoutTestPage
    • NumberBox-MUX_Test
    • NumberBox-NumberBox_ExpressionTest
    • NumberBox-NumberBox_Header
    • Page-Page_Automated
    • ListView-ListView_IsSelected
    • NavigationView-NavigationViewCustomThemeResourcesPage
    • Progress-WinUIDeterminateProgressRing
    • Progress-WinUIProgressBarSimple
    • ScrollViewer-ScrollViewer_Clipping
    • Shapes-Path_Custom
    • Shapes-Path_Geometries
    • TextBlockControl-TextBlockSimpleContrainedHorizontalCenterWrap2
  • wasm: 21 changed over 930

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Microsoft_UI_Xaml_Controls.ColorPickerTests.ColorPickerSample
    • UITests.Microsoft_UI_Xaml_Controls.ProgressRing.WinUIProgressRingPage
    • UITests.Shared.Windows_UI_Xaml.xBindTests.xBind_Field
    • UITests.Shared.Windows_UI_Xaml_Controls.ImageTests.Image_Stretch_Algmnt_Inf_Horizontal
    • UITests.Shared.Windows_UI_Xaml_Controls.ImageTests.Image_Stretch_Algmnt_Inf_Vertical
    • UITests.Shared.Windows_UI_Xaml_Controls.ImageTests.Image_Stretch_Alignment_SizeOnControl
    • UITests.Shared.Windows_UI_Xaml_Automation.AutomationProperties_Name
    • UITests.Microsoft_UI_Xaml_Controls.ProgressRing.WinUIProgressRing_Features
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_Xaml.DragAndDrop.DragDrop_TestPage
    • UITests.Windows_UI_Xaml_Controls.LoopingSelectorTests.LoopingSelector_Short
    • UITests.Windows_UI_Xaml_Shapes.Offscreen_Shapes
    • Uno.UI.Samples.Content.UITests.XBind.PhaseBinding
    • Uno.UI.Samples.Content.UITests.XBind.PhaseBinding_Large
    • Uno.UI.Samples.Content.UITests.XBind.PhaseBinding_StartOne
    • Uno.UI.Samples.Samples.Shared.Content.UITests.ImageBrushInList
    • Uno.UI.Samples.UITests.Image.Image_Stretch_Alignment_Bigger
    • Uno.UI.Samples.UITests.Image.Image_Stretch_Alignment_Equal
    • Uno.UI.Samples.UITests.Image.Image_Stretch_Alignment_Taller
  • wasm-automated-net5.0-Benchmarks: 0 changed over 1

  • wasm-automated-net5.0-Default: 4 changed over 824

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ListView_Weird_Measure_During_Arrange_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_Weird_Measure
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • TestProgressRing_InitialState_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_Features
    • When_TransformToVisual_ScrollViewer_UITests_Shared_Windows_UI_Xaml_UIElementTests_TransformToVisual_ScrollViewer
  • wasm-automated-net5.0-RuntimeTests: 0 changed over 1

@mergify mergify bot merged commit a7c9943 into master Nov 4, 2021
@mergify mergify bot deleted the dev/dr/cylicInvalidate branch November 4, 2021 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants