Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added idlharness tests for html5 forms elements #229

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions html/semantics/forms/the-button-element/button_idlharness.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Test: button_idlharness</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="help" href="http://www.w3.org/TR/2012/CR-html5-20121217/forms.html#the-button-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/webidl2/lib/webidl2.js"></script>
<script src="/resources/idlharness.js"></script>
</head>
<body>
<p>This test verifies the HTMLButtonElement interface included in the HTML5.0 specification</p>

<pre id='untested_idl' style='display:none'>
interface HTMLElement {
};
interface HTMLFormElement {
};
interface ValidityState {
};
interface NodeList {
};
</pre>

<pre id='idl' style='display:none'>
interface HTMLButtonElement : HTMLElement {
attribute boolean autofocus;
attribute boolean disabled;
readonly attribute HTMLFormElement? form;
attribute DOMString formAction;
attribute DOMString formEnctype;
attribute DOMString formMethod;
attribute boolean formNoValidate;
attribute DOMString formTarget;
attribute DOMString name;
attribute DOMString type;
attribute DOMString value;

readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
void setCustomValidity(DOMString error);

readonly attribute NodeList labels;
};
</pre>

<div>
<form style="display:none">
<button id="testElement">Button</button>
</form>
</div>

<div id="log"></div>

<script>
(function() {
var idl_array = new IdlArray();

idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
idl_array.add_idls(document.getElementById("idl").textContent);

var testElement = document.getElementById("testElement");

idl_array.add_objects({HTMLButtonElement: [testElement]});

idl_array.test();
})();
</script>
</body>
</html>
55 changes: 55 additions & 0 deletions html/semantics/forms/the-datalist-element/datalist_idlharness.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Test: datalist_idlharness</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="help" href="http://www.w3.org/TR/2012/CR-html5-20121217/forms.html#the-datalist-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/webidl2/lib/webidl2.js"></script>
<script src="/resources/idlharness.js"></script>
</head>
<body>
<p>This test verifies the HTMLDataListElement interface included in the HTML5.0 specification</p>

<pre id='untested_idl' style='display:none'>
interface HTMLElement {
};
interface HTMLCollection {
};
</pre>

<pre id='idl' style='display:none'>
interface HTMLDataListElement : HTMLElement {
readonly attribute HTMLCollection options;
};
</pre>

<div>
<form style='display:none'>
<datalist id="testdatalist">
<option>TEST1</option>
<option>TEST2</option>
</datalist>
</form>
</div>

<div id="log"></div>

<script>
(function() {
var idl_array = new IdlArray();

idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
idl_array.add_idls(document.getElementById("idl").textContent);

var testElement = document.getElementById("testdatalist");

idl_array.add_objects({HTMLDataListElement: [testElement]});

idl_array.test();
})();
</script>
</body>
</html>
68 changes: 68 additions & 0 deletions html/semantics/forms/the-fieldset-element/fieldset_idlharness.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Test: fieldset_idlharness</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="help" href="http://www.w3.org/TR/2012/CR-html5-20121217/forms.html#the-fieldset-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/webidl2/lib/webidl2.js"></script>
<script src="/resources/idlharness.js"></script>
</head>
<body>
<p>This test verifies the HTMLFieldSetElement interface included in the HTML5.0 specification</p>

<pre id='untested_idl' style='display:none'>
interface HTMLElement {
};
interface HTMLFormElement {
};
interface HTMLFormControlsCollection {
};
interface ValidityState {
};
</pre>

<pre id='idl' style='display:none'>
interface HTMLFieldSetElement : HTMLElement {
attribute boolean disabled;
readonly attribute HTMLFormElement? form;
attribute DOMString name;

readonly attribute DOMString type;

readonly attribute HTMLFormControlsCollection elements;

readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
void setCustomValidity(DOMString error);
};
</pre>

<div>
<form style="display:none">
<fieldset id="testElement"></fieldset>
</form>
</div>

<div id="log"></div>

