Closed Sebbs128 closed 6 months ago
I'm currently working on this in a forked branch, just don't seem to be able to assign the issue to myself.
I have the code changes in place, just currently working through the tests (12 currently fail due to the changes)
Test failures are due to enums like AngleSharp.Dom.NodeType
and AngleSharp.Js.Dom.RequesterState
needing to be the enum value. Instead, opting for just addressing DocumentReadyState
and leaving addressing other enums as they're brought to attention.
Landed in pre-release.
Bug Report
Prerequisites
AngleSharp.Css
for CSS support)For more information, see the
CONTRIBUTING
guide.Description
Creating this as the AngleSharp.Js counterpart to https://github.com/AngleSharp/AngleSharp/issues/1109
When JavaScript in a HTML document reads the
document.readyState
property, the value returned is a digit (the underlying value of theDocumentReadyState
enum) instead of the expected string (such as"loading"
or"complete"
).Steps to Reproduce
Reproduction using Top Level Statements
Output will be
Expected behavior:
document.readyState
call in JavaScript should return a string of either"loading"
,"interactive"
, or"complete"
.For the reproduction above, the expected output should be
Actual behavior:
document.readyState
call in JavaScript is returning the underlying enum value (ie.0
,1
, or2
)Environment details: OS: Win11x64 Runtime: .NET 7.0.201
Possible Solution
When converting an enum value to
JsValue
, check if it has an official name (viaDomNameAttribute
), and use that value instead.