Skip to content

Release 1.4.0 - #270

Merged
FlorianRappl merged 20 commits into
mainfrom
devel
Nov 6, 2026
Merged

FlorianRappl merged 20 commits into
mainfrom
devel

Conversation

@FlorianRappl

Copy link
Copy Markdown
Contributor

Types of Changes

Prerequisites

Please make sure you can check the following two boxes:

  • I have read the CONTRIBUTING document
  • My code follows the code style of this project

Contribution Type

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue, please reference the issue id)
  • New feature (non-breaking change which adds functionality, make sure to open an associated issue first)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Description

This pull request introduces the 1.4.0 release of the AngleSharp.Css library, focusing on significant improvements to rendering efficiency, standards compliance, and script API completeness. The changes include enhancements to render tree construction, better handling of presentational hints and shadow DOM, expanded CSSOM/script property access, new pseudo-element support, and a comprehensive suite of new and improved tests to validate these features.

Key highlights:

  • Rendering and style computation are now more efficient and standards-compliant.
  • The script API for style properties is now more complete and robust.
  • Support for new CSS features, such as ::selection and selector() in supports conditions.
  • Many new and improved tests to ensure correctness of shadow DOM, pseudo-elements, computed styles, and script APIs.

Important: Requires AngleSharp 1.10.0 to be released first.

michaelthyregod and others added 18 commits November 4, 2026 06:26
Every element of a render tree got its ::before and ::after cascaded and
its specified style built, though most have no generated content and the
specified style is rarely read (#262).

- Cascade a pseudo-element only if a rule that may match it declares its
  content; rules such as *::before { display: inline } of the default
  sheet alone do not give it a box
- Build the specified style of a render node on first read, from the one
  its parent had when it was built; it is published atomically
- Add tests for the declared content, the reading order, rendering again
  below a parent, and concurrent first reads
Build the parts of the render tree only when needed
GetInnerText computed the styles itself, apart from the render tree, so
both had to be optimized (#262). It now walks a render tree of the
element, which is only built as far as it is read.

- Build the children of a partial render node on first read, and its
  ::before and ::after only when all children are read
- Walk the element's own children, as the spec does: the shadow tree of
  a host is left out, and its light children count if they are slotted
- Add GetInnerText for a render node, e.g. of an existing render tree
- Add tests for shadow hosts, generated content, completing a partial
  tree, and concurrent first reads
…-tree

Get the inner text from a partial render tree
A complete render node is back to the fields it had before #267: the children field holds either the children or, in a partial render tree, what builds them on first read.
…dren

Keep the pending children of a render node in its children field
@FlorianRappl FlorianRappl added this to the v1.4.0 milestone Nov 5, 2026
@FlorianRappl
FlorianRappl merged commit 029884e into main Nov 6, 2026
13 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants