Skip to content

Commit

Permalink
Add idlharness test for interesttarget [6/N]
Browse files Browse the repository at this point in the history
There was previously an `interest-invokers.tentative.idl` but
no test file to run it. This adds the idlharness.html tester, and
updates the .idl file to match the current implementation.

Bug: 326681249
Change-Id: I467b389b00f969fa78fa51d47df5c9f2ef23dfd4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6197038
Reviewed-by: David Baron <[email protected]>
Commit-Queue: David Baron <[email protected]>
Auto-Submit: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1410899}
  • Loading branch information
mfreed7 authored and chromium-wpt-export-bot committed Jan 24, 2025
1 parent 598dbb9 commit aa00e88
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<link rel="author" href="mailto:[email protected]" />
<link rel="help" href="https://open-ui.org/components/interest-invokers.explainer/" />
<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>
idl_test(["interest-invokers.tentative"],
["html","dom","SVG"], (idl_array) => {
idl_array.add_objects({
HTMLAnchorElement: ['document.createElement("a")'],
HTMLAreaElement: ['document.createElement("area")'],
HTMLButtonElement: ['document.createElement("button")'],
SVGAElement: ['document.createElementNS("http://www.w3.org/2000/svg", "a")'],
InterestEvent: ['new InterestEvent("interest")']
});
});
</script>
15 changes: 13 additions & 2 deletions interfaces/interest-invokers.tentative.idl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ interface mixin InterestInvokerElement {
[CEReactions,Reflect=interesttarget] attribute Element? interestTargetElement;
};

HTMLInputElement includes InterestInvokerElement;
HTMLAnchorElement includes InterestInvokerElement;
HTMLAreaElement includes InterestInvokerElement;
HTMLButtonElement includes InterestInvokerElement;
HTMLAnchorElement includes InterestInvokerElement;
SVGAElement includes InterestInvokerElement;

[Exposed=Window]
interface InterestEvent : Event {
constructor(DOMString type, optional InterestEventInit eventInitDict = {});
readonly attribute Element? source;
};

dictionary InterestEventInit : EventInit {
Element? source = null;
};

0 comments on commit aa00e88

Please sign in to comment.