forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ResizeObserver IDL file with test (web-platform-tests#9756)
- Loading branch information
1 parent
82a7c89
commit 7684fe3
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |