Skip to content

feat: Support footnotes using role="doc-noteref"/"doc-footnote" attributes#1703

Merged
MurakamiShinyu merged 1 commit intomasterfrom
feat/issue1700-dpub-footnote
Feb 19, 2026
Merged

feat: Support footnotes using role="doc-noteref"/"doc-footnote" attributes#1703
MurakamiShinyu merged 1 commit intomasterfrom
feat/issue1700-dpub-footnote

Conversation

@MurakamiShinyu
Copy link
Member

  • support DPUB-ARIA footnotes in addition to existing EPUB semantics
  • treat a[role="doc-noteref"] linking to aside[role="doc-footnote"] as footnote references and apply footnote template flow
  • apply default UA styling for role-based noteref/footnote elements and footnote-content rendering
  • add parser/cascade support for :href-role-type() to match role-based footnote targets
  • avoid duplicate ::footnote-call for semantic EPUB/DPUB footnotes and fix nested shadow content traversal
  • add regression samples for DPUB target-counter and EPUB static-numbering footnotes
  • update test file list entries for issue Support footnotes using role="doc-noteref"/"doc-footnote" attributes #1700

closes #1700

…butes

- support DPUB-ARIA footnotes in addition to existing EPUB semantics
- treat `a[role="doc-noteref"]` linking to `aside[role="doc-footnote"]` as footnote references and apply footnote template flow
- apply default UA styling for role-based noteref/footnote elements and footnote-content rendering
- add parser/cascade support for `:href-role-type()` to match role-based footnote targets
- avoid duplicate `::footnote-call` for semantic EPUB/DPUB footnotes and fix nested shadow content traversal
- add regression samples for DPUB target-counter and EPUB static-numbering footnotes
- update test file list entries for issue #1700

closes #1700
@vercel
Copy link

vercel bot commented Feb 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vivliostyle Ready Ready Preview, Comment Feb 19, 2026 3:33am

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for DPUB-ARIA footnotes using role="doc-noteref" and role="doc-footnote" attributes, complementing the existing EPUB epub:type="noteref" and epub:type="footnote" semantics. The implementation includes parser and cascade support for the new :href-role-type() pseudo-class, fixes for nested shadow content traversal, improved detection to avoid duplicate ::footnote-call pseudo-elements for semantic footnotes, and enhanced UA styling with proper CSS escaping.

Changes:

  • Added :href-role-type() pseudo-class support for matching DPUB-ARIA footnote references to their targets
  • Fixed nested shadow content processing to correctly handle multiple shadow layers (templates + pseudo-elements)
  • Enhanced semantic footnote detection to skip ::footnote-call insertion for both EPUB and DPUB-ARIA footnotes
  • Updated UA CSS with String.raw for proper backslash handling and added comprehensive DPUB-ARIA footnote styles
  • Added test samples demonstrating DPUB footnotes with target-counter() and EPUB footnotes with static numbering

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/core/src/vivliostyle/vgen.ts Fixes shadow content traversal for nested shadows, adds semantic footnote detection for EPUB/DPUB patterns, improves ::footnote-call insertion logic
packages/core/src/vivliostyle/css-parser.ts Adds parsing support for :href-role-type() pseudo-class with same syntax as :href-epub-type()
packages/core/src/vivliostyle/css-cascade.ts Extends CheckTargetEpubTypeAction to handle role attributes, adds handler for href-role-type pseudo-class
packages/core/src/vivliostyle/assets.ts Updates UA CSS to use String.raw for proper escaping, adds DPUB-ARIA footnote styles, improves noteref styling to prevent double superscripting
packages/core/test/files/footnotes/dpub-footnotes-target-counter.html New test demonstrating DPUB-ARIA footnotes with target-counter() for dynamic numbering
packages/core/test/files/footnotes/epub-footnotes-static-number.html New test demonstrating EPUB footnotes with static/explicit numbering in source
packages/core/test/files/file-list.js Adds entries for the two new test files with issue #1700 references

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support footnotes using role="doc-noteref"/"doc-footnote" attributes

2 participants