fune/dom/webidl/IntersectionObserver.webidl
Emilio Cobos Álvarez 039592f4d8 Bug 1682003 - Avoid UTF-8 -> UTF-16 conversion during CSSOM serialization. r=heycam
This lifts a bunch of string conversions higher up the stack, but allows
us to make the servo code use utf-8 unconditionally, and seemed faster
in my benchmarking (see comment 0).

It should also make a bunch of attribute setters faster too (like
setting .cssText), now that we use UTF8String for them (we couldn't
because we couldn't specify different string types for the getter and
setters).

Differential Revision: https://phabricator.services.mozilla.com/D99590
2020-12-17 14:04:35 +00:00

63 lines
1.9 KiB
Text

/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* https://w3c.github.io/IntersectionObserver/
*/
[ProbablyShortLivingWrapper, Pref="dom.IntersectionObserver.enabled",
Exposed=Window]
interface IntersectionObserverEntry {
[Constant]
readonly attribute DOMHighResTimeStamp time;
[Constant]
readonly attribute DOMRectReadOnly? rootBounds;
[Constant]
readonly attribute DOMRectReadOnly boundingClientRect;
[Constant]
readonly attribute DOMRectReadOnly intersectionRect;
[Constant]
readonly attribute boolean isIntersecting;
[Constant]
readonly attribute double intersectionRatio;
[Constant]
readonly attribute Element target;
};
[Pref="dom.IntersectionObserver.enabled",
Exposed=Window]
interface IntersectionObserver {
[Throws]
constructor(IntersectionCallback intersectionCallback,
optional IntersectionObserverInit options = {});
[Constant]
readonly attribute Node? root;
[Constant]
readonly attribute UTF8String rootMargin;
[Constant,Cached]
readonly attribute sequence<double> thresholds;
void observe(Element target);
void unobserve(Element target);
void disconnect();
sequence<IntersectionObserverEntry> takeRecords();
};
callback IntersectionCallback =
void (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);
dictionary IntersectionObserverEntryInit {
required DOMHighResTimeStamp time;
required DOMRectInit rootBounds;
required DOMRectInit boundingClientRect;
required DOMRectInit intersectionRect;
required Element target;
};
dictionary IntersectionObserverInit {
(Element or Document)? root = null;
UTF8String rootMargin = "0px";
(double or sequence<double>) threshold = 0;
};