• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

inikulin / parse5 / 42385807362
96%
master: 96%

Build:
Build:
LAST BUILD BRANCH: chore/v8.1.1
DEFAULT BRANCH: master
Ran 07 Nov 2026 03:19PM UTC
Jobs 1
Files 41
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Nov 2026 02:05PM UTC coverage: 96.074% (+0.4%) from 95.638%
42385807362

Pull #1921

github

fb55
perf(parser): find open elements without scanning a deep stack

Searches of the stack of open elements walked it from the top: the
scope checks, the search for a list item to close, generic end tags in
HTML and in foreign content, insertion-mode resets, foster parenting and
the adoption agency. On a deep stack every such token paid for the
depth, so `<p><button>` followed by N `<div>`s, or `<b>` followed by N
`<span><div>` pairs and N `</b>`, took quadratic time.

Once 64 elements are open, the stack indexes them: elements with the
same tag in the same namespace are chained, so the topmost is found
without a scan, and each slot counts the special elements, list item
boundaries and scope boundaries at or below it, so whether one lies
between two elements is a comparison. Open formatting elements are
found by element. Stacks that never reach 64 elements are scanned,
which costs less than keeping the index on every push and pop.

On an indexed stack, removing an element from the middle leaves its
slot free instead of moving every element above it down, and the
adoption agency moves only the furthest block and the formatting
elements it kept below it, so each of its steps costs the elements it
passes, not the depth of the stack. `replaceFormattingElement` replaces
`insertAfter`, which only the adoption agency used.

The stack tests count reads of the stack's arrays for each kind of
search behind a deep stack, with the target missing or behind a
boundary; each is constant per token, and the reset rows that counted
the entries a reset passed are among them. The stack's unit tests check
the searches after removals from the middle and the adoption agency's
step, on a scanned and on an indexed stack, and a parser test parses
inputs that use each search behind 64 open elements as behind none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pull Request #1921: Security fixes for the tokenizer, serializer, SAX parser and tree construction

656 of 658 branches covered (99.7%)

602 of 605 new or added lines in 11 files covered. (99.5%)

4233 of 4406 relevant lines covered (96.07%)

154633.79 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
98.21
0.15% packages/parse5/lib/parser/index.ts
1
99.38
3.52% packages/parse5/lib/parser/open-element-stack.ts
Jobs
ID Job ID Ran Files Coverage
1 42385807362.1 07 Nov 2026 03:19PM UTC 41
96.07
GitHub Action Run
Source Files on build 42385807362
  • Tree
  • List 41
  • Changed 12
  • Source Changed 12
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #42385807362
  • Pull Request #1921
  • PR Base - master (#42260506814)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc