mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1003539 - change HTMLTableElement::insertRow so that it when no row is present, it adds a row to the last TBODY element of the table; r=bzbarsky
This commit is contained in:
parent
18ed3a9494
commit
ba35dedd06
@ -548,17 +548,12 @@ HTMLTableElement::InsertRow(int32_t aIndex, ErrorResult& aError)
|
||||
}
|
||||
} else {
|
||||
// the row count was 0, so
|
||||
// find the first row group and insert there as first child
|
||||
// find the last row group and insert there as first child
|
||||
nsCOMPtr<nsIContent> rowGroup;
|
||||
for (nsIContent* child = nsINode::GetFirstChild();
|
||||
for (nsIContent* child = nsINode::GetLastChild();
|
||||
child;
|
||||
child = child->GetNextSibling()) {
|
||||
nsINodeInfo *childInfo = child->NodeInfo();
|
||||
nsIAtom *localName = childInfo->NameAtom();
|
||||
if (childInfo->NamespaceID() == kNameSpaceID_XHTML &&
|
||||
(localName == nsGkAtoms::thead ||
|
||||
localName == nsGkAtoms::tbody ||
|
||||
localName == nsGkAtoms::tfoot)) {
|
||||
child = child->GetPreviousSibling()) {
|
||||
if (child->IsHTML(nsGkAtoms::tbody)) {
|
||||
rowGroup = child;
|
||||
break;
|
||||
}
|
||||
|
@ -410,6 +410,7 @@ skip-if = (toolkit == 'gonk' && debug) || e10s #debug-only failure
|
||||
[test_bug885024.html]
|
||||
[test_bug893537.html]
|
||||
[test_bug969346.html]
|
||||
[test_bug1003539.html]
|
||||
[test_change_crossorigin.html]
|
||||
[test_checked.html]
|
||||
[test_dir_attributes_reflection.html]
|
||||
|
37
content/html/content/test/test_bug1003539.html
Normal file
37
content/html/content/test/test_bug1003539.html
Normal file
@ -0,0 +1,37 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1003539
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1003539</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 1003539 **/
|
||||
// Refering to this specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/tabular-data.html#dom-table-insertrow
|
||||
var tab;
|
||||
tab = document.createElement("table");
|
||||
tab.createTHead();
|
||||
tab.insertRow();
|
||||
is(tab.innerHTML, '<thead></thead><tbody><tr></tr></tbody>', "Row should be inserted in the tbody.");
|
||||
|
||||
tab = document.createElement("table");
|
||||
tab.createTBody();
|
||||
tab.createTBody();
|
||||
tab.insertRow();
|
||||
is(tab.innerHTML, '<tbody></tbody><tbody><tr></tr></tbody>', "Row should be inserted in the last tbody.");
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1003539">Mozilla Bug 1003539</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -1,5 +1,3 @@
|
||||
{
|
||||
"insertRow should not copy prefixes": true,
|
||||
"insertRow should insert into a tbody, not into a thead, if table.rows is empty": true,
|
||||
"insertRow should insert into a tbody, not into a tfoot, if table.rows is empty": true
|
||||
"insertRow should not copy prefixes": true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user