Repository navigation
Releases
Releases · AngleSharp/AngleSharp
1.11.0
Released on Tuesday, November 24 2026.
What's Changed
- Improved performance of parsing CSS selectors, cutting 15-30% of the time and 20-35% of the allocations
- Improved performance of matching
:nth-child(),:nth-last-child(),:only-child, the sibling combinators (+,~) and[attr~=value](up to 70% less time) - Improved performance of finding a node among its siblings (e.g.
previousElementSibling,nextElementSibling), which usually no longer scans the parent's children - Improved performance of moving and removing many nodes while a
MutationObserveris active - Improved performance of
children, which is only gathered again once the child list changed - Updated
imgelements to request nothing by themselves - Fixed setting the
valueof aninputortextareanot moving the cursor to its end - Fixed
click()dispatching itsclickevent later instead of before it returns - Fixed
click()on a checkbox or radio button not checking it (and not firinginputandchange) - Fixed
stopPropagation()in a capturing listener of an element still running its bubbling listeners - Fixed
form.elementsof a form not in the document being empty - Fixed a style sheet served as another type than
text/css(e.g.text/html) being applied in standards mode - Fixed text documents (e.g.
text/plain) never completing, i.e. noloadevent - Fixed
setEndof a new range moving its start along, andsetStartBefore(and the like) not collapsing a range they reverse - Fixed comparing the boundary points of a range in sibling nodes, which made
toString()andcloneContents()include text outside the range - Fixed
Range.toString()taking the whole text of adjacent text nodes for each of them - Fixed
cloneContents()andextractContents()of a range in the document itself throwing - Fixed ranges being changed by splitting, normalizing or editing text as if set by script (
splitTextalso moved the start where the end belonged) - Fixed a
NodeIteratorreturning the wrong node after its filter removed the node it looked at - Fixed
createElementNSaccepting qualified names with an empty prefix or local name (e.g.:div) - Fixed
nth-childselector not accepting some valid combinations (#1420) @bardrop - Fixed
TextSource.ReadMemory()returning pooled memory that could change after further reads, encoding changes, or disposal; direct underlying-source reads still borrow memory (#1418) - Fixed a
formwithmethod="dialog"navigating instead of closing its dialog (with the value of the submitter asreturnValue) - Fixed
showModal()of an open or a disconnected dialog not throwing anInvalidStateError - Fixed scripts in a
templaterunning while it is parsed - Fixed
innerHTMLof atemplatenot serializing its content - Fixed
showPopover()of a shown popover throwing instead of doing nothing - Fixed
attachShadow()of a shadow host throwing anInvalidStateErrorinstead of aNotSupportedError - Fixed
shadowRootgiving scripts a closed shadow root (C# still gets it viaShadowRoot) - Fixed the validity of a field staying invalid (
badInput) once it had an invalid value - Fixed the value sanatization of
date,month,week,time,datetime-local,number,rangeandcolor - Fixed
labelsof form controls,meterandprogressalways being empty - Fixed
label.controlnot finding the control a label withoutforcontains, and finding a hidden input - Fixed
formEnctypeof inputs and buttons being exposed asformEncTypeto scripts - Fixed
toDataURL()of a canvas giving just the base64 of the image instead of adata:URL - Fixes for Running the ACID3 Test by @FlorianRappl in #1422
- Fixed a redirect with the status 308 not being followed
- Fixed the parser duplicating a part of the document under certain conditions
- Fixed the
typeof amenunot beingtoolbarby default - Fixed
focus()moving the focus (and firingfocusandblur) only in a later task - Fixed the contents of a
templatebelonging to its document instead of an inert one (template.content.ownerDocument) - Fixed a
clickevent a script dispatched not running the activation behavior - Fixed the
submitevent of a form submission not being trusted - Fixed a script with
nomodulerunning even though module scripts are supported - Fixed a
datetime-localvalue without seconds being sanitized to an empty string - Fixed the
loadevent of a document not waiting for what started loading after the document was parsed but before it finished loading - Added
attachInternals()andElementInternals(form owner,setFormValue,setValidity,checkValidity) for form-associated custom elements, which are submitted, validated and reset (formResetCallback) with their form - Added the
::part()pseudo-element to selectors - Added
assignedNodes()andassignedElements()of slots - Added
IDocumentErrorHandlerservices, which may provide a document when creating one from a response failed (e.g. to show the error) - Added
ElementInternals.states(CustomStateSet) and the:state()pseudo-class - Added
setHTMLUnsafe(), which also creates declarative shadow roots - Added
DomRegistryandDomRegistrationto declare APIs to a scripting engine without reflection - Added a source generator to declare a
DomRegistrationefficiently - Released 1.11.0 by @FlorianRappl in #1423
Full Changelog: v1.10.5...v1.11.0
1.10.5
Released on Wednesday, November 18 2026.
What's Changed
- Fixed
URLSearchParams.sort()comparing names with the current culture and reordering pairs with the same name (#1415) @menes97 - Fixed
selectNodeContentsof a text node ending at its start instead of its end - Fixed
comparePointandisPointInRangerefusing offsets within a text node - Fixed HTML parsing retaining pooled tokenizer buffers through stale attribute references (#1416)
- Released 1.10.5 by @FlorianRappl in #1417
New Contributors
Full Changelog: v1.10.4...v1.10.5
1.10.4
Released on Sunday, November 15 2026.
What's Changed
- Fixed media elements never getting the controller of their resource
- Fixed media elements forgetting what a script set before their resource arrived (e.g.
new Audio(src).play()or the volume) - Fixed media elements not loading their
sourceelements, and loading the first one regardless of its type - Fixed
pausedof a media element being false before it plays, anddurationbeing 0 instead ofNaNwithout a resource - Added the events of a media element's controller reaching the element and those of the state the element changes itself
- Added
loopandautoplayto media elements and media pausing once removed from their document - Added the
errorof a media element whose resource can't be played or decoded - Added
play()of media elements giving a promise (HtmlMediaElementExtensions.PlayAsync) - Released 1.10.4 by @FlorianRappl in #1414
Full Changelog: v1.10.3...v1.10.4
1.10.3
Released on Friday, November 13 2026.
What's Changed
- Fixed events of a document's nodes not reaching its window (except
load) - Fixed
composedPath()of an event giving scripts no array and not starting with the target - Fixed a script element parsed with another type never running once a script gives it a source
- Fixed other scripts running between a script and its
loadevent when there is an event loop, so that SystemJS gave modules the registration of another script (e.g. failing micro frontends loaded with it) - Fixed the
codeof a keyboard event created from a key value being empty for the modifier keys (e.g.ControlLeftforControl) and the function keys - Released 1.10.3 by @FlorianRappl in #1413
Full Changelog: v1.10.2...v1.10.3
1.10.2
Released on Wednesday, November 11 2026.
What's Changed
- Improved performance of the HTML parser to cut up to 50% of parsing time
- Improved performance of parsing
imgelements without a resource loader - Updated the attributes of an element to be enumerable while they change
- Fixed URLs of a non-special scheme with a path (e.g.
app://localhost/orfoo:/a) being opaque - Fixed resources of HTML parsed via
innerHTML(orinsertAdjacentHTML) loading againstabout:blank - Fixed
iframe,frame,objectandembedelements loading outside of a document - Fixed relative sources of
audio,videoandembedelements not being resolved against the document - Released 1.10.2 by @FlorianRappl in #1412
Full Changelog: v1.10.1...v1.10.2
1.10.1
Released on Saturday, November 7 2026.
What's Changed
- Fixed module scripts of the parser (
<script type="module">) running right away instead deferring - Fixed a script inserted without text not waiting for the text to be set before running
- Improved the loader to dispose the responses of followed redirects (#1409) @michaelthyregod
- Released 1.10.1 by @FlorianRappl in #1411
Full Changelog: v1.10.0...v1.10.1
1.10.0
Released on Friday, November 6 2026.
What's Changed
- Fixed
addedNodesandremovedNodesof aMutationRecordbeing null instead of an empty list - Fixed
document.openthrowing in a top-level browsing context or without a resource loader, stopping the event loop, anddocument.writeafter loading losing what was written: it is parsed oncloseor when the current task ends - Fixed a frame without
srcorsrcdochaving no document and window, and it not firingloadwhen inserted by a script - Fixed
getElementsByClassName,getElementsByTagName,getElementsByTagNameNSandgetElementsByNamenot being live, which made a loop likewhile (list.length) list[0].remove()run forever - Fixed
previousNodeof aTreeWalkernever returning for a node with a previous sibling - Fixed the
detailof aCustomEventand therelatedTargetof aFocusEventbeing lost when given to their constructors by script - Fixed
ctrlKey,shiftKey,altKeyandmetaKeyof aKeyboardEventalways being false, also forinitKeyboardEventand the wheel - Fixed the options of
KeyboardEvent,MouseEventandWheelEventfor script not takingctrlKeyand the like,code,buttonsorrelatedTarget - Fixed
URLSearchParamskeeping the leading?of the string it is created from as part of the first name - Fixed
ErrorEventinitialized with its details having no type, so that it never reached listeners oferror - Fixed
ErrorEvent.Messagethrowing without an error - Fixed the same listener being called repeatedly when added repeatedly for a type and capture; this includes
+=on the events of the DOM - Fixed
aandareaelements not having the stringifier of the DOM:ToStringgives theirhref - Fixed the document of a frame getting lost when its download finished while the element was still being set up
- Fixed
containsof a node throwing fornull - Fixed
replaceWithof nodes only being known asreplace - Fixed scripts running with
IsScripting = falsewhen the browsing context has a scripting service: such a document runs none of its scripts, not even those inserted later, so a custom parser with default options needsIsScripting = trueto run scripts - Added
CreateDocumentOptions.IsScriptingDisabledto create a document without scripting, asDOMParserrequires - Added the options of
addEventListenerandremoveEventListener:capture,once,passiveandsignal, where a signal is anIAbortSignal - Added
CreateDocumentOptions.IsNavigationDisabledto create a document without it becoming the active document of its context or entering the session history, asDOMParserrequires - Added the
sandboxattribute ofiframeapplying to its browsing context (IBrowsingContext.Security), together with the flags of what is around it - Added
isConnectedof nodes andtoggleAttributeof elements - Added custom elements:
customElementsof the window withdefine,get,getName,whenDefinedandupgrade, as well as the:definedpseudo class; the scripts are run throughICustomElementHost, which can hold back the reactions until a call of a script returns;createElementwithisandadoptedCallbackincluded - Added support for
::selectionpseudo element - Added
X-Frame-Optionsand theframe-ancestorsdirective ofContent-Security-Policy, against every document around a frame: a frame refusing to be shown gets no document - Added
replaceChildrenas an extension ofIParentNode - Added
entries,keys,valuesandforEachtoURLSearchParams - Added
IScriptValueClonerfor keeping what script gives without its engine - Added
getRootNodeas an extension ofINode - Added
toJSONtoDOMRectandDOMPoint - Added
getAttributeNames,hasAttributes,insertAdjacentElement,insertAdjacentTextandinertto elements,isSameNodeto nodes andreplaceandvaluetoDOMTokenList - Added
PointerEvent,codeandisComposingtoKeyboardEvent,xandytoMouseEvent,cancelBubbleandreturnValuetoEvent - Added the constructor of
EventTarget, which isn't abstract any more - Added
scrollingElement,hidden,visibilityStateandcharsetto documents - Added
requestSubmitto forms,reportValidityto inputs,itemto selects anddecode,decoding,loadingandreferrerPolicyto images - Added
SubmitEventandrequestSubmitvalidation, cancellation, and submitter reporting to forms - Added
movementXandmovementYto MouseEvent - Added handling of
popoverattribute (popover API) - Released 1.10.0 by @FlorianRappl in #1407
New Contributors
- @FlorianRappl with @Copilot made their first contribution in #1406
Full Changelog: v1.9.1...v1.10.0
1.9.1
Released on Sunday, November 1 2026.
What's Changed
- Improved performance of inserting a newly created node (
AppendChild,InsertBefore, ...) into a deep tree (#1401) @michaelthyregod - Fixed
classList.toggle(token, false)adding an absent token instead of removing it: the DOM'stoggleis nowDomTokenListExtensions.ToggleToken - Fixed exponential matching of nested
:nth-child(âĶ of âĶ)selectors (#1403) @michaelthyregod - Improved handling of deeply nested selector functions (#1402) @michaelthyregod
- Released 1.9.1 by @FlorianRappl in #1404
Full Changelog: v1.9.0...v1.9.1
1.9.0
Released on Friday, October 30 2026.
What's Changed
- Improved performance of
TextContent,:contains(),GetElementById,GetElementsByName,GetElementsByClassName,GetElementsByTagNameandNormalize, which also continue with an explicit stack below 128 levels instead of recursing (#1389) @michaelthyregod - Improved performance of
IHtmlParser.ParseFragmentand of inserting many nodes at once (Append,Prepend, ...): finding a template's host no longer scans the whole document, and removing a node's last child no longer scans its siblings - Improved performance of removing or inserting a node's first child, which no longer shifts all its siblings, so moving every child of a large node one by one (or replacing it via
innerHTML) takes linear time; each node with children also allocates one object less - Improved quadratic parse time on hostile markup: elements and text foster-parented out of a
table, a text run split by ignored end tags (x</q>x</q>...), and repeatedhtml/bodystart tags piling up attributes; attribute name lookups on elements with many attributes no longer scan them - Improved performance of
:has(): relative arguments only walk what they can reach (:has(> a)the descendants,:has(+ a)/:has(~ a)the following siblings) instead of the parent's whole subtree, the walk no longer allocates, and a:has()is tested after the rest of its compound and its ancestor chain, so rules such as.tree :has(.skeleton):hoveronly walk subtrees of hovered elements inside.tree - Fixed
setIntervalwith a delay of 0 never yielding: every round completed synchronously and queued tasks until memory ran out; a negative delay ofsetTimeoutorsetIntervalthrew instead of counting as 0 (nested intervals now wait at least 4ms, as in browsers) - Fixed fragment parsing (
ParseFragment,innerHTML) to break out ofsvg/mathon HTML start tags such asp,bordiv, which previously stayed foreign elements - Fixed
CreateElement<TElement>()depending on reflection that trimming can break;IElement,IHtmlElementandISvgElementnow throw instead of returning an arbitrary element @michaelthyregod - Fixed
IHtmlParser.ParseFragmentto keep an SVG or MathML context element in its namespace (and anannotation-xmlcontext'sencoding), instead of parsing as if the context were an HTML element of the same name, and to find aformancestor of the context, so a nested<form>start tag is ignored as withinnerHTML - Fixed inserting a detached
templateinto its own contents not throwing aHierarchyRequestError - Fixed
AwaitEventAsyncremoving its listener off-thread while a dispatch was still running (#1397) @michaelthyregod - Fixed event listener registration racing a dispatch on another thread @michaelthyregod
- Fixed
IHtmlSelectElement.SelectedIndexgaining a setter; setOptions.SelectedIndexto change the selection (#1395) @SimonCropp - Added
AwaitEventAsyncoverload taking aCancellationToken@michaelthyregod - Added trimming and Native AOT compatibility (
IsAotCompatible) for the .NET 8 and .NET 10 targets (#1398) @michaelthyregod - Added trim-safe generic overloads of
SubmitAsync,Attr,VirtualResponse.HeadersandToDictionary, which calls with an anonymous object bind to when recompiled; theObjectoverloads are now obsolete @michaelthyregod - Released 1.9.0 by @FlorianRappl in #1399
New Contributors
- @michaelthyregod made their first contribution in #1389
Full Changelog: v1.8.6...v1.9.0
1.8.6
Released on Sunday, October 25 2026
What's Changed
- Removed temporary copies when serializing text that needs no HTML escaping @perfloop-agent in #1388
- Fixed
INode.Equals(isEqualNode) to compare what the DOM spec compares: character data, doctype identifiers, processing instructions, element prefixes and attribute local names, no longer base URLs, without overflowing the stack on deep trees - Fixed
IAttr.Equalscomparing the prefix instead of the local name - Fixed
IDocument.Import(importNode) returning nodes owned by the source document instead of the importing one - Fixed
IDocument.Importaccepting a shadow root instead of throwingNotSupported - Fixed
INode.CloneandImportoverflowing the stack on deeply nested trees and templates - Fixed a shallow clone of a
<template>copying its contents - Fixed serializing
<and>in attribute values unescaped, which let markup break out when reparsed under different rules (mutation XSS); they are now written as<and>like browsers do since the HTML spec change of May 2025 - Fixed
IRange.CopyContentandExtractContentoverflowing the stack on deeply nested ranges - Fixed
Dispatch(dispatchEvent) returningtruefor a canceled event - Fixed
MutationObservernot observing a document itself and throwing for one without a root element - Fixed
MutationObserver.Disconnectkeeping the previous targets for a laterConnect - Fixed a failing navigation or submission from
DoClickcrashing the process; it is reported as a context error - Fixed
URLSearchParamstreating non-ASCII values as single bytes and leaving+undecoded @NotAFlightRisk in #1390 - Added the
IHtmlSelectElement.SelectedIndexsetter - Added
HtmlParserOptions.MaximumDepth(default 512) to stop deeply nested markup from building trees that overflow the stack - Added focusing of elements with a
tabindexand blurring of any focused element - Added
DoClickAsyncto await a click's navigation or form submission - Added toggling the parent
<details>when clicking its<summary> - Added declarative shadow DOM: the parser attaches
<template shadowrootmode="open">(orclosed) as the shadow root of its parent - Added
:host(<compound>), and selectors in a shadow tree reaching its host (only through:host) - Released 1.8.6 by @FlorianRappl in #1391
New Contributors
- @perfloop-agent made their first contribution in #1388
Full Changelog: v1.8.5...v1.8.6