Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
10.0.x

- name: Build
run: ./build.sh -AngleSharpVersion 1.8.0
run: ./build.sh -AngleSharpVersion 1.10.0

windows:
runs-on: windows-latest
Expand Down Expand Up @@ -85,9 +85,9 @@ jobs:
NUGET_API_KEY: ${{ steps.nuget_login.outputs.NUGET_API_KEY }}
run: |
if ($env:GITHUB_REF -eq "refs/heads/main") {
.\build.ps1 -Target Publish -AngleSharpVersion 1.8.0
.\build.ps1 -Target Publish -AngleSharpVersion 1.10.0
} elseif ($env:GITHUB_REF -eq "refs/heads/devel") {
.\build.ps1 -Target PrePublish -AngleSharpVersion 1.8.0
.\build.ps1 -Target PrePublish -AngleSharpVersion 1.10.0
} else {
.\build.ps1 -AngleSharpVersion 1.8.0
.\build.ps1 -AngleSharpVersion 1.10.0
}
18 changes: 18 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,24 @@ values. `EngineExtensions.BuildArgs` maps JS arguments onto a CLR signature and
DOM-specific cases: an implicit leading `IWindow` parameter, optional parameters, `params`
arrays, and `[DomInitDict]` option objects expanded into positional arguments.

What a type's members become, as libraries rely on it:

- Instance members marked with `[DomName]` go on the prototype. Several methods or
`[DomConstructor]`s of the same name within one type are overloads, picked per call by
`OverloadResolution`; a method further up the type tree is hidden instead.
- Static members go on the constructor object (`DomConstructorInstance`, cached per type by
`CreatorCache.GetStaticMembers`). Only `[DomExposed]` *extension methods* are added to the type
they extend, so a class can be exposed to the window without spilling members onto it.
- A class overriding `ToString` gets a `toString` on its prototype, as such classes are exactly the
WebIDL stringifiers. A new override on a DOM type is hence visible to scripts.
- Into the CLR: `Object` receives bytes for a BufferSource and the raw Jint value for other objects.
Sequences are arrays and the generic interfaces arrays implement, filled from any JS iterable. A
class with `implicit operator`s from several types is a WebIDL union, picked like overloads; going
back out, its `implicit operator` to another type gives what a script receives for it.
- Out of the CLR: `[DomLiterals]` enums are strings (other enums are numbers, and exposed as an object
of constants), `Byte[]` is a new `ArrayBuffer`, `ArraySegment<Byte>` a new `Uint8Array`, other arrays are JS arrays, every numeric type is a
number, `IDictionary<String, Object>` is a plain object, and a `Task` is a promise.

## Performance

**Performance is a primary concern in this repository, not an afterthought.** Jint is an
Expand Down
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,73 @@
# 1.2.0

Released on Friday, November 6 2026.

- Fixed `window.origin` being `null` for a frame without an address of its own instead of the origin of its creator
- Fixed text given to `append`, `prepend` and the like failing instead of becoming a text node
- Fixed a class deriving from a type of the DOM not having its instances on its prototype chain
- Fixed an object with `handleEvent` not being accepted as an event listener, or one with `acceptNode` as a filter of a `TreeWalker` or `NodeIterator`
- Fixed a function not being accepted as a callback whose result is waited for, e.g. of `navigator.locks.request`: it runs on the event loop and is followed to its promise
- Fixed promise jobs not running after a timer, a listener or any other callback of the host: they waited for something else to run them, so `await` could hang
- Fixed a `DOMException` with a name having no code (e.g. `NotAllowedError`) being named `Error` for script
- Fixed a date from the DOM not being a `Date` for script, and bytes not surviving a structured clone
- Fixed a function not being accepted as a callback with a result, e.g. as a filter of a `TreeWalker`
- Fixed a worker that failed to start throwing from `postMessage` instead of firing an `error` event
- Fixed collections from attributes, e.g. `document.links` or `element.children`, not being iterable
- Fixed `classList` not being iterable and having no `forEach`, `entries`, `keys` and `values`
- Fixed a member of an options dictionary without a default becoming `undefined` in text
- Fixed members of the DOM being read-only and copied onto every prototype, so polyfills could neither replace them nor reach derived types (e.g. patching `Element.prototype.querySelector`): each is now on the prototype of the interface declaring it, as WebIDL says (writable, enumerable and configurable)
- Fixed interface objects of the window being read-only and enumerable: `window.Node = ...` now also changes `Node`, as WebIDL says
- Fixed bound functions and callable proxies not being accepted as callbacks (e.g. `setTimeout(f.bind(x))`, `addEventListener('click', f.bind(x))`, `requestAnimationFrame(f.bind(x))`, `onclick`), failing with `Could not find corresponding cast target`
- Fixed `removeEventListener` not removing listeners, as a function was turned into another listener each time
- Fixed errors of event listeners not reaching the `error` listeners of the window; an error thrown by such a listener goes to the browsing context
- Fixed the address of a script getting lost, so errors and stack traces named `<anonymous>`: they tell the resolved address of the script, or of the document for one written into it
- Fixed scripts written into a document telling lines and columns of their own in errors and stack traces instead of the ones in the document
- Fixed errors of scripts and of callbacks (e.g. timers, animation frames) not reaching the `error` listeners of the window; what they don't handle by `preventDefault` goes to the browsing context
- Fixed `onerror` of the window getting the event instead of the message, source, line, column and error, and returning `true` not handling the error
- Fixed `error` of an `ErrorEvent` being a .NET exception instead of what script threw
- Fixed an `onclick` and the like throwing taking down the process and skipping the other listeners, as it was not reported like a listener
- Fixed a `TypeError` or the like thrown for script by a member of the DOM becoming a plain `Error`
- Fixed modules being read from the local disk; every module is loaded through the configured requesters (#153) @michaelthyregod
- Fixed modules imported by a relative address being requested from the wrong address (e.g. `./a.js` of `/dir/page.html` from `/dir/page.html/a.js`, and the imports of a module of another origin from the own origin); they are resolved against what imports them (#153) @michaelthyregod
- Fixed modules being known by the path of their address, so errors didn't tell the whole address, and imports of an imported module were looked for from the wrong place
- Fixed a module written into a document telling lines and columns of its own, and importing from somewhere other than the base address of the document
- Fixed an error of a module being reported twice
- Fixed an event handler (e.g. `onclick`) returning `false` not cancelling the event
- Fixed an event handler attribute being added on top of the previous one when it changed, staying when it was removed, and throwing a syntax error at whoever set the attribute instead of reporting it
- Fixed only the first of several methods or constructors of the same name being callable (e.g. `new URLSearchParams('a=1')`, `register(url, options)`); the one fitting the arguments is called
- Fixed static members not being reachable (e.g. `DOMRect.fromRect`); they are on the constructor and may take the window as first parameter
- Fixed members of classes marked with `DomExposed` ending up on what they are exposed to (e.g. the members of a constructor on `window`); only extension methods do
- Fixed arrays and other iterables not converting to sequences (arrays and the interfaces they implement)
- Fixed `ArrayBuffer`, typed arrays, and `DataView` not converting to `Byte[]`, `ArraySegment<Byte>`, and `Object` (e.g. a request body being sent as `[object Uint8Array]`)
- Fixed numbers not converting from and to `Int64`, `UInt64`, `Int16`, `Byte`, `SByte`, `Single` (only from), and `Decimal`, as well as nullable forms of all value types
- Fixed values of `DomLiterals` enums being numbers instead of strings (e.g. `shadowRoot.mode`), and such enums being exposed as objects
- Fixed `Byte[]` being given as an array of numbers instead of an `ArrayBuffer`
- Fixed errors thrown by constructors losing their message
- Fixed WebIDL stringifiers (`URL`, `URLSearchParams`, `Location`, `Range`, `DOMTokenList`, `DOMMatrix`) answering `String(x)` with `[object X]`; a type overriding `ToString` has a `toString`
- Fixed sandboxed browsing contexts without `allow-scripts` running scripts and event handler attributes
- Fixed `postMessage` ignoring `targetOrigin`, giving it as the origin of the event, turning objects into strings, and not having a `source`; messages are copied by the structured clone algorithm, and the options form is supported
- Added `clearResourceTimings` and `setResourceTimingBufferSize` to `performance`
- Added `{ type: 'module' }` and `onerror` to `Worker`, with imports being loaded by the worker
- Added `MessageChannel` with queued message delivery, structured cloning, and transferable ports for windows and workers
- Added `IScriptValueCloner`, so that values of script can be kept, e.g. by IndexedDB
- Added `structuredClone`, `origin`, `isSecureContext` and `length` to the window
- Added `DOMException`, which is what the DOM now throws for scripts: an `Error` with the `name` and `code` of the standard, also available as a constructor and with its constants
- Added `TextEncoder` and `TextDecoder`
- Added the iterator of a type giving `entries` (WebIDL `iterable<K, V>`), so that e.g. `for (const [k, v] of new URLSearchParams(s))` works
- Added overloads brought by extensions for the methods of the DOM, as `addEventListener` with options has them
- Added `crypto` with `getRandomValues` and `randomUUID`, but without `subtle`
- Added `requestIdleCallback` and `cancelIdleCallback`
- Fixed `DOMParser` replacing the document of the page with what it parsed, and running its scripts
- Added `PerformanceObserver`, for the marks and measures of `performance`
- Added custom elements, run for the registry of AngleSharp: classes deriving from `HTMLElement` or another element, with their callbacks running when the call of a script returns (requires AngleSharp 1.10)
- Fixed classes deriving from a DOM type taking every object of that type for an instance of them
- Added what a promise rejects with being a `DOMException` or what was thrown, if the task behind it failed with one
- Added `import.meta.url` to modules; without it, e.g., webpack stopped with `Automatic publicPath is not supported in this browser`
- Added `ArraySegment<Byte>` being given as a `Uint8Array`
- Added classes with implicit conversions standing for a WebIDL union, e.g. of a string and a sequence of strings, which fixes such conversions failing; an implicit conversion from such a class is what a script receives for it
- Added the same-origin policy: script gets `null` for a node of another origin, and for its window a `CrossOriginWindow` with only `window`, `self`, `frames`, `parent`, `top`, `closed`, `length`, `location` (only to be set, and only for frames inside the own document), `postMessage`, `focus`, `blur` and `close`
- Added `performance.mark`, `measure`, `getEntries`, `getEntriesByName`, `getEntriesByType`, `clearMarks`, `clearMeasures`, along with `PerformanceEntry`, `PerformanceMark` and `PerformanceMeasure`

# 1.1.4

Released on Sunday, November 1 2026.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ The library comes with a service that exposes `WithJs` to `IConfiguration`. This
- Support of modern JavaScript (ES2015 through ES2025) through Jint
- Connection to the DOM
- ES modules and import maps (`<script type="module">`, `<script type="importmap">`)
- Web Workers
- Web Workers and transferable `MessageChannel` ports
- Evaluation of real-world libraries (the test suite runs jQuery 1 through 4, React 16 and Bootstrap 5)

## Participating
Expand Down
2 changes: 1 addition & 1 deletion src/AngleSharp.Js.Docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anglesharp/js",
"version": "1.1.4",
"version": "1.2.0",
"preview": true,
"description": "The doclet for the AngleSharp.Js documentation.",
"keywords": [
Expand Down
Loading
Loading