Reviewed by Sam Weinig.
- Implement HTML5 nav element
https://bugs.webkit.org/show_bug.cgi?id=27937
<nav> should behave essentially the same as <div> for parsing
etc. This is implemented by the changes below.
Tests: fast/html/nav-element.html
* css/html.css:
* editing/htmlediting.cpp:
(WebCore::validBlockTag):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::tagPriority):
(WebCore::blockTagList):
* html/HTMLParser.cpp:
(WebCore::HTMLParser::getNode):
* html/HTMLTagNames.in:
2009-08-13 Maciej Stachowiak <mjs@apple.com>
Reviewed by Sam Weinig.
- Tests for: Implement HTML5 nav element
https://bugs.webkit.org/show_bug.cgi?id=27937
Test aspects of <nav>, including residual style, <p> closing, and FormatBlock.
* fast/html/nav-element-expected.txt: Added.
* fast/html/nav-element.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47489
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2009-08-13 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ - Tests for: Implement HTML5 nav element
+ https://bugs.webkit.org/show_bug.cgi?id=27937
+
+ Test aspects of <nav>, including residual style, <p> closing, and FormatBlock.
+
+ * fast/html/nav-element-expected.txt: Added.
+ * fast/html/nav-element.html: Added.
+
2009-08-18 Oliver Hunt <oliver@apple.com>
Reviewed by NOBODY (Build fix).
--- /dev/null
+Test content
+
+Test that nav closes p. This paragraph should be surrounded by a thin green border, instead of a thick red one. Also tests that nav lays out as a block. There should be only a single border box with width of the content area (minus margins).
+
+Test that p does not close nav. This paragraph should have a double green border.
+
+Test that nav can nest inside itself. This paragraph should have a double green border.
+
+Test of residual style. This text should be bold.
+This should be bold too.
+
+Test of FormatBlock behavior. This text should have a green border.
+
+DOM for the above (so this test can dump as text)
+
+
+<p></p><nav>Test that <code>nav</code> closes <code>p</code>. This paragraph should be surrounded by a thin green border, instead of a thick red one. Also tests that nav lays out as a block. There should be only a single border box with width of the content area (minus margins).</nav>
+<br>
+<nav><p>Test that <code>p</code> does not close <code>nav</code>. This paragraph should have a double green border.</p></nav>
+<br>
+<nav><nav>Test that <code>nav</code> can nest inside itself. This paragraph should have a double green border.</nav></nav>
+<br>
+<b><nav>Test of residual style. This text should be bold.</nav>This should be bold too.</b>
+
+<p><br></p>
+
+<div contenteditable="true" id="editable"><nav>Test of FormatBlock behavior. This text should have a green border.<br></nav></div>
+
--- /dev/null
+<!doctype HTML>
+<html>
+<head>
+<title>Test of HTML5 nav element</title>
+
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+
+<style>
+nav { border: 1px solid green; padding: 2px; }
+p > nav { border: 3px solid red; }
+nav > p { border: 1px solid green; }
+p { margin: 0px; }
+</style>
+
+</head>
+<body>
+
+<h4>Test content</h4>
+
+<div id=testArea>
+<p><nav>Test that <code>nav</code> closes <code>p</code>. This paragraph should be surrounded by a thin green border, instead of a thick red one. Also tests that nav lays out as a block. There should be only a single border box with width of the content area (minus margins).</nav>
+<br>
+<nav><p>Test that <code>p</code> does not close <code>nav</code>. This paragraph should have a double green border.</nav>
+<br>
+<nav><nav>Test that <code>nav</code> can nest inside itself. This paragraph should have a double green border.</nav></nav>
+<br>
+<b><nav>Test of residual style. This text should be bold.</nav>This should be bold too.</b>
+
+<p><br></p>
+
+<div contentEditable=true id=editable>
+Test of FormatBlock behavior. This text should have a green border.
+</div>
+</div>
+
+<br>
+
+<hr>
+
+<h4>DOM for the above (so this test can dump as text)</h4>
+<pre id=markupArea>
+</pre>
+
+
+<script>
+var ed = document.getElementById("editable");
+var selection = window.getSelection();
+selection.selectAllChildren(ed);
+document.execCommand("FormatBlock", false, "nav");
+selection.collapse();
+ed.blur();
+
+var tests = document.getElementById("testArea");
+var markup = document.getElementById("markupArea");
+var textNode = document.createTextNode(testArea.innerHTML);
+markup.appendChild(textNode);
+
+</script>
+
+</body>
+</html>
+2009-08-13 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ - Implement HTML5 nav element
+ https://bugs.webkit.org/show_bug.cgi?id=27937
+
+ <nav> should behave essentially the same as <div> for parsing
+ etc. This is implemented by the changes below.
+
+ Tests: fast/html/nav-element.html
+
+ * css/html.css:
+ * editing/htmlediting.cpp:
+ (WebCore::validBlockTag):
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::tagPriority):
+ (WebCore::blockTagList):
+ * html/HTMLParser.cpp:
+ (WebCore::HTMLParser::getNode):
+ * html/HTMLTagNames.in:
+
2009-08-18 Anders Carlsson <andersca@apple.com>
Reviewed by Adele Peterson, David Hyatt and Dan Bernstein.
display: block
}
+nav {
+ display: block
+}
+
marquee {
display: inline-block;
overflow: -webkit-marquee
// Checks if a string is a valid tag for the FormatBlockCommand function of execCommand. Expects lower case strings.
bool validBlockTag(const String& blockTag)
{
+ // FIXME: convert this to a HashSet
if (blockTag == "address" ||
blockTag == "blockquote" ||
blockTag == "dd" ||
blockTag == "h4" ||
blockTag == "h5" ||
blockTag == "h6" ||
+ blockTag == "nav" ||
blockTag == "p" ||
blockTag == "pre")
return true;
return 0;
if (hasLocalName(addressTag) || hasLocalName(ddTag) || hasLocalName(dtTag) || hasLocalName(noscriptTag) || hasLocalName(rpTag) || hasLocalName(rtTag))
return 3;
- if (hasLocalName(centerTag) || hasLocalName(nobrTag) || hasLocalName(rubyTag))
+ if (hasLocalName(centerTag) || hasLocalName(nobrTag) || hasLocalName(rubyTag) || hasLocalName(navTag))
return 5;
if (hasLocalName(noembedTag) || hasLocalName(noframesTag))
return 10;
tagList.add(listingTag.localName().impl());
tagList.add(marqueeTag.localName().impl());
tagList.add(menuTag.localName().impl());
+ tagList.add(navTag.localName().impl());
tagList.add(noembedTag.localName().impl());
tagList.add(noframesTag.localName().impl());
tagList.add(nolayerTag.localName().impl());
gFunctionMap.set(listingTag.localName().impl(), &HTMLParser::pCloserCreateErrorCheck);
gFunctionMap.set(mapTag.localName().impl(), &HTMLParser::mapCreateErrorCheck);
gFunctionMap.set(menuTag.localName().impl(), &HTMLParser::pCloserCreateErrorCheck);
+ gFunctionMap.set(navTag.localName().impl(), &HTMLParser::pCloserCreateErrorCheck);
gFunctionMap.set(nobrTag.localName().impl(), &HTMLParser::nestedCreateErrorCheck);
gFunctionMap.set(noembedTag.localName().impl(), &HTMLParser::noembedCreateErrorCheck);
gFunctionMap.set(noframesTag.localName().impl(), &HTMLParser::noframesCreateErrorCheck);
marquee createWithNew
menu createWithNew
meta createWithNew
+nav interfaceName=HTMLElement, createWithNew
nobr interfaceName=HTMLElement, createWithNew
noembed interfaceName=HTMLElement, createWithNew
noframes interfaceName=HTMLElement, createWithNew