Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Simon Hausmann (hausmann@kde.org) | 4 * (C) 2000 Simon Hausmann (hausmann@kde.org) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 // Support for <frame src="javascript:string"> | 85 // Support for <frame src="javascript:string"> |
| 86 KURL scriptURL; | 86 KURL scriptURL; |
| 87 KURL url = document().completeURL(m_URL); | 87 KURL url = document().completeURL(m_URL); |
| 88 if (protocolIsJavaScript(m_URL)) { | 88 if (protocolIsJavaScript(m_URL)) { |
| 89 scriptURL = url; | 89 scriptURL = url; |
| 90 url = blankURL(); | 90 url = blankURL(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 if (!loadOrRedirectSubframe(url, m_frameName, lockBackForwardList)) | 93 if (!loadOrRedirectSubframe(url, m_frameName, lockBackForwardList)) |
| 94 return; | 94 return; |
| 95 if (!contentFrame() || scriptURL.isEmpty()) | 95 if (!contentFrame() || scriptURL.isEmpty() || !contentFrame()->isLocalFrame( )) |
|
dcheng
2014/03/17 18:17:44
Do we need a FIXME here? Isn't location settable o
kenrb
2014/03/18 20:01:19
This check only prevents JavaScript URLs from runn
| |
| 96 return; | 96 return; |
| 97 contentFrame()->script().executeScriptIfJavaScriptURL(scriptURL); | 97 toLocalFrame(contentFrame())->script().executeScriptIfJavaScriptURL(scriptUR L); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, const Atomi cString& value) | 100 void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, const Atomi cString& value) |
| 101 { | 101 { |
| 102 if (name == srcdocAttr) | 102 if (name == srcdocAttr) |
| 103 setLocation("about:srcdoc"); | 103 setLocation("about:srcdoc"); |
| 104 else if (name == srcAttr && !fastHasAttribute(srcdocAttr)) | 104 else if (name == srcAttr && !fastHasAttribute(srcdocAttr)) |
| 105 setLocation(stripLeadingAndTrailingHTMLSpaces(value)); | 105 setLocation(stripLeadingAndTrailingHTMLSpaces(value)); |
| 106 else if (isIdAttributeName(name)) { | 106 else if (isIdAttributeName(name)) { |
| 107 // Important to call through to base for the id attribute so the hasID b it gets set. | 107 // Important to call through to base for the id attribute so the hasID b it gets set. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 return; | 157 return; |
| 158 | 158 |
| 159 setNameAndOpenURL(); | 159 setNameAndOpenURL(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void HTMLFrameElementBase::attach(const AttachContext& context) | 162 void HTMLFrameElementBase::attach(const AttachContext& context) |
| 163 { | 163 { |
| 164 HTMLFrameOwnerElement::attach(context); | 164 HTMLFrameOwnerElement::attach(context); |
| 165 | 165 |
| 166 if (RenderPart* part = renderPart()) { | 166 if (RenderPart* part = renderPart()) { |
| 167 if (LocalFrame* frame = contentFrame()) | 167 if (Frame* frame = contentFrame()) { |
| 168 part->setWidget(frame->view()); | 168 if (frame->isLocalFrame()) |
| 169 part->setWidget(toLocalFrame(frame)->view()); | |
| 170 } | |
| 169 } | 171 } |
| 170 } | 172 } |
| 171 | 173 |
| 172 KURL HTMLFrameElementBase::location() const | 174 KURL HTMLFrameElementBase::location() const |
| 173 { | 175 { |
| 174 if (fastHasAttribute(srcdocAttr)) | 176 if (fastHasAttribute(srcdocAttr)) |
| 175 return KURL(ParsedURLString, "about:srcdoc"); | 177 return KURL(ParsedURLString, "about:srcdoc"); |
| 176 return document().completeURL(getAttribute(srcAttr)); | 178 return document().completeURL(getAttribute(srcAttr)); |
| 177 } | 179 } |
| 178 | 180 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 | 223 |
| 222 int HTMLFrameElementBase::height() | 224 int HTMLFrameElementBase::height() |
| 223 { | 225 { |
| 224 document().updateLayoutIgnorePendingStylesheets(); | 226 document().updateLayoutIgnorePendingStylesheets(); |
| 225 if (!renderBox()) | 227 if (!renderBox()) |
| 226 return 0; | 228 return 0; |
| 227 return renderBox()->height(); | 229 return renderBox()->height(); |
| 228 } | 230 } |
| 229 | 231 |
| 230 } // namespace WebCore | 232 } // namespace WebCore |
| OLD | NEW |