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

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

Issue 66643004: Remove QualifiedName argument from most HTMLElement::create functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Hack for XML prefix Created 7 years, 1 month 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
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 28 matching lines...) Expand all
39 #include "core/html/HTMLTableRowElement.h" 39 #include "core/html/HTMLTableRowElement.h"
40 #include "core/html/HTMLTableRowsCollection.h" 40 #include "core/html/HTMLTableRowsCollection.h"
41 #include "core/html/HTMLTableSectionElement.h" 41 #include "core/html/HTMLTableSectionElement.h"
42 #include "core/html/parser/HTMLParserIdioms.h" 42 #include "core/html/parser/HTMLParserIdioms.h"
43 #include "core/rendering/RenderTable.h" 43 #include "core/rendering/RenderTable.h"
44 44
45 namespace WebCore { 45 namespace WebCore {
46 46
47 using namespace HTMLNames; 47 using namespace HTMLNames;
48 48
49 HTMLTableElement::HTMLTableElement(const QualifiedName& tagName, Document& docum ent) 49 HTMLTableElement::HTMLTableElement(Document& document)
50 : HTMLElement(tagName, document) 50 : HTMLElement(tableTag, document)
51 , m_borderAttr(false) 51 , m_borderAttr(false)
52 , m_borderColorAttr(false) 52 , m_borderColorAttr(false)
53 , m_frameAttr(false) 53 , m_frameAttr(false)
54 , m_rulesAttr(UnsetRules) 54 , m_rulesAttr(UnsetRules)
55 , m_padding(1) 55 , m_padding(1)
56 { 56 {
57 ASSERT(hasTagName(tableTag));
58 ScriptWrappable::init(this); 57 ScriptWrappable::init(this);
59 } 58 }
60 59
61 PassRefPtr<HTMLTableElement> HTMLTableElement::create(Document& document) 60 PassRefPtr<HTMLTableElement> HTMLTableElement::create(Document& document)
62 { 61 {
63 return adoptRef(new HTMLTableElement(tableTag, document)); 62 return adoptRef(new HTMLTableElement(document));
64 }
65
66 PassRefPtr<HTMLTableElement> HTMLTableElement::create(const QualifiedName& tagNa me, Document& document)
67 {
68 return adoptRef(new HTMLTableElement(tagName, document));
69 } 63 }
70 64
71 HTMLTableCaptionElement* HTMLTableElement::caption() const 65 HTMLTableCaptionElement* HTMLTableElement::caption() const
72 { 66 {
73 for (Node* child = firstChild(); child; child = child->nextSibling()) { 67 for (Node* child = firstChild(); child; child = child->nextSibling()) {
74 if (child->hasTagName(captionTag)) 68 if (child->hasTagName(captionTag))
75 return toHTMLTableCaptionElement(child); 69 return toHTMLTableCaptionElement(child);
76 } 70 }
77 return 0; 71 return 0;
78 } 72 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 Node* referenceElement = lastBody() ? lastBody()->nextSibling() : 0; 153 Node* referenceElement = lastBody() ? lastBody()->nextSibling() : 0;
160 154
161 insertBefore(body, referenceElement); 155 insertBefore(body, referenceElement);
162 return body.release(); 156 return body.release();
163 } 157 }
164 158
165 PassRefPtr<HTMLElement> HTMLTableElement::createCaption() 159 PassRefPtr<HTMLElement> HTMLTableElement::createCaption()
166 { 160 {
167 if (HTMLTableCaptionElement* existingCaption = caption()) 161 if (HTMLTableCaptionElement* existingCaption = caption())
168 return existingCaption; 162 return existingCaption;
169 RefPtr<HTMLTableCaptionElement> caption = HTMLTableCaptionElement::create(ca ptionTag, document()); 163 RefPtr<HTMLTableCaptionElement> caption = HTMLTableCaptionElement::create(do cument());
170 setCaption(caption, IGNORE_EXCEPTION); 164 setCaption(caption, IGNORE_EXCEPTION);
171 return caption.release(); 165 return caption.release();
172 } 166 }
173 167
174 void HTMLTableElement::deleteCaption() 168 void HTMLTableElement::deleteCaption()
175 { 169 {
176 removeChild(caption(), IGNORE_EXCEPTION); 170 removeChild(caption(), IGNORE_EXCEPTION);
177 } 171 }
178 172
179 HTMLTableSectionElement* HTMLTableElement::lastBody() const 173 HTMLTableSectionElement* HTMLTableElement::lastBody() const
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 } 567 }
574 568
575 void HTMLTableElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons t 569 void HTMLTableElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons t
576 { 570 {
577 HTMLElement::addSubresourceAttributeURLs(urls); 571 HTMLElement::addSubresourceAttributeURLs(urls);
578 572
579 addSubresourceURL(urls, document().completeURL(getAttribute(backgroundAttr)) ); 573 addSubresourceURL(urls, document().completeURL(getAttribute(backgroundAttr)) );
580 } 574 }
581 575
582 } 576 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698