<script>
(function() {
var idl_array = new IdlArray();

idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
idl_array.add_idls(document.getElementById("idl").textContent);

var testElement = document.getElementById("testElement");

idl_array.add_objects({HTMLFieldSetElement: [testElement]});

idl_array.test();
})();
</script>
</body>
</html>
68 changes: 68 additions & 0 deletions html/semantics/forms/the-form-element/form_idlharness.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Test: form_idlharness</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="help" href="http://www.w3.org/TR/2012/CR-html5-20121217/forms.html#the-form-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/webidl2/lib/webidl2.js"></script>
<script src="/resources/idlharness.js"></script>
</head>
<body>
<p>This test verifies the HTMLFormElement interface included in the HTML5.0 specification</p>

<pre id='untested_idl' style='display:none'>
interface HTMLElement {
};
interface HTMLFormControlsCollection {
};
</pre>

<pre id='idl' style='display:none'>
interface HTMLFormElement : HTMLElement {
attribute DOMString acceptCharset;
attribute DOMString action;
attribute DOMString autocomplete;
attribute DOMString enctype;
attribute DOMString encoding;
attribute DOMString method;
attribute DOMString name;
attribute boolean noValidate;
attribute DOMString target;

readonly attribute HTMLFormControlsCollection elements;
readonly attribute long length;
getter Element (unsigned long index);
getter object (DOMString name);

void submit();
void reset();
boolean checkValidity();
};
</pre>

<div>
<form id="testElement" style="display:none">
</form>
</div>

<div id="log"></div>

<script>
(function() {
var idl_array = new IdlArray();

idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
idl_array.add_idls(document.getElementById("idl").textContent);

var testElement = document.getElementById("testElement");

idl_array.add_objects({HTMLFormElement: [testElement]});

idl_array.test();
})();
</script>
</body>
</html>
111 changes: 111 additions & 0 deletions html/semantics/forms/the-input-element/input_idlharness.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Test: input_idlharness</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="help" href="http://www.w3.org/TR/2012/CR-html5-20121217/forms.html#the-input-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/webidl2/lib/webidl2.js"></script>
<script src="/resources/idlharness.js"></script>
</head>
<body>
<p>This test verifies the HTMLInputElement interface included in the HTML5.0 specification</p>

<pre id="untested_idl" style="display:none">
interface HTMLElement {
};
interface HTMLFormElement {
};
interface FileList {
};
interface Date {
};
interface ValidityState {
};
</pre>

<pre id="idl" style="display:none">
interface HTMLInputElement : HTMLElement {
attribute DOMString accept;
attribute DOMString alt;
attribute DOMString autocomplete;
attribute boolean autofocus;
attribute boolean defaultChecked;
attribute boolean checked;
attribute DOMString dirName;
attribute boolean disabled;
readonly attribute HTMLFormElement? form;
readonly attribute FileList? files;
attribute DOMString formAction;
attribute DOMString formEnctype;
attribute DOMString formMethod;
attribute boolean formNoValidate;
attribute DOMString formTarget;
attribute unsigned long height;
attribute boolean indeterminate;
readonly attribute HTMLElement? list;
attribute DOMString max;
attribute long maxLength;
attribute DOMString min;
attribute boolean multiple;
attribute DOMString name;
attribute DOMString pattern;
attribute DOMString placeholder;
attribute boolean readOnly;
attribute boolean required;
attribute unsigned long size;
attribute DOMString src;
attribute DOMString step;
attribute DOMString type;
attribute DOMString defaultValue;
[TreatNullAs=EmptyString] attribute DOMString value;
attribute Date? valueAsDate;
attribute unrestricted double valueAsNumber;
attribute unsigned long width;

void stepUp(optional long n);
void stepDown(optional long n);

readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
void setCustomValidity(DOMString error);

readonly attribute NodeList labels;

void select();
attribute unsigned long selectionStart;
attribute unsigned long selectionEnd;
attribute DOMString selectionDirection;

void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction);
};
</pre>

<div>
<form style="display:none">
<input id="testInput" type="text">
</form>
</div>

<div id="log"></div>

<script>
(function() {
var idl_array = new IdlArray();

idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
idl_array.add_idls(document.getElementById("idl").textContent);

var testElement = document.getElementById("testInput");

idl_array.add_objects({HTMLInputElement: [testElement]});

idl_array.test();
})();
</script>
</body>
</html>
Loading