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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLAnchorElement.cpp ('k') | Source/core/html/HTMLAreaElement.cpp » ('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 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2012 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2012 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 void HTMLAppletElement::updateWidget(PluginCreationOption) 98 void HTMLAppletElement::updateWidget(PluginCreationOption)
99 { 99 {
100 setNeedsWidgetUpdate(false); 100 setNeedsWidgetUpdate(false);
101 // FIXME: This should ASSERT isFinishedParsingChildren() instead. 101 // FIXME: This should ASSERT isFinishedParsingChildren() instead.
102 if (!isFinishedParsingChildren()) 102 if (!isFinishedParsingChildren())
103 return; 103 return;
104 104
105 RenderEmbeddedObject* renderer = renderEmbeddedObject(); 105 RenderEmbeddedObject* renderer = renderEmbeddedObject();
106 106
107 Frame* frame = document()->frame(); 107 Frame* frame = document().frame();
108 ASSERT(frame); 108 ASSERT(frame);
109 109
110 LayoutUnit contentWidth = renderer->style()->width().isFixed() ? LayoutUnit( renderer->style()->width().value()) : 110 LayoutUnit contentWidth = renderer->style()->width().isFixed() ? LayoutUnit( renderer->style()->width().value()) :
111 renderer->width() - renderer->borderAndPaddingWidth(); 111 renderer->width() - renderer->borderAndPaddingWidth();
112 LayoutUnit contentHeight = renderer->style()->height().isFixed() ? LayoutUni t(renderer->style()->height().value()) : 112 LayoutUnit contentHeight = renderer->style()->height().isFixed() ? LayoutUni t(renderer->style()->height().value()) :
113 renderer->height() - renderer->borderAndPaddingHeight(); 113 renderer->height() - renderer->borderAndPaddingHeight();
114 114
115 Vector<String> paramNames; 115 Vector<String> paramNames;
116 Vector<String> paramValues; 116 Vector<String> paramValues;
117 117
118 paramNames.append("code"); 118 paramNames.append("code");
119 paramValues.append(getAttribute(codeAttr).string()); 119 paramValues.append(getAttribute(codeAttr).string());
120 120
121 const AtomicString& codeBase = getAttribute(codebaseAttr); 121 const AtomicString& codeBase = getAttribute(codebaseAttr);
122 if (!codeBase.isNull()) { 122 if (!codeBase.isNull()) {
123 KURL codeBaseURL = document()->completeURL(codeBase); 123 KURL codeBaseURL = document().completeURL(codeBase);
124 if (!document()->securityOrigin()->canDisplay(codeBaseURL)) { 124 if (!document().securityOrigin()->canDisplay(codeBaseURL)) {
125 FrameLoader::reportLocalLoadFailed(frame, codeBaseURL.string()); 125 FrameLoader::reportLocalLoadFailed(frame, codeBaseURL.string());
126 return; 126 return;
127 } 127 }
128 const char javaAppletMimeType[] = "application/x-java-applet"; 128 const char javaAppletMimeType[] = "application/x-java-applet";
129 if (!document()->contentSecurityPolicy()->allowObjectFromSource(codeBase URL) 129 if (!document().contentSecurityPolicy()->allowObjectFromSource(codeBaseU RL)
130 || !document()->contentSecurityPolicy()->allowPluginType(javaAppletM imeType, javaAppletMimeType, codeBaseURL)) 130 || !document().contentSecurityPolicy()->allowPluginType(javaAppletMi meType, javaAppletMimeType, codeBaseURL))
131 return; 131 return;
132 paramNames.append("codeBase"); 132 paramNames.append("codeBase");
133 paramValues.append(codeBase.string()); 133 paramValues.append(codeBase.string());
134 } 134 }
135 135
136 const AtomicString& name = document()->isHTMLDocument() ? getNameAttribute() : getIdAttribute(); 136 const AtomicString& name = document().isHTMLDocument() ? getNameAttribute() : getIdAttribute();
137 if (!name.isNull()) { 137 if (!name.isNull()) {
138 paramNames.append("name"); 138 paramNames.append("name");
139 paramValues.append(name.string()); 139 paramValues.append(name.string());
140 } 140 }
141 141
142 const AtomicString& archive = getAttribute(archiveAttr); 142 const AtomicString& archive = getAttribute(archiveAttr);
143 if (!archive.isNull()) { 143 if (!archive.isNull()) {
144 paramNames.append("archive"); 144 paramNames.append("archive");
145 paramValues.append(archive.string()); 145 paramValues.append(archive.string());
146 } 146 }
147 147
148 paramNames.append("baseURL"); 148 paramNames.append("baseURL");
149 KURL baseURL = document()->baseURL(); 149 KURL baseURL = document().baseURL();
150 paramValues.append(baseURL.string()); 150 paramValues.append(baseURL.string());
151 151
152 const AtomicString& mayScript = getAttribute(mayscriptAttr); 152 const AtomicString& mayScript = getAttribute(mayscriptAttr);
153 if (!mayScript.isNull()) { 153 if (!mayScript.isNull()) {
154 paramNames.append("mayScript"); 154 paramNames.append("mayScript");
155 paramValues.append(mayScript.string()); 155 paramValues.append(mayScript.string());
156 } 156 }
157 157
158 for (Node* child = firstChild(); child; child = child->nextSibling()) { 158 for (Node* child = firstChild(); child; child = child->nextSibling()) {
159 if (!child->hasTagName(paramTag)) 159 if (!child->hasTagName(paramTag))
(...skipping 15 matching lines...) Expand all
175 if (!renderer->showsUnavailablePluginIndicator()) 175 if (!renderer->showsUnavailablePluginIndicator())
176 renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::Plugin Missing); 176 renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::Plugin Missing);
177 return; 177 return;
178 } 178 }
179 frame->loader()->setContainsPlugins(); 179 frame->loader()->setContainsPlugins();
180 renderer->setWidget(widget); 180 renderer->setWidget(widget);
181 } 181 }
182 182
183 bool HTMLAppletElement::canEmbedJava() const 183 bool HTMLAppletElement::canEmbedJava() const
184 { 184 {
185 if (document()->isSandboxed(SandboxPlugins)) 185 if (document().isSandboxed(SandboxPlugins))
186 return false; 186 return false;
187 187
188 Settings* settings = document()->settings(); 188 Settings* settings = document().settings();
189 if (!settings) 189 if (!settings)
190 return false; 190 return false;
191 191
192 if (!settings->isJavaEnabled()) 192 if (!settings->isJavaEnabled())
193 return false; 193 return false;
194 194
195 return true; 195 return true;
196 } 196 }
197 197
198 } 198 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLAnchorElement.cpp ('k') | Source/core/html/HTMLAreaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698