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

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

Issue 22880029: Make AttachBehavior a required argument. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLProgressElement.cpp ('k') | Source/core/html/HTMLTextAreaElement.cpp » ('j') | 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 for (Node* child = firstChild(); child; child = child->nextSibling()) { 73 for (Node* child = firstChild(); child; child = child->nextSibling()) {
74 if (child->hasTagName(captionTag)) 74 if (child->hasTagName(captionTag))
75 return static_cast<HTMLTableCaptionElement*>(child); 75 return static_cast<HTMLTableCaptionElement*>(child);
76 } 76 }
77 return 0; 77 return 0;
78 } 78 }
79 79
80 void HTMLTableElement::setCaption(PassRefPtr<HTMLTableCaptionElement> newCaption , ExceptionState& es) 80 void HTMLTableElement::setCaption(PassRefPtr<HTMLTableCaptionElement> newCaption , ExceptionState& es)
81 { 81 {
82 deleteCaption(); 82 deleteCaption();
83 insertBefore(newCaption, firstChild(), es); 83 insertBefore(newCaption, firstChild(), es, DeprecatedAttachNow);
84 } 84 }
85 85
86 HTMLTableSectionElement* HTMLTableElement::tHead() const 86 HTMLTableSectionElement* HTMLTableElement::tHead() const
87 { 87 {
88 for (Node* child = firstChild(); child; child = child->nextSibling()) { 88 for (Node* child = firstChild(); child; child = child->nextSibling()) {
89 if (child->hasTagName(theadTag)) 89 if (child->hasTagName(theadTag))
90 return static_cast<HTMLTableSectionElement*>(child); 90 return static_cast<HTMLTableSectionElement*>(child);
91 } 91 }
92 return 0; 92 return 0;
93 } 93 }
94 94
95 void HTMLTableElement::setTHead(PassRefPtr<HTMLTableSectionElement> newHead, Exc eptionState& es) 95 void HTMLTableElement::setTHead(PassRefPtr<HTMLTableSectionElement> newHead, Exc eptionState& es)
96 { 96 {
97 deleteTHead(); 97 deleteTHead();
98 98
99 Node* child; 99 Node* child;
100 for (child = firstChild(); child; child = child->nextSibling()) 100 for (child = firstChild(); child; child = child->nextSibling())
101 if (child->isElementNode() && !child->hasTagName(captionTag) && !child-> hasTagName(colgroupTag)) 101 if (child->isElementNode() && !child->hasTagName(captionTag) && !child-> hasTagName(colgroupTag))
102 break; 102 break;
103 103
104 insertBefore(newHead, child, es); 104 insertBefore(newHead, child, es, DeprecatedAttachNow);
105 } 105 }
106 106
107 HTMLTableSectionElement* HTMLTableElement::tFoot() const 107 HTMLTableSectionElement* HTMLTableElement::tFoot() const
108 { 108 {
109 for (Node* child = firstChild(); child; child = child->nextSibling()) { 109 for (Node* child = firstChild(); child; child = child->nextSibling()) {
110 if (child->hasTagName(tfootTag)) 110 if (child->hasTagName(tfootTag))
111 return static_cast<HTMLTableSectionElement*>(child); 111 return static_cast<HTMLTableSectionElement*>(child);
112 } 112 }
113 return 0; 113 return 0;
114 } 114 }
115 115
116 void HTMLTableElement::setTFoot(PassRefPtr<HTMLTableSectionElement> newFoot, Exc eptionState& es) 116 void HTMLTableElement::setTFoot(PassRefPtr<HTMLTableSectionElement> newFoot, Exc eptionState& es)
117 { 117 {
118 deleteTFoot(); 118 deleteTFoot();
119 119
120 Node* child; 120 Node* child;
121 for (child = firstChild(); child; child = child->nextSibling()) 121 for (child = firstChild(); child; child = child->nextSibling())
122 if (child->isElementNode() && !child->hasTagName(captionTag) && !child-> hasTagName(colgroupTag) && !child->hasTagName(theadTag)) 122 if (child->isElementNode() && !child->hasTagName(captionTag) && !child-> hasTagName(colgroupTag) && !child->hasTagName(theadTag))
123 break; 123 break;
124 124
125 insertBefore(newFoot, child, es); 125 insertBefore(newFoot, child, es, DeprecatedAttachNow);
126 } 126 }
127 127
128 PassRefPtr<HTMLElement> HTMLTableElement::createTHead() 128 PassRefPtr<HTMLElement> HTMLTableElement::createTHead()
129 { 129 {
130 if (HTMLTableSectionElement* existingHead = tHead()) 130 if (HTMLTableSectionElement* existingHead = tHead())
131 return existingHead; 131 return existingHead;
132 RefPtr<HTMLTableSectionElement> head = HTMLTableSectionElement::create(thead Tag, document()); 132 RefPtr<HTMLTableSectionElement> head = HTMLTableSectionElement::create(thead Tag, document());
133 setTHead(head, IGNORE_EXCEPTION); 133 setTHead(head, IGNORE_EXCEPTION);
134 return head.release(); 134 return head.release();
135 } 135 }
(...skipping 15 matching lines...) Expand all
151 void HTMLTableElement::deleteTFoot() 151 void HTMLTableElement::deleteTFoot()
152 { 152 {
153 removeChild(tFoot(), IGNORE_EXCEPTION); 153 removeChild(tFoot(), IGNORE_EXCEPTION);
154 } 154 }
155 155
156 PassRefPtr<HTMLElement> HTMLTableElement::createTBody() 156 PassRefPtr<HTMLElement> HTMLTableElement::createTBody()
157 { 157 {
158 RefPtr<HTMLTableSectionElement> body = HTMLTableSectionElement::create(tbody Tag, document()); 158 RefPtr<HTMLTableSectionElement> body = HTMLTableSectionElement::create(tbody Tag, document());
159 Node* referenceElement = lastBody() ? lastBody()->nextSibling() : 0; 159 Node* referenceElement = lastBody() ? lastBody()->nextSibling() : 0;
160 160
161 insertBefore(body, referenceElement, ASSERT_NO_EXCEPTION); 161 insertBefore(body, referenceElement, ASSERT_NO_EXCEPTION, DeprecatedAttachNo w);
162 return body.release(); 162 return body.release();
163 } 163 }
164 164
165 PassRefPtr<HTMLElement> HTMLTableElement::createCaption() 165 PassRefPtr<HTMLElement> HTMLTableElement::createCaption()
166 { 166 {
167 if (HTMLTableCaptionElement* existingCaption = caption()) 167 if (HTMLTableCaptionElement* existingCaption = caption())
168 return existingCaption; 168 return existingCaption;
169 RefPtr<HTMLTableCaptionElement> caption = HTMLTableCaptionElement::create(ca ptionTag, document()); 169 RefPtr<HTMLTableCaptionElement> caption = HTMLTableCaptionElement::create(ca ptionTag, document());
170 setCaption(caption, IGNORE_EXCEPTION); 170 setCaption(caption, IGNORE_EXCEPTION);
171 return caption.release(); 171 return caption.release();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 213 }
214 214
215 RefPtr<ContainerNode> parent; 215 RefPtr<ContainerNode> parent;
216 if (lastRow) 216 if (lastRow)
217 parent = row ? row->parentNode() : lastRow->parentNode(); 217 parent = row ? row->parentNode() : lastRow->parentNode();
218 else { 218 else {
219 parent = lastBody(); 219 parent = lastBody();
220 if (!parent) { 220 if (!parent) {
221 RefPtr<HTMLTableSectionElement> newBody = HTMLTableSectionElement::c reate(tbodyTag, document()); 221 RefPtr<HTMLTableSectionElement> newBody = HTMLTableSectionElement::c reate(tbodyTag, document());
222 RefPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(doc ument()); 222 RefPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(doc ument());
223 newBody->appendChild(newRow, es); 223 newBody->appendChild(newRow, es, DeprecatedAttachNow);
224 appendChild(newBody.release(), es, AttachLazily); 224 appendChild(newBody.release(), es, AttachLazily);
225 return newRow.release(); 225 return newRow.release();
226 } 226 }
227 } 227 }
228 228
229 RefPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(document()) ; 229 RefPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(document()) ;
230 parent->insertBefore(newRow, row.get(), es, AttachLazily); 230 parent->insertBefore(newRow, row.get(), es, AttachLazily);
231 return newRow.release(); 231 return newRow.release();
232 } 232 }
233 233
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 } 573 }
574 574
575 void HTMLTableElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons t 575 void HTMLTableElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons t
576 { 576 {
577 HTMLElement::addSubresourceAttributeURLs(urls); 577 HTMLElement::addSubresourceAttributeURLs(urls);
578 578
579 addSubresourceURL(urls, document()->completeURL(getAttribute(backgroundAttr) )); 579 addSubresourceURL(urls, document()->completeURL(getAttribute(backgroundAttr) ));
580 } 580 }
581 581
582 } 582 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLProgressElement.cpp ('k') | Source/core/html/HTMLTextAreaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698