Move URL from WebCore to WTF
[WebKit-https.git] / Source / WebKitLegacy / mac / DOM / DOMHTMLTableCellElement.mm
1 /*
2  * Copyright (C) 2004-2016 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #import "DOMHTMLTableCellElementInternal.h"
27
28 #import "DOMNodeInternal.h"
29 #import "ExceptionHandlers.h"
30 #import <WebCore/HTMLNames.h>
31 #import <WebCore/HTMLTableCellElement.h>
32 #import <WebCore/JSExecState.h>
33 #import <WebCore/ThreadCheck.h>
34 #import <WebCore/WebScriptObjectPrivate.h>
35 #import <wtf/GetPtr.h>
36 #import <wtf/URL.h>
37
38 #define IMPL static_cast<WebCore::HTMLTableCellElement*>(reinterpret_cast<WebCore::Node*>(_internal))
39
40 @implementation DOMHTMLTableCellElement
41
42 - (int)cellIndex
43 {
44     WebCore::JSMainThreadNullState state;
45     return IMPL->cellIndex();
46 }
47
48 - (NSString *)align
49 {
50     WebCore::JSMainThreadNullState state;
51     return IMPL->getAttribute(WebCore::HTMLNames::alignAttr);
52 }
53
54 - (void)setAlign:(NSString *)newAlign
55 {
56     WebCore::JSMainThreadNullState state;
57     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::alignAttr, newAlign);
58 }
59
60 - (NSString *)axis
61 {
62     WebCore::JSMainThreadNullState state;
63     return IMPL->getAttribute(WebCore::HTMLNames::axisAttr);
64 }
65
66 - (void)setAxis:(NSString *)newAxis
67 {
68     WebCore::JSMainThreadNullState state;
69     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::axisAttr, newAxis);
70 }
71
72 - (NSString *)bgColor
73 {
74     WebCore::JSMainThreadNullState state;
75     return IMPL->getAttribute(WebCore::HTMLNames::bgcolorAttr);
76 }
77
78 - (void)setBgColor:(NSString *)newBgColor
79 {
80     WebCore::JSMainThreadNullState state;
81     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::bgcolorAttr, newBgColor);
82 }
83
84 - (NSString *)ch
85 {
86     WebCore::JSMainThreadNullState state;
87     return IMPL->getAttribute(WebCore::HTMLNames::charAttr);
88 }
89
90 - (void)setCh:(NSString *)newCh
91 {
92     WebCore::JSMainThreadNullState state;
93     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::charAttr, newCh);
94 }
95
96 - (NSString *)chOff
97 {
98     WebCore::JSMainThreadNullState state;
99     return IMPL->getAttribute(WebCore::HTMLNames::charoffAttr);
100 }
101
102 - (void)setChOff:(NSString *)newChOff
103 {
104     WebCore::JSMainThreadNullState state;
105     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::charoffAttr, newChOff);
106 }
107
108 - (int)colSpan
109 {
110     WebCore::JSMainThreadNullState state;
111     return IMPL->colSpan();
112 }
113
114 - (void)setColSpan:(int)newColSpan
115 {
116     WebCore::JSMainThreadNullState state;
117     IMPL->setColSpan(newColSpan);
118 }
119
120 - (int)rowSpan
121 {
122     WebCore::JSMainThreadNullState state;
123     return IMPL->rowSpanForBindings();
124 }
125
126 - (void)setRowSpan:(int)newRowSpan
127 {
128     WebCore::JSMainThreadNullState state;
129     IMPL->setRowSpanForBindings(newRowSpan);
130 }
131
132 - (NSString *)headers
133 {
134     WebCore::JSMainThreadNullState state;
135     return IMPL->getAttribute(WebCore::HTMLNames::headersAttr);
136 }
137
138 - (void)setHeaders:(NSString *)newHeaders
139 {
140     WebCore::JSMainThreadNullState state;
141     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::headersAttr, newHeaders);
142 }
143
144 - (NSString *)height
145 {
146     WebCore::JSMainThreadNullState state;
147     return IMPL->getAttribute(WebCore::HTMLNames::heightAttr);
148 }
149
150 - (void)setHeight:(NSString *)newHeight
151 {
152     WebCore::JSMainThreadNullState state;
153     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::heightAttr, newHeight);
154 }
155
156 - (BOOL)noWrap
157 {
158     WebCore::JSMainThreadNullState state;
159     return IMPL->hasAttributeWithoutSynchronization(WebCore::HTMLNames::nowrapAttr);
160 }
161
162 - (void)setNoWrap:(BOOL)newNoWrap
163 {
164     WebCore::JSMainThreadNullState state;
165     IMPL->setBooleanAttribute(WebCore::HTMLNames::nowrapAttr, newNoWrap);
166 }
167
168 - (NSString *)vAlign
169 {
170     WebCore::JSMainThreadNullState state;
171     return IMPL->getAttribute(WebCore::HTMLNames::valignAttr);
172 }
173
174 - (void)setVAlign:(NSString *)newVAlign
175 {
176     WebCore::JSMainThreadNullState state;
177     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::valignAttr, newVAlign);
178 }
179
180 - (NSString *)width
181 {
182     WebCore::JSMainThreadNullState state;
183     return IMPL->getAttribute(WebCore::HTMLNames::widthAttr);
184 }
185
186 - (void)setWidth:(NSString *)newWidth
187 {
188     WebCore::JSMainThreadNullState state;
189     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::widthAttr, newWidth);
190 }
191
192 - (NSString *)abbr
193 {
194     WebCore::JSMainThreadNullState state;
195     return IMPL->getAttribute(WebCore::HTMLNames::abbrAttr);
196 }
197
198 - (void)setAbbr:(NSString *)newAbbr
199 {
200     WebCore::JSMainThreadNullState state;
201     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::abbrAttr, newAbbr);
202 }
203
204 - (NSString *)scope
205 {
206     WebCore::JSMainThreadNullState state;
207     return IMPL->scope();
208 }
209
210 - (void)setScope:(NSString *)newScope
211 {
212     WebCore::JSMainThreadNullState state;
213     IMPL->setScope(newScope);
214 }
215
216 @end
217
218 WebCore::HTMLTableCellElement* core(DOMHTMLTableCellElement *wrapper)
219 {
220     return wrapper ? reinterpret_cast<WebCore::HTMLTableCellElement*>(wrapper->_internal) : 0;
221 }
222
223 DOMHTMLTableCellElement *kit(WebCore::HTMLTableCellElement* value)
224 {
225     WebCoreThreadViolationCheckRoundOne();
226     return static_cast<DOMHTMLTableCellElement*>(kit(static_cast<WebCore::Node*>(value)));
227 }