-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement HTMLElement.attachInternals()
- Loading branch information
Showing
9 changed files
with
170 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
"use strict"; | ||
|
||
class ARIAMixinImpl {} | ||
|
||
module.exports = { | ||
implementation: ARIAMixinImpl | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
interface mixin ARIAMixin { | ||
[CEReactions] attribute DOMString? role; | ||
[CEReactions] attribute Element? ariaActiveDescendantElement; | ||
[CEReactions] attribute DOMString? ariaAtomic; | ||
[CEReactions] attribute DOMString? ariaAutoComplete; | ||
[CEReactions] attribute DOMString? ariaBusy; | ||
[CEReactions] attribute DOMString? ariaChecked; | ||
[CEReactions] attribute DOMString? ariaColCount; | ||
[CEReactions] attribute DOMString? ariaColIndex; | ||
[CEReactions] attribute DOMString? ariaColIndexText; | ||
[CEReactions] attribute DOMString? ariaColSpan; | ||
[CEReactions] attribute FrozenArray<Element>? ariaControlsElements; | ||
[CEReactions] attribute DOMString? ariaCurrent; | ||
[CEReactions] attribute FrozenArray<Element>? ariaDescribedByElements; | ||
[CEReactions] attribute DOMString? ariaDescription; | ||
[CEReactions] attribute FrozenArray<Element>? ariaDetailsElements; | ||
[CEReactions] attribute DOMString? ariaDisabled; | ||
[CEReactions] attribute FrozenArray<Element>? ariaErrorMessageElements; | ||
[CEReactions] attribute DOMString? ariaExpanded; | ||
[CEReactions] attribute FrozenArray<Element>? ariaFlowToElements; | ||
[CEReactions] attribute DOMString? ariaHasPopup; | ||
[CEReactions] attribute DOMString? ariaHidden; | ||
[CEReactions] attribute DOMString? ariaInvalid; | ||
[CEReactions] attribute DOMString? ariaKeyShortcuts; | ||
[CEReactions] attribute DOMString? ariaLabel; | ||
[CEReactions] attribute FrozenArray<Element>? ariaLabelledByElements; | ||
[CEReactions] attribute DOMString? ariaLevel; | ||
[CEReactions] attribute DOMString? ariaLive; | ||
[CEReactions] attribute DOMString? ariaModal; | ||
[CEReactions] attribute DOMString? ariaMultiLine; | ||
[CEReactions] attribute DOMString? ariaMultiSelectable; | ||
[CEReactions] attribute DOMString? ariaOrientation; | ||
[CEReactions] attribute FrozenArray<Element>? ariaOwnsElements; | ||
[CEReactions] attribute DOMString? ariaPlaceholder; | ||
[CEReactions] attribute DOMString? ariaPosInSet; | ||
[CEReactions] attribute DOMString? ariaPressed; | ||
[CEReactions] attribute DOMString? ariaReadOnly; | ||
|
||
[CEReactions] attribute DOMString? ariaRequired; | ||
[CEReactions] attribute DOMString? ariaRoleDescription; | ||
[CEReactions] attribute DOMString? ariaRowCount; | ||
[CEReactions] attribute DOMString? ariaRowIndex; | ||
[CEReactions] attribute DOMString? ariaRowIndexText; | ||
[CEReactions] attribute DOMString? ariaRowSpan; | ||
[CEReactions] attribute DOMString? ariaSelected; | ||
[CEReactions] attribute DOMString? ariaSetSize; | ||
[CEReactions] attribute DOMString? ariaSort; | ||
[CEReactions] attribute DOMString? ariaValueMax; | ||
[CEReactions] attribute DOMString? ariaValueMin; | ||
[CEReactions] attribute DOMString? ariaValueNow; | ||
[CEReactions] attribute DOMString? ariaValueText; | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"use strict"; | ||
|
||
const { mixin } = require("../../utils"); | ||
const ARIAMixinImpl = require("./ARIAMixin-impl").implementation; | ||
|
||
class ElementInternals {} | ||
|
||
mixin(ElementInternals.prototype, ARIAMixinImpl.prototype); | ||
|
||
module.exports = { | ||
implementation: ElementInternals | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// https://html.spec.whatwg.org/multipage/custom-elements.html#elementinternals | ||
[Exposed=Window] | ||
interface ElementInternals { | ||
// Shadow root access | ||
readonly attribute ShadowRoot? shadowRoot; | ||
|
||
// Form-associated custom elements | ||
// undefined setFormValue((File or USVString or FormData)? value, | ||
// optional (File or USVString or FormData)? state); | ||
|
||
readonly attribute HTMLFormElement? form; | ||
|
||
// undefined setValidity(optional ValidityStateFlags flags = {}, | ||
// optional DOMString message, | ||
// optional HTMLElement anchor); | ||
readonly attribute boolean willValidate; | ||
readonly attribute ValidityState validity; | ||
readonly attribute DOMString validationMessage; | ||
boolean checkValidity(); | ||
boolean reportValidity(); | ||
|
||
readonly attribute NodeList labels; | ||
}; | ||
|
||
// Accessibility semantics | ||
ElementInternals includes ARIAMixin; | ||
|
||
dictionary ValidityStateFlags { | ||
boolean valueMissing = false; | ||
boolean typeMismatch = false; | ||
boolean patternMismatch = false; | ||
boolean tooLong = false; | ||
boolean tooShort = false; | ||
boolean rangeUnderflow = false; | ||
boolean rangeOverflow = false; | ||
boolean stepMismatch = false; | ||
boolean badInput = false; | ||
boolean customError = false; | ||
}; |
This file contains 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
This file contains 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
This file contains 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