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

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

Issue 980273005: Clean up HTMLObjectElement/HTMLEmbedElement layoutObjectIsNeeded (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 5 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 | « no previous file | Source/core/html/HTMLObjectElement.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 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2011 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2011 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 return; 147 return;
148 148
149 requestObject(m_url, m_serviceType, paramNames, paramValues); 149 requestObject(m_url, m_serviceType, paramNames, paramValues);
150 } 150 }
151 151
152 bool HTMLEmbedElement::layoutObjectIsNeeded(const LayoutStyle& style) 152 bool HTMLEmbedElement::layoutObjectIsNeeded(const LayoutStyle& style)
153 { 153 {
154 if (isImageType()) 154 if (isImageType())
155 return HTMLPlugInElement::layoutObjectIsNeeded(style); 155 return HTMLPlugInElement::layoutObjectIsNeeded(style);
156 156
157 LocalFrame* frame = document().frame();
158 if (!frame)
159 return false;
160
161 // If my parent is an <object> and is not set to use fallback content, I 157 // If my parent is an <object> and is not set to use fallback content, I
162 // should be ignored and not get a renderer. 158 // should be ignored and not get a renderer.
163 ContainerNode* p = parentNode(); 159 ContainerNode* p = parentNode();
164 if (isHTMLObjectElement(p)) { 160 if (isHTMLObjectElement(p)) {
165 ASSERT(p->renderer()); 161 ASSERT(p->renderer());
166 if (!toHTMLObjectElement(p)->useFallbackContent()) { 162 if (!toHTMLObjectElement(p)->useFallbackContent()) {
167 ASSERT(!p->renderer()->isEmbeddedObject()); 163 ASSERT(!p->renderer()->isEmbeddedObject());
168 return false; 164 return false;
169 } 165 }
170 } 166 }
(...skipping 19 matching lines...) Expand all
190 { 186 {
191 // http://www.whatwg.org/specs/web-apps/current-work/#exposed 187 // http://www.whatwg.org/specs/web-apps/current-work/#exposed
192 for (HTMLObjectElement* object = Traversal<HTMLObjectElement>::firstAncestor (*this); object; object = Traversal<HTMLObjectElement>::firstAncestor(*object)) { 188 for (HTMLObjectElement* object = Traversal<HTMLObjectElement>::firstAncestor (*this); object; object = Traversal<HTMLObjectElement>::firstAncestor(*object)) {
193 if (object->isExposed()) 189 if (object->isExposed())
194 return false; 190 return false;
195 } 191 }
196 return true; 192 return true;
197 } 193 }
198 194
199 } 195 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/HTMLObjectElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698