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

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

Issue 189573002: Convert HTMLFrameOwnerElement and FocusController to use Frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Missed a null check Created 6 years, 9 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
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/html/HTMLFrameOwnerElement.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) 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // Support for <frame src="javascript:string"> 84 // Support for <frame src="javascript:string">
85 KURL scriptURL; 85 KURL scriptURL;
86 KURL url = document().completeURL(m_URL); 86 KURL url = document().completeURL(m_URL);
87 if (protocolIsJavaScript(m_URL)) { 87 if (protocolIsJavaScript(m_URL)) {
88 scriptURL = url; 88 scriptURL = url;
89 url = blankURL(); 89 url = blankURL();
90 } 90 }
91 91
92 if (!loadOrRedirectSubframe(url, m_frameName, lockBackForwardList)) 92 if (!loadOrRedirectSubframe(url, m_frameName, lockBackForwardList))
93 return; 93 return;
94 if (!contentFrame() || scriptURL.isEmpty()) 94 if (!contentFrame() || scriptURL.isEmpty() || !contentFrame()->isLocalFrame( ))
95 return; 95 return;
96 contentFrame()->script().executeScriptIfJavaScriptURL(scriptURL); 96 toLocalFrame(contentFrame())->script().executeScriptIfJavaScriptURL(scriptUR L);
97 } 97 }
98 98
99 void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, const Atomi cString& value) 99 void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, const Atomi cString& value)
100 { 100 {
101 if (name == srcdocAttr) 101 if (name == srcdocAttr)
102 setLocation("about:srcdoc"); 102 setLocation("about:srcdoc");
103 else if (name == srcAttr && !fastHasAttribute(srcdocAttr)) 103 else if (name == srcAttr && !fastHasAttribute(srcdocAttr))
104 setLocation(stripLeadingAndTrailingHTMLSpaces(value)); 104 setLocation(stripLeadingAndTrailingHTMLSpaces(value));
105 else if (isIdAttributeName(name)) { 105 else if (isIdAttributeName(name)) {
106 // Important to call through to base for the id attribute so the hasID b it gets set. 106 // Important to call through to base for the id attribute so the hasID b it gets set.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 return; 152 return;
153 153
154 setNameAndOpenURL(); 154 setNameAndOpenURL();
155 } 155 }
156 156
157 void HTMLFrameElementBase::attach(const AttachContext& context) 157 void HTMLFrameElementBase::attach(const AttachContext& context)
158 { 158 {
159 HTMLFrameOwnerElement::attach(context); 159 HTMLFrameOwnerElement::attach(context);
160 160
161 if (RenderPart* part = renderPart()) { 161 if (RenderPart* part = renderPart()) {
162 if (LocalFrame* frame = contentFrame()) 162 if (Frame* frame = contentFrame()) {
163 part->setWidget(frame->view()); 163 if (frame->isLocalFrame())
164 part->setWidget(toLocalFrame(frame)->view());
165 }
164 } 166 }
165 } 167 }
166 168
167 KURL HTMLFrameElementBase::location() const 169 KURL HTMLFrameElementBase::location() const
168 { 170 {
169 if (fastHasAttribute(srcdocAttr)) 171 if (fastHasAttribute(srcdocAttr))
170 return KURL(ParsedURLString, "about:srcdoc"); 172 return KURL(ParsedURLString, "about:srcdoc");
171 return document().completeURL(getAttribute(srcAttr)); 173 return document().completeURL(getAttribute(srcAttr));
172 } 174 }
173 175
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/html/HTMLFrameOwnerElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698