Move URL from WebCore to WTF
[WebKit-https.git] / Source / WebKitLegacy / mac / DOM / DOMHTMLFrameElement.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 "DOMHTMLFrameElement.h"
27
28 #import "DOMAbstractViewInternal.h"
29 #import "DOMDocumentInternal.h"
30 #import "DOMNodeInternal.h"
31 #import <WebCore/DOMWindow.h>
32 #import <WebCore/Document.h>
33 #import "ExceptionHandlers.h"
34 #import <WebCore/HTMLFrameElement.h>
35 #import <WebCore/HTMLNames.h>
36 #import <WebCore/JSExecState.h>
37 #import <WebCore/ThreadCheck.h>
38 #import <WebCore/WebScriptObjectPrivate.h>
39 #import <wtf/GetPtr.h>
40 #import <wtf/URL.h>
41
42 #define IMPL static_cast<WebCore::HTMLFrameElement*>(reinterpret_cast<WebCore::Node*>(_internal))
43
44 @implementation DOMHTMLFrameElement
45
46 - (NSString *)frameBorder
47 {
48     WebCore::JSMainThreadNullState state;
49     return IMPL->getAttribute(WebCore::HTMLNames::frameborderAttr);
50 }
51
52 - (void)setFrameBorder:(NSString *)newFrameBorder
53 {
54     WebCore::JSMainThreadNullState state;
55     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::frameborderAttr, newFrameBorder);
56 }
57
58 - (NSString *)longDesc
59 {
60     WebCore::JSMainThreadNullState state;
61     return IMPL->getAttribute(WebCore::HTMLNames::longdescAttr);
62 }
63
64 - (void)setLongDesc:(NSString *)newLongDesc
65 {
66     WebCore::JSMainThreadNullState state;
67     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::longdescAttr, newLongDesc);
68 }
69
70 - (NSString *)marginHeight
71 {
72     WebCore::JSMainThreadNullState state;
73     return IMPL->getAttribute(WebCore::HTMLNames::marginheightAttr);
74 }
75
76 - (void)setMarginHeight:(NSString *)newMarginHeight
77 {
78     WebCore::JSMainThreadNullState state;
79     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::marginheightAttr, newMarginHeight);
80 }
81
82 - (NSString *)marginWidth
83 {
84     WebCore::JSMainThreadNullState state;
85     return IMPL->getAttribute(WebCore::HTMLNames::marginwidthAttr);
86 }
87
88 - (void)setMarginWidth:(NSString *)newMarginWidth
89 {
90     WebCore::JSMainThreadNullState state;
91     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::marginwidthAttr, newMarginWidth);
92 }
93
94 - (NSString *)name
95 {
96     WebCore::JSMainThreadNullState state;
97     return IMPL->getNameAttribute();
98 }
99
100 - (void)setName:(NSString *)newName
101 {
102     WebCore::JSMainThreadNullState state;
103     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::nameAttr, newName);
104 }
105
106 - (BOOL)noResize
107 {
108     WebCore::JSMainThreadNullState state;
109     return IMPL->hasAttributeWithoutSynchronization(WebCore::HTMLNames::noresizeAttr);
110 }
111
112 - (void)setNoResize:(BOOL)newNoResize
113 {
114     WebCore::JSMainThreadNullState state;
115     IMPL->setBooleanAttribute(WebCore::HTMLNames::noresizeAttr, newNoResize);
116 }
117
118 - (NSString *)scrolling
119 {
120     WebCore::JSMainThreadNullState state;
121     return IMPL->getAttribute(WebCore::HTMLNames::scrollingAttr);
122 }
123
124 - (void)setScrolling:(NSString *)newScrolling
125 {
126     WebCore::JSMainThreadNullState state;
127     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::scrollingAttr, newScrolling);
128 }
129
130 - (NSString *)src
131 {
132     WebCore::JSMainThreadNullState state;
133     return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr);
134 }
135
136 - (void)setSrc:(NSString *)newSrc
137 {
138     WebCore::JSMainThreadNullState state;
139     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::srcAttr, newSrc);
140 }
141
142 - (DOMDocument *)contentDocument
143 {
144     WebCore::JSMainThreadNullState state;
145     return kit(WTF::getPtr(IMPL->contentDocument()));
146 }
147
148 - (DOMAbstractView *)contentWindow
149 {
150     WebCore::JSMainThreadNullState state;
151     return kit(WTF::getPtr(IMPL->contentWindow()));
152 }
153
154 - (NSString *)location
155 {
156     WebCore::JSMainThreadNullState state;
157     return IMPL->location();
158 }
159
160 - (void)setLocation:(NSString *)newLocation
161 {
162     WebCore::JSMainThreadNullState state;
163     IMPL->setLocation(newLocation);
164 }
165
166 - (int)width
167 {
168     WebCore::JSMainThreadNullState state;
169     return IMPL->width();
170 }
171
172 - (int)height
173 {
174     WebCore::JSMainThreadNullState state;
175     return IMPL->height();
176 }
177
178 @end