mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Add the test about Element attributes.
This commit is contained in:
parent
19c1b023e0
commit
ecc68a5001
1 changed files with 29 additions and 0 deletions
29
src/test/html/content/test_element_attribute.html
Normal file
29
src/test/html/content/test_element_attribute.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
<html>
|
||||
<head id="foo">
|
||||
<title></title>
|
||||
<script src="harness.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="test" foo="bar"></div>
|
||||
<script>
|
||||
let test = document.getElementById("test");
|
||||
|
||||
{
|
||||
let r1 = test.getAttribute("id");
|
||||
is(r1, "test", "test1-0, Element.getAttribute().");
|
||||
let r2 = test.getAttribute("foo");
|
||||
is(r2, "bar", "test1-1, Element.getAttribute().");
|
||||
}
|
||||
|
||||
{
|
||||
let NAME = "hoge";
|
||||
let VALUE = "fuga";
|
||||
test.setAttribute(NAME, VALUE);
|
||||
let r = test.getAttribute(NAME);
|
||||
is(r, VALUE, "test2. Element.setAttribute().");
|
||||
}
|
||||
|
||||
finish();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue