forked from jeresig/env-js
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented .innerText getter and setter for HTML elements. <title>.text
now implemented in terms of this. New unit tests.
- Loading branch information
Showing
7 changed files
with
94 additions
and
43 deletions.
There are no files selected for viewing
Binary file not shown.
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
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
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
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
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
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,29 @@ | ||
module("elementmembers"); | ||
|
||
// We ought to have test coverage for all members of all DOM objects, but | ||
// until then, add test cases here for members as they are created | ||
|
||
test("attributes common to all HTML elements", function() { | ||
expect(4); | ||
|
||
// tests for .innerText | ||
var mtch = document.getElementById('dl').innerText.match( | ||
/^See this blog entry for more information.\s+Here are/); | ||
try{ ok(mtch && mtch.length > 0, | ||
"dl.innerText returns the correct content"); | ||
}catch(e){print(e);} | ||
|
||
mtch = document.getElementById('sndp').innerText.match(/^Everything insid/); | ||
try{ ok(mtch && mtch.length > 0, | ||
"p.innerText returns the correct content"); | ||
}catch(e){print(e);} | ||
|
||
try{ ok(document.getElementById('sndp').innerText = "test text" || true, | ||
"p.innerText= operates without exception"); | ||
}catch(e){print(e);} | ||
|
||
try{ ok(document.getElementById('sndp').innerText == "test text", | ||
"p.innerText= changes content of element"); | ||
}catch(e){print(e);} | ||
}); | ||
|