OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 return; | 150 return; |
151 setLocation(url, activeWindow, firstWindow); | 151 setLocation(url, activeWindow, firstWindow); |
152 } | 152 } |
153 | 153 |
154 void Location::setProtocol(DOMWindow* activeWindow, DOMWindow* firstWindow, cons
t String& protocol, ExceptionCode& ec) | 154 void Location::setProtocol(DOMWindow* activeWindow, DOMWindow* firstWindow, cons
t String& protocol, ExceptionCode& ec) |
155 { | 155 { |
156 if (!m_frame) | 156 if (!m_frame) |
157 return; | 157 return; |
158 KURL url = m_frame->document()->url(); | 158 KURL url = m_frame->document()->url(); |
159 if (!url.setProtocol(protocol)) { | 159 if (!url.setProtocol(protocol)) { |
160 ec = SYNTAX_ERR; | 160 ec = SyntaxError; |
161 return; | 161 return; |
162 } | 162 } |
163 setLocation(url.string(), activeWindow, firstWindow); | 163 setLocation(url.string(), activeWindow, firstWindow); |
164 } | 164 } |
165 | 165 |
166 void Location::setHost(DOMWindow* activeWindow, DOMWindow* firstWindow, const St
ring& host) | 166 void Location::setHost(DOMWindow* activeWindow, DOMWindow* firstWindow, const St
ring& host) |
167 { | 167 { |
168 if (!m_frame) | 168 if (!m_frame) |
169 return; | 169 return; |
170 KURL url = m_frame->document()->url(); | 170 KURL url = m_frame->document()->url(); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 { | 266 { |
267 ASSERT(m_frame); | 267 ASSERT(m_frame); |
268 // We call findFrameForNavigation to handle the case of a seamless iframe co
rrectly. | 268 // We call findFrameForNavigation to handle the case of a seamless iframe co
rrectly. |
269 Frame* frame = m_frame->loader()->findFrameForNavigation(String(), activeWin
dow->document()); | 269 Frame* frame = m_frame->loader()->findFrameForNavigation(String(), activeWin
dow->document()); |
270 if (!frame) | 270 if (!frame) |
271 return; | 271 return; |
272 frame->document()->domWindow()->setLocation(url, activeWindow, firstWindow); | 272 frame->document()->domWindow()->setLocation(url, activeWindow, firstWindow); |
273 } | 273 } |
274 | 274 |
275 } // namespace WebCore | 275 } // namespace WebCore |
OLD | NEW |