Bug 559284. Make various HTML5 sectioning elements display:block. r=dbaron
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 26 Apr 2010 16:27:01 -0400
changeset 41353 0ac6c9f25269
parent 41352 330848610d95
child 41354 5d310c069d6d
push id12981
push userbzbarsky@mozilla.com
push dateMon, 26 Apr 2010 20:28:16 +0000
treeherdermozilla-central@5d310c069d6d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs559284
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 559284. Make various HTML5 sectioning elements display:block. r=dbaron
content/html/content/test/Makefile.in
content/html/content/test/test_bug559284.html
layout/reftests/bugs/559284-1-ref.html
layout/reftests/bugs/559284-1.html
layout/reftests/bugs/reftest.list
layout/style/html.css
--- a/content/html/content/test/Makefile.in
+++ b/content/html/content/test/Makefile.in
@@ -153,12 +153,13 @@ include $(topsrcdir)/config/rules.mk
 		test_bug529819.html \
 		test_bug529859.html \
 		test_bug535043.html \
 		test_bug547850.html \
 		test_bug457800.html \
 		test_bug536891.html \
 		test_bug536895.html \
 		test_bug458037.xhtml \
+		test_bug559284.html \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/content/html/content/test/test_bug559284.html
@@ -0,0 +1,74 @@
+
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=559284
+-->
+<head>
+  <title>Test for Bug 559284</title>
+  <script type="application/javascript" src="/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=559284">Mozilla Bug 559284</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+  <section id="section"></section>
+  <nav id="nav"></nav>
+  <article id="article"></article>
+  <aside id="aside"></aside>
+  <hgroup id="hgroup"></hgroup>
+  <header id="header"></header>
+  <footer id="footer"></footer>
+</div>
+<pre id="test">
+<script type="application/javascript">
+
+/** Test for Bug 559284 **/
+  todo_is($("section").constructor, "[object HTMLElement]",
+          "Constructor should be section");
+  todo_is($("section").toString().substring(0, 19), "[object HTMLElement",
+          "Section should be HTMLElement");
+  is($("section") instanceof HTMLElement, true,
+       "Section should be instance of HTMLElement");
+  todo_is($("nav").constructor, "[object HTMLElement]",
+          "Constructor should be nav");
+  todo_is($("nav").toString().substring(0, 19), "[object HTMLElement",
+          "Nav should be HTMLElement");
+  is($("nav") instanceof HTMLElement, true,
+       "Nav should be instance of HTMLElement");
+  todo_is($("article").constructor, "[object HTMLElement]",
+          "Constructor should be article");
+  todo_is($("article").toString().substring(0, 19), "[object HTMLElement",
+          "Article should be HTMLElement");
+  is($("article") instanceof HTMLElement, true,
+       "Article should be instance of HTMLElement");
+  todo_is($("aside").constructor, "[object HTMLElement]",
+          "Constructor should be aside");
+  todo_is($("aside").toString().substring(0, 19), "[object HTMLElement",
+          "Aside should be HTMLElement");
+  is($("aside") instanceof HTMLElement, true,
+       "Aside should be instance of HTMLElement");
+  todo_is($("hgroup").constructor, "[object HTMLElement]",
+          "Constructor should be hgroup");
+  todo_is($("hgroup").toString().substring(0, 19), "[object HTMLElement",
+          "Hgroup should be HTMLElement");
+  is($("hgroup") instanceof HTMLElement, true,
+       "Hgroup should be instance of HTMLElement");
+  todo_is($("header").constructor, "[object HTMLElement]",
+          "Constructor should be header");
+  todo_is($("header").toString().substring(0, 19), "[object HTMLElement",
+          "Header should be HTMLElement");
+  is($("header") instanceof HTMLElement, true,
+       "Header should be instance of HTMLElement");
+  todo_is($("footer").constructor, "[object HTMLElement]",
+          "Constructor should be footer");
+  todo_is($("footer").toString().substring(0, 19), "[object HTMLElement",
+          "Footer should be HTMLElement");
+  is($("footer") instanceof HTMLElement, true,
+       "Footer should be instance of HTMLElement");
+</script>
+</pre>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/559284-1-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<body>
+  -<div>section</div>
+  -<div>nav</div>
+  -<div>article</div>
+  -<div>aside</div>
+  -<div>hgroup</div>
+  -<div>header</div>
+  -<div>footer</div>
+  -
+</body>
+
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/559284-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<body>
+  -<section>section</section>
+  -<nav>nav</nav>
+  -<article>article</article>
+  -<aside>aside</aside>
+  -<hgroup>hgroup</hgroup>
+  -<header>header</header>
+  -<footer>footer</footer>
+  -
+</body>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1420,8 +1420,9 @@ random-if(!haveTestPlugin) == 541406-1.h
 random-if(!haveTestPlugin) == 546071-1.html 546071-1-ref.html
 == 549184-1.html 549184-1-ref.html
 == 550716-1.html 550716-1-ref.html
 == 551463-1.html 551463-1-ref.html
 == 551699-1.html 551699-1-ref.html
 == 552334-1.html 552334-1-ref.html
 == 556661-1.html 556661-1-ref.html
 == 557736-1.html 557736-1-ref.html
+== 559284-1.html 559284-1-ref.html
--- a/layout/style/html.css
+++ b/layout/style/html.css
@@ -55,27 +55,84 @@ bdo[dir] {
 /* To ensure http://www.w3.org/TR/REC-html40/struct/dirlang.html#style-bidi:
  *
  * "When a block element that does not have a dir attribute is transformed to
  * the style of an inline element by a style sheet, the resulting presentation
  * should be equivalent, in terms of bidirectional formatting, to the
  * formatting obtained by explicitly adding a dir attribute (assigned the
  * inherited value) to the transformed element." */
 
-address, blockquote, body, caption, center, col, colgroup, dd, dir, div, dl, dt,
-fieldset, form, h1, h2, h3, h4, h5, h6, hr, html, isindex, li, listing, map, 
-marquee, menu, noframes, ol, p, plaintext, pre, table, tbody, td, tfoot, th, 
-thead, tr, ul, xmp {
+address,
+article,
+aside,
+blockquote,
+body,
+caption,
+center,
+col,
+colgroup,
+dd,
+dir,
+div,
+dl,
+dt,
+fieldset,
+footer,
+form,
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+header,
+hgroup,
+hr,
+html,
+isindex,
+li,
+listing,
+map,
+marquee,
+menu,
+nav,
+noframes,
+ol,
+p,
+plaintext,
+pre,
+section,
+table,
+tbody,
+td,
+tfoot,
+th,
+thead,
+tr,
+ul,
+xmp {
   unicode-bidi: embed;
 }
 
 
 /* blocks */
 
-html, div, map, dt, isindex, form {
+article,
+aside,
+footer,
+header,
+hgroup,
+html,
+div,
+map,
+dt,
+isindex,
+form,
+nav,
+section {
   display: block;
 }
 
 body {
   display: block;
   margin: 8px;
 }