Index: third_party/WebKit/Source/core/html/HTMLTableElement.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLTableElement.cpp b/third_party/WebKit/Source/core/html/HTMLTableElement.cpp |
index adf27d2dc03c471bac97c74918be42694919ff18..481cb8c5939787ec52e462469940a9361da19555 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLTableElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLTableElement.cpp |
@@ -108,15 +108,15 @@ HTMLTableSectionElement* HTMLTableElement::tFoot() const |
void HTMLTableElement::setTFoot(HTMLTableSectionElement* newFoot, ExceptionState& exceptionState) |
{ |
- deleteTFoot(); |
- |
- HTMLElement* child; |
- for (child = Traversal<HTMLElement>::firstChild(*this); child; child = Traversal<HTMLElement>::nextSibling(*child)) { |
- if (!child->hasTagName(captionTag) && !child->hasTagName(colgroupTag) && !child->hasTagName(theadTag)) |
- break; |
+ if (newFoot && !newFoot->hasTagName(tfootTag)) { |
+ exceptionState.throwDOMException(HierarchyRequestError, "Not a tfoot element."); |
+ return; |
} |
- insertBefore(newFoot, child, exceptionState); |
+ deleteTFoot(); |
+ |
+ if (newFoot) |
+ appendChild(newFoot, exceptionState); |
} |
HTMLTableSectionElement* HTMLTableElement::createTHead() |