-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2009-12-29 Kent Tamura <tkent@chromium.org>
Reviewed by Maciej Stachowiak. Implement HTML5 <aside> element. https://bugs.webkit.org/show_bug.cgi?id=32943 <aside> should behave the same as <nav>, <section>, and <article>. Test: fast/html/aside-element.html * css/html.css: Add aside as a block element. * editing/htmlediting.cpp: (WebCore::validBlockTag): Add asideTag. * html/HTMLElement.cpp: (WebCore::HTMLElement::tagPriority): Returns 5 for asideTag. (WebCore::blockTagList): Add asideTag. * html/HTMLParser.cpp: (WebCore::HTMLParser::getNode): Add asideTag. * html/HTMLTagNames.in: Add aside. 2009-12-29 Kent Tamura <tkent@chromium.org> Reviewed by Maciej Stachowiak. Implement HTML5 <aside> element. https://bugs.webkit.org/show_bug.cgi?id=32943 The new test file tests: - <p> closing, - Residual style, and - FormatBlock. * fast/html/aside-element-expected.txt: Added. * fast/html/aside-element.html: Added. * fast/html/script-tests/aside-element.js: Added. Canonical link: https://commits.webkit.org/44033@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@52620 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
10 changed files
with
119 additions
and
2 deletions.
There are no files selected for viewing
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,20 @@ | ||
Various tests for the aside element. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
<aside> closes <p>: | ||
PASS aside1.parentNode.nodeName == "p" is false | ||
<p> does not close <aside>: | ||
PASS p1.parentNode.nodeName is "ASIDE" | ||
<aside> can be nested inside <aside>: | ||
PASS aside3.parentNode.id is "aside2" | ||
Residual style: | ||
PASS getWeight("aside4") is "bold" | ||
PASS getWeight("span1") is "bold" | ||
FormatBlock: | ||
PASS document.getElementById("span2").parentNode.nodeName is "ASIDE" | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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,13 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css"> | ||
<script src="../../fast/js/resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<p id="description"></p> | ||
<div id="console"></div> | ||
<script src="script-tests/aside-element.js"></script> | ||
<script src="../../fast/js/resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
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,43 @@ | ||
description('Various tests for the aside element.'); | ||
|
||
var testParent = document.createElement('div'); | ||
document.body.appendChild(testParent); | ||
|
||
debug('<aside> closes <p>:'); | ||
testParent.innerHTML = '<p>Test that <aside id="aside1">an aside element</nav> closes <p>.</p>'; | ||
var aside1 = document.getElementById('aside1'); | ||
shouldBeFalse('aside1.parentNode.nodeName == "p"'); | ||
|
||
debug('<p> does not close <aside>:'); | ||
testParent.innerHTML = '<aside>Test that <p id="p1">a p element</p> does not close an aside element.</aside>'; | ||
var p1 = document.getElementById('p1'); | ||
shouldBe('p1.parentNode.nodeName', '"ASIDE"'); | ||
|
||
debug('<aside> can be nested inside <aside>:'); | ||
testParent.innerHTML = '<aside id="aside2">Test that <aside id="aside3">an aside element</aside> can be nested inside another.</aside>'; | ||
var aside3 = document.getElementById('aside3'); | ||
shouldBe('aside3.parentNode.id', '"aside2"'); | ||
|
||
debug('Residual style:'); | ||
testParent.innerHTML = '<b><aside id="aside4">This text should be bold.</aside> <span id="span1">This is also bold.</span></b>'; | ||
function getWeight(id) { | ||
return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); | ||
} | ||
shouldBe('getWeight("aside4")', '"bold"'); | ||
shouldBe('getWeight("span1")', '"bold"'); | ||
document.body.removeChild(testParent); | ||
|
||
debug('FormatBlock:'); | ||
var editable = document.createElement('div'); | ||
editable.innerHTML = '[<span id="span2">The text will be a child of <aside>.</span>]'; | ||
document.body.appendChild(editable); | ||
editable.contentEditable = true; | ||
var selection = window.getSelection(); | ||
selection.selectAllChildren(editable); | ||
document.execCommand('FormatBlock', false, 'aside'); | ||
selection.collapse(); | ||
shouldBe('document.getElementById("span2").parentNode.nodeName', '"ASIDE"'); | ||
document.body.removeChild(editable); | ||
|
||
var successfullyParsed = true; | ||
|
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 |
---|---|---|
|
@@ -72,7 +72,7 @@ layer { | |
display: block | ||
} | ||
|
||
article, nav, section { | ||
article, aside, nav, section { | ||
display: block | ||
} | ||
|
||
|
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