Skip to content

Commit

Permalink
Add ResizeObserver IDL file with test (web-platform-tests#9756)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebjerring authored and foolip committed Jun 8, 2018
1 parent 82a7c89 commit 7684fe3
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
30 changes: 30 additions & 0 deletions interfaces/ResizeObserver.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// GENERATED CONTENT - DO NOT EDIT
// Content of this file was automatically extracted from the
// "Resize Observer 1" spec.
// See: https://wicg.github.io/ResizeObserver/

[Constructor(ResizeObserverCallback callback),
Exposed=Window]
interface ResizeObserver {
void observe(Element target);
void unobserve(Element target);
void disconnect();
};

callback ResizeObserverCallback = void (sequence<ResizeObserverEntry> entries, ResizeObserver observer);

[Constructor(Element target)
]
interface ResizeObserverEntry {
readonly attribute Element target;
readonly attribute DOMRectReadOnly contentRect;
};

[Constructor(Element target)
]
interface ResizeObservation {
readonly attribute Element target;
readonly attribute float broadcastWidth;
readonly attribute float broadcastHeight;
boolean isActive();
};
20 changes: 20 additions & 0 deletions resize-observer/idlharness.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<title>ResizeObserver IDL tests</title>
<link rel="help" href="https://wicg.github.io/ResizeObserver/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script>
<script>
"use strict";

promise_test(async () => {
const idl_array = new IdlArray();
const idl = await fetch("/interfaces/ResizeObserver.idl").then(r => r.text());
idl_array.add_idls(idl);
idl_array.add_objects({
ResizeObserver: ["new ResizeObserver(entries => {})"],
});
idl_array.test();
}, "Test IDL implementation of ResizeObserver");
</script>

0 comments on commit 7684fe3

Please sign in to comment.