Skip to content

feat: Implement on Document#22

Merged
smockle merged 1 commit intomainfrom
smockle/implement-on-document
Jul 25, 2025
Merged

feat: Implement on Document#22
smockle merged 1 commit intomainfrom
smockle/implement-on-document

Conversation

@smockle
Copy link
Contributor

@smockle smockle commented Jul 25, 2025

Fixes #19

From that issue:

The ariaNotify explainer includes several examples of calling document.ariaNotify, so this should be supported by the polyfill. However, the polyfill only implements ariaNotify on Element (document instanceof Element is false).

This PR implements ariaNotify on Document.

Copilot AI review requested due to automatic review settings July 25, 2025 17:44
@smockle smockle requested a review from a team as a code owner July 25, 2025 17:44
Copy link

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 implements the ariaNotify method on the Document prototype to extend the ARIA Notification API polyfill beyond just Element. The implementation provides a way to send notifications at the document level.

  • Added Document.prototype.ariaNotify method that delegates to documentElement
  • Updated the polyfill condition to check for both Element and Document prototype support
  • Updated README documentation to reflect the new Document.prototype.ariaNotify functionality

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
arianotify-polyfill.js Implements Document.prototype.ariaNotify method and updates polyfill detection
README.md Updates documentation to mention both Element and Document prototype methods
Comments suppressed due to low confidence (1)

arianotify-polyfill.js:178

  • This condition is redundant since it's already checked at the top of the file (line 3). This nested check will always be true when reached, making the code unreachable if Element.prototype already has ariaNotify.
    ) {

@smockle smockle merged commit f3eb3eb into main Jul 25, 2025
4 checks passed
@smockle smockle deleted the smockle/implement-on-document branch July 25, 2025 18:04
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.

[Bug] ariaNotify is not implemented on Document

3 participants