mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 1335356 - Part 1: Insert caption and thead in the right order. r=smaug
This commit is contained in:
parent
a4109eb8fa
commit
3c26f56f0b
@ -411,8 +411,19 @@ HTMLTableElement::CreateTHead()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ErrorResult rv;
|
||||
nsCOMPtr<nsINode> refNode = nsINode::GetFirstChild();
|
||||
nsCOMPtr<nsIContent> refNode = nullptr;
|
||||
for (refNode = nsINode::GetFirstChild();
|
||||
refNode;
|
||||
refNode = refNode->GetNextSibling()) {
|
||||
|
||||
if (refNode->IsHTMLElement() &&
|
||||
!refNode->IsHTMLElement(nsGkAtoms::caption) &&
|
||||
!refNode->IsHTMLElement(nsGkAtoms::colgroup)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
IgnoredErrorResult rv;
|
||||
nsINode::InsertBefore(*head, refNode, rv);
|
||||
}
|
||||
return head.forget();
|
||||
@ -475,7 +486,9 @@ HTMLTableElement::CreateCaption()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AppendChildTo(caption, true);
|
||||
IgnoredErrorResult rv;
|
||||
nsCOMPtr<nsINode> firsChild = nsINode::GetFirstChild();
|
||||
nsINode::InsertBefore(*caption, firsChild, rv);
|
||||
}
|
||||
return caption.forget();
|
||||
}
|
||||
@ -514,7 +527,7 @@ HTMLTableElement::CreateTBody()
|
||||
}
|
||||
}
|
||||
|
||||
ErrorResult rv;
|
||||
IgnoredErrorResult rv;
|
||||
nsINode::InsertBefore(*newBody, referenceNode, rv);
|
||||
|
||||
return newBody.forget();
|
||||
|
@ -36,7 +36,8 @@ public:
|
||||
{
|
||||
DeleteCaption();
|
||||
if (aCaption) {
|
||||
nsINode::AppendChild(*aCaption, aError);
|
||||
nsCOMPtr<nsINode> firstChild = nsINode::GetFirstChild();
|
||||
nsINode::InsertBefore(*aCaption, firstChild, aError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,7 +60,18 @@ public:
|
||||
|
||||
DeleteTHead();
|
||||
if (aTHead) {
|
||||
nsCOMPtr<nsINode> refNode = nsINode::GetFirstChild();
|
||||
|
||||
nsCOMPtr<nsIContent> refNode = nullptr;
|
||||
for (refNode = nsINode::GetFirstChild();
|
||||
refNode;
|
||||
refNode = refNode->GetNextSibling()) {
|
||||
if (refNode->IsHTMLElement() &&
|
||||
!refNode->IsHTMLElement(nsGkAtoms::caption) &&
|
||||
!refNode->IsHTMLElement(nsGkAtoms::colgroup)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
nsINode::InsertBefore(*aTHead, refNode, aError);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
[caption_001.html]
|
||||
type: testharness
|
||||
[setting caption on a table]
|
||||
expected: FAIL
|
||||
|
@ -1,14 +1,4 @@
|
||||
[caption-methods.html]
|
||||
type: testharness
|
||||
[createCaption method creates a new caption and inserts it as the first node of the table element]
|
||||
expected: FAIL
|
||||
|
||||
[createCaption method creates new caption if existing caption is not in html namespace]
|
||||
expected: FAIL
|
||||
|
||||
[createCaption will not copy table's prefix]
|
||||
expected: FAIL
|
||||
|
||||
[Assigning a caption to table.caption]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -1,5 +0,0 @@
|
||||
[tHead.html]
|
||||
type: testharness
|
||||
[tHead tests]
|
||||
expected: FAIL
|
||||
|
Loading…
Reference in New Issue
Block a user