chromium/third_party/blink/renderer/core/html/custom/element_internals.idl

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// https://docs.google.com/document/d/1JO8puctCSpW-ZYGU8lF-h4FWRIDQNDVexzHoOQ2iQmY/edit?pli=1#heading=h.pjt9nhs3gu3k

typedef (File or USVString or FormData) ControlValue;

[
  Exposed=Window
]
interface ElementInternals {
  // Attributes and operations for form-associated custom elements.
  [RaisesException] void setFormValue(ControlValue? value, optional ControlValue? state);

  [RaisesException] readonly attribute HTMLFormElement? form;

  [RaisesException] void setValidity(ValidityStateFlags flags, optional DOMString message, optional HTMLElement anchor);
  [RaisesException] readonly attribute boolean willValidate;
  [RaisesException] readonly attribute ValidityState validity;
  [RaisesException, ImplementedAs=ValidationMessageForBinding] readonly attribute DOMString validationMessage;
  [RaisesException] boolean checkValidity();
  [RaisesException] boolean reportValidity();

  [RaisesException] readonly attribute NodeList labels;

  // Custom state
  // https://wicg.github.io/custom-state-pseudo-class/#dom-elementinternals-states
  [MeasureAs=ElementInternalsStates]
  readonly attribute CustomStateSet states;

  // Access to shadowRoot from custom elements. See crbug.com/1042130 and
  // https://github.com/w3c/webcomponents/issues/871#issuecomment-672082936
  [MeasureAs=ElementInternalsShadowRoot] readonly attribute ShadowRoot? shadowRoot;
};