mirror of
https://github.com/servo/servo
synced 2026-05-12 18:06:32 +02:00
This is a follow-up to #38532 which simply defaulted to an empty string as the spec's WebIDL doesn't mark `innerHTML` as `Throws`. However, since the absence of `Throws` in the spec doesn't imply no-throw, we can mark this as fallible in our WebIDL. This makes the `ShadowRoot`'s implementation match `Element`'s `innerHTML`. Testing: Same as #38532. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
34 lines
1.2 KiB
Plaintext
34 lines
1.2 KiB
Plaintext
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
/*
|
|
* The origin of this IDL file is:
|
|
* https://dom.spec.whatwg.org/#interface-shadowroot
|
|
*/
|
|
|
|
[Exposed=Window]
|
|
interface ShadowRoot : DocumentFragment {
|
|
readonly attribute ShadowRootMode mode;
|
|
readonly attribute boolean delegatesFocus;
|
|
readonly attribute SlotAssignmentMode slotAssignment;
|
|
readonly attribute boolean clonable;
|
|
readonly attribute boolean serializable;
|
|
readonly attribute Element host;
|
|
attribute EventHandler onslotchange;
|
|
};
|
|
|
|
|
|
enum ShadowRootMode { "open", "closed"};
|
|
enum SlotAssignmentMode { "manual", "named" };
|
|
|
|
ShadowRoot includes DocumentOrShadowRoot;
|
|
|
|
// https://html.spec.whatwg.org/multipage/#dom-parsing-and-serialization
|
|
partial interface ShadowRoot {
|
|
[CEReactions] undefined setHTMLUnsafe(DOMString html);
|
|
DOMString getHTML(optional GetHTMLOptions options = {});
|
|
|
|
// [CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML;
|
|
[CEReactions, Throws] attribute [LegacyNullToEmptyString] DOMString innerHTML;
|
|
};
|