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

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

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLTableRowElement.h ('k') | Source/core/html/HTMLTableSectionElement.h » ('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, 2007, 2010 Apple Inc. All rights reserv ed. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserv ed.
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 19 matching lines...) Expand all
30 #include "core/dom/ExceptionCode.h" 30 #include "core/dom/ExceptionCode.h"
31 #include "core/html/HTMLCollection.h" 31 #include "core/html/HTMLCollection.h"
32 #include "core/html/HTMLTableCellElement.h" 32 #include "core/html/HTMLTableCellElement.h"
33 #include "core/html/HTMLTableElement.h" 33 #include "core/html/HTMLTableElement.h"
34 #include "core/html/HTMLTableSectionElement.h" 34 #include "core/html/HTMLTableSectionElement.h"
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 using namespace HTMLNames; 38 using namespace HTMLNames;
39 39
40 HTMLTableRowElement::HTMLTableRowElement(const QualifiedName& tagName, Document* document) 40 HTMLTableRowElement::HTMLTableRowElement(const QualifiedName& tagName, Document& document)
41 : HTMLTablePartElement(tagName, document) 41 : HTMLTablePartElement(tagName, document)
42 { 42 {
43 ASSERT(hasTagName(trTag)); 43 ASSERT(hasTagName(trTag));
44 ScriptWrappable::init(this); 44 ScriptWrappable::init(this);
45 } 45 }
46 46
47 PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(Document* document) 47 PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(Document& document)
48 { 48 {
49 return adoptRef(new HTMLTableRowElement(trTag, document)); 49 return adoptRef(new HTMLTableRowElement(trTag, document));
50 } 50 }
51 51
52 PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(const QualifiedName& tagName, Document* document) 52 PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(const QualifiedName& tagName, Document& document)
53 { 53 {
54 return adoptRef(new HTMLTableRowElement(tagName, document)); 54 return adoptRef(new HTMLTableRowElement(tagName, document));
55 } 55 }
56 56
57 int HTMLTableRowElement::rowIndex() const 57 int HTMLTableRowElement::rowIndex() const
58 { 58 {
59 ContainerNode* table = parentNode(); 59 ContainerNode* table = parentNode();
60 if (!table) 60 if (!table)
61 return -1; 61 return -1;
62 table = table->parentNode(); 62 table = table->parentNode();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 PassRefPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, ExceptionStat e& es) 121 PassRefPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, ExceptionStat e& es)
122 { 122 {
123 RefPtr<HTMLCollection> children = cells(); 123 RefPtr<HTMLCollection> children = cells();
124 int numCells = children ? children->length() : 0; 124 int numCells = children ? children->length() : 0;
125 if (index < -1 || index > numCells) { 125 if (index < -1 || index > numCells) {
126 es.throwDOMException(IndexSizeError); 126 es.throwDOMException(IndexSizeError);
127 return 0; 127 return 0;
128 } 128 }
129 129
130 RefPtr<HTMLTableCellElement> cell = HTMLTableCellElement::create(tdTag, &doc ument()); 130 RefPtr<HTMLTableCellElement> cell = HTMLTableCellElement::create(tdTag, docu ment());
131 if (index < 0 || index >= numCells) 131 if (index < 0 || index >= numCells)
132 appendChild(cell, es); 132 appendChild(cell, es);
133 else { 133 else {
134 Node* n; 134 Node* n;
135 if (index < 1) 135 if (index < 1)
136 n = firstChild(); 136 n = firstChild();
137 else 137 else
138 n = children->item(index); 138 n = children->item(index);
139 insertBefore(cell, n, es); 139 insertBefore(cell, n, es);
140 } 140 }
(...skipping 18 matching lines...) Expand all
159 { 159 {
160 return ensureCachedHTMLCollection(TRCells); 160 return ensureCachedHTMLCollection(TRCells);
161 } 161 }
162 162
163 void HTMLTableRowElement::setCells(HTMLCollection*, ExceptionState& es) 163 void HTMLTableRowElement::setCells(HTMLCollection*, ExceptionState& es)
164 { 164 {
165 es.throwDOMException(NoModificationAllowedError); 165 es.throwDOMException(NoModificationAllowedError);
166 } 166 }
167 167
168 } 168 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTableRowElement.h ('k') | Source/core/html/HTMLTableSectionElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698