1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * https://drafts.csswg.org/css-highlight-api-1/
9 * Copyright © 2021 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10 * liability, trademark and document use rules apply.
14 * Enum defining the available highlight types.
15 * See https://drafts.csswg.org/css-highlight-api-1/#enumdef-highlighttype
24 * Definition of a highlight object, consisting of a set of ranges,
25 * a priority and a highlight type.
27 * See https://drafts.csswg.org/css-highlight-api-1/#highlight
29 [Pref="dom.customHighlightAPI.enabled", Exposed=Window]
33 constructor(AbstractRange... initialRanges);
34 setlike<AbstractRange>;
35 attribute long priority;
36 attribute HighlightType type;
39 partial interface Highlight {
40 // Setlike methods need to be overridden.
41 // Iterating a setlike is not possible from C++ yet.
42 // Therefore a separate data structure must be held and kept in sync.
44 undefined add(AbstractRange range);
48 boolean delete(AbstractRange range);
52 * Registry object that contains all Highlights associated with a Document.
54 * See https://drafts.csswg.org/css-highlight-api-1/#highlightregistry
56 [Pref="dom.customHighlightAPI.enabled", Exposed=Window]
57 interface HighlightRegistry {
58 maplike<DOMString, Highlight>;
61 partial interface HighlightRegistry {
62 // Maplike interface methods need to be overridden.
63 // Iterating a maplike is not possible from C++ yet.
64 // Therefore, a separate data structure must be held and kept in sync.
66 undefined set(DOMString key, Highlight value);
70 boolean delete(DOMString key);