Web source: stable viewport (snapshot at register) + Stretch=Fill + overflow:hidden — no reflow, no scrollbars, no dead space

This commit is contained in:
2026-08-28 10:56:23 -07:00
parent 8d793af91a
commit 23874c2dd6
4 changed files with 44 additions and 66 deletions
+5 -11
View File
@@ -20,7 +20,7 @@ public sealed class WebView2ManagerTests
}
[Fact]
public void WebView2_Control_Size_Tracks_Source_Dimensions()
public void WebView2_Control_Size_Snapshots_Source_At_Register()
{
_app.Run(() =>
{
@@ -38,17 +38,11 @@ public sealed class WebView2ManagerTests
var webView = panel.Children.OfType<WebView2>().First();
Assert.Equal(640.0, webView.Width);
Assert.Equal(480.0, webView.Height);
source.Width = 1024;
source.Height = 768;
Assert.Equal(1024.0, webView.Width);
Assert.Equal(768.0, webView.Height);
});
}
[Fact]
public void WebView2_Control_Size_Ignores_Sub_One_Pixel_Drift()
public void WebView2_Control_Size_Does_Not_Track_Box_After_Register()
{
_app.Run(() =>
{
@@ -65,10 +59,10 @@ public sealed class WebView2ManagerTests
var webView = panel.Children.OfType<WebView2>().First();
source.Width = 640.4;
Assert.Equal(640.0, webView.Width);
source.Width = 1024;
source.Height = 768;
source.Height = 480.4;
Assert.Equal(640.0, webView.Width);
Assert.Equal(480.0, webView.Height);
});
}