feat: Support footnotes using role="doc-noteref"/"doc-footnote" attributes#1703
Merged
MurakamiShinyu merged 1 commit intomasterfrom Feb 19, 2026
Merged
feat: Support footnotes using role="doc-noteref"/"doc-footnote" attributes#1703MurakamiShinyu merged 1 commit intomasterfrom
MurakamiShinyu merged 1 commit intomasterfrom
Conversation
…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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
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-callinsertion for both EPUB and DPUB-ARIA footnotes - Updated UA CSS with
String.rawfor 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 |
This was referenced Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
a[role="doc-noteref"]linking toaside[role="doc-footnote"]as footnote references and apply footnote template flow:href-role-type()to match role-based footnote targets::footnote-callfor semantic EPUB/DPUB footnotes and fix nested shadow content traversalcloses #1700