|
1 | 1 | <!DOCTYPE html> |
2 | 2 | <script src="../testing.js"></script> |
3 | 3 |
|
4 | | -<div id="content"> |
| 4 | +<div id="content" dir="ltr"> |
5 | 5 | <a id="link" href="foo" class="ok">OK</a> |
6 | 6 | <p id="para-empty" class="ok empty"> |
7 | 7 | <span id="para-empty-child"></span> |
|
52 | 52 |
|
53 | 53 | <script id=attributes> |
54 | 54 | testing.expectEqual(true, content.hasAttributes()); |
55 | | - testing.expectEqual(1, content.attributes.length); |
56 | | - testing.expectEqual(['id'], content.getAttributeNames()); |
| 55 | + testing.expectEqual(2, content.attributes.length); |
| 56 | + testing.expectEqual(['id', 'dir'], content.getAttributeNames()); |
57 | 57 | testing.expectEqual('content', content.getAttribute('id')); |
58 | 58 | testing.expectEqual('content', content.attributes['id'].value); |
59 | 59 |
|
60 | 60 | let x = ''; |
61 | 61 | for (const attr of content.attributes) { |
62 | | - x += attr.name + '=' + attr.value; |
| 62 | + x += attr.name + '=' + attr.value + ','; |
63 | 63 | } |
64 | | - testing.expectEqual('id=content', x); |
| 64 | + testing.expectEqual('id=content,dir=ltr,', x); |
65 | 65 |
|
66 | 66 | testing.expectEqual(false, content.hasAttribute('foo')); |
67 | 67 | testing.expectEqual(null, content.getAttribute('foo')); |
68 | 68 |
|
69 | 69 | content.setAttribute('foo', 'bar'); |
70 | 70 | testing.expectEqual(true, content.hasAttribute('foo')); |
71 | 71 | testing.expectEqual('bar', content.getAttribute('foo')); |
72 | | - testing.expectEqual(['id', 'foo'], content.getAttributeNames()); |
| 72 | + testing.expectEqual(['id', 'dir', 'foo'], content.getAttributeNames()); |
73 | 73 |
|
74 | 74 | testing.expectError('Error: InvalidCharacterError', () => { |
75 | 75 | content.setAttribute('.foo', 'invalid') |
|
266 | 266 |
|
267 | 267 | <script id=elementDir> |
268 | 268 | const divElement = document.createElement("div"); |
269 | | - // Always initialized with empty string. |
| 269 | + // Always initialized with empty string if `dir` attribute not provided. |
270 | 270 | testing.expectEqual("", divElement.dir); |
271 | 271 |
|
272 | 272 | divElement.dir = "ltr"; |
|
0 commit comments