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

inikulin / parse5 / 42385976697
96%

Build:
DEFAULT BRANCH: master
Ran 07 Nov 2026 03:22PM 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 03:21PM UTC coverage: 96.083% (+0.4%) from 95.638%
42385976697

push

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>

659 of 661 branches covered (99.7%)

326 of 329 new or added lines in 2 files covered. (99.09%)

35 existing lines in 6 files now uncovered.

4244 of 4417 relevant lines covered (96.08%)

154740.47 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

Coverage Regressions

Lines Coverage ∆ File
24
98.21
0.15% packages/parse5/lib/parser/index.ts
3
95.08
0.96% packages/parse5/lib/serializer/index.ts
3
96.15
1.33% packages/parse5/lib/tree-adapters/default.ts
2
98.13
0.04% packages/parse5-htmlparser2-tree-adapter/lib/index.ts
2
98.13
0.0% packages/parse5/lib/tokenizer/preprocessor.ts
1
99.38
3.52% packages/parse5/lib/parser/open-element-stack.ts
Jobs
ID Job ID Ran Files Coverage
1 42385976697.1 07 Nov 2026 03:22PM UTC 41
96.08
GitHub Action Run
Source Files on build 42385976697
  • 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 #42385976697
  • fcce48d0 on github
  • Prev Build on master (#42260506814)
  • Next Build on master (#42386221817)
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