MicrosoftEdge / MicrosoftEdge/WebView2Feedback
[Problem/Bug]: CoreWebView2WindowFeatures/ICoreWebView2WindowFeatures returning invalid values for top and left when provided with negative values in window.open()
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
What happened?
The top and left values on ICoreWebView2WindowFeatures and CoreWebView2WindowFeatures appear to be signed integer values that are simply cast to unsigned integer values. If a website uses negative values (which should be invalid for these properties), the values returned are not uint.MaxValue as the docs specify, but a very large uint value that corresponds to the negative value cast to a uint.
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
126.0.2544.0
SDK Version
1.0.1722.45
Framework
WPF
Operating System
Windows 10
OS Version
19045.4355
Repro steps
- Go to https://javascript.info/popup-windows#example-a-minimalistic-window
- Click the run button on the first example to open a popup with a negative left and top value.
- Observe the values returned by
CoreWebView2WindowFeatures.TopandCoreWebView2WindowFeatures.Left.
Expected:
Both values should be uint.MaxValue because negative values are invalid for these fields.
Observed
Values are uint.MaxValue - 1000 + 1 which is the signed integer value of -1000 used in the example.
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
Don't know
Last working version (if regression)
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported window.open() reproduction and inspect the CoreWebView2WindowFeatures.Top and Left API behavior for negative values. Confirm that negative inputs are treated as invalid and return uint.MaxValue, using the documented expectation and the javascript.info example to verify the result.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100