Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLTableElement.cpp

Issue 2338013007: Adapt to changes in html5 spec related to tfoot (Closed)
Patch Set: Patch for landing Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug30418-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010, 2011 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010, 2011 Apple Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 insertBefore(newHead, child, exceptionState); 101 insertBefore(newHead, child, exceptionState);
102 } 102 }
103 103
104 HTMLTableSectionElement* HTMLTableElement::tFoot() const 104 HTMLTableSectionElement* HTMLTableElement::tFoot() const
105 { 105 {
106 return toHTMLTableSectionElement(Traversal<HTMLElement>::firstChild(*this, H asHTMLTagName(tfootTag))); 106 return toHTMLTableSectionElement(Traversal<HTMLElement>::firstChild(*this, H asHTMLTagName(tfootTag)));
107 } 107 }
108 108
109 void HTMLTableElement::setTFoot(HTMLTableSectionElement* newFoot, ExceptionState & exceptionState) 109 void HTMLTableElement::setTFoot(HTMLTableSectionElement* newFoot, ExceptionState & exceptionState)
110 { 110 {
111 if (newFoot && !newFoot->hasTagName(tfootTag)) {
112 exceptionState.throwDOMException(HierarchyRequestError, "Not a tfoot ele ment.");
113 return;
114 }
115
111 deleteTFoot(); 116 deleteTFoot();
112 117
113 HTMLElement* child; 118 if (newFoot)
114 for (child = Traversal<HTMLElement>::firstChild(*this); child; child = Trave rsal<HTMLElement>::nextSibling(*child)) { 119 appendChild(newFoot, exceptionState);
115 if (!child->hasTagName(captionTag) && !child->hasTagName(colgroupTag) && !child->hasTagName(theadTag))
116 break;
117 }
118
119 insertBefore(newFoot, child, exceptionState);
120 } 120 }
121 121
122 HTMLTableSectionElement* HTMLTableElement::createTHead() 122 HTMLTableSectionElement* HTMLTableElement::createTHead()
123 { 123 {
124 if (HTMLTableSectionElement* existingHead = tHead()) 124 if (HTMLTableSectionElement* existingHead = tHead())
125 return existingHead; 125 return existingHead;
126 HTMLTableSectionElement* head = HTMLTableSectionElement::create(theadTag, do cument()); 126 HTMLTableSectionElement* head = HTMLTableSectionElement::create(theadTag, do cument());
127 setTHead(head, IGNORE_EXCEPTION); 127 setTHead(head, IGNORE_EXCEPTION);
128 return head; 128 return head;
129 } 129 }
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 return getAttribute(summaryAttr); 559 return getAttribute(summaryAttr);
560 } 560 }
561 561
562 DEFINE_TRACE(HTMLTableElement) 562 DEFINE_TRACE(HTMLTableElement)
563 { 563 {
564 visitor->trace(m_sharedCellStyle); 564 visitor->trace(m_sharedCellStyle);
565 HTMLElement::trace(visitor); 565 HTMLElement::trace(visitor);
566 } 566 }
567 567
568 } // namespace blink 568 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug30418-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698