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

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

Issue 24066002: Remove ShouldSetAttached flag to lazyAttach (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use setNeedsStyleRecalc() in HTMLFrameElementBase 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/dom/Node.cpp ('k') | no next file » | 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 return; 156 return;
157 157
158 // DocumentFragments don't kick of any loads. 158 // DocumentFragments don't kick of any loads.
159 if (!document().frame()) 159 if (!document().frame())
160 return; 160 return;
161 161
162 if (!SubframeLoadingDisabler::canLoadFrame(this)) 162 if (!SubframeLoadingDisabler::canLoadFrame(this))
163 return; 163 return;
164 164
165 // JavaScript in src=javascript: and beforeonload can access the renderer 165 // JavaScript in src=javascript: and beforeonload can access the renderer
166 // during attribute parsing *before* the normal parser machinery would 166 // during attribute parsing *before* the call to lazyAttach in ContainerNode ,
167 // attach the element. To support this, we lazyAttach here, but only 167 // so mark ourself as needing a style recalc to ensure the renderer gets cre ated
168 // if we don't already have a renderer (if we're inserted 168 // if needed.
169 // as part of a DocumentFragment, insertedInto from an earlier element 169 // FIXME: Letting script run before calling lazyAttach on all the nodes is p robably bad.
170 // could have forced a style resolve and already attached us).
171 if (!renderer()) 170 if (!renderer())
172 lazyAttach(DoNotSetAttached); 171 setNeedsStyleRecalc();
173 setNameAndOpenURL(); 172 setNameAndOpenURL();
174 } 173 }
175 174
176 void HTMLFrameElementBase::attach(const AttachContext& context) 175 void HTMLFrameElementBase::attach(const AttachContext& context)
177 { 176 {
178 HTMLFrameOwnerElement::attach(context); 177 HTMLFrameOwnerElement::attach(context);
179 178
180 if (RenderPart* part = renderPart()) { 179 if (RenderPart* part = renderPart()) {
181 if (Frame* frame = contentFrame()) 180 if (Frame* frame = contentFrame())
182 part->setWidget(frame->view()); 181 part->setWidget(frame->view());
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 233
235 int HTMLFrameElementBase::height() 234 int HTMLFrameElementBase::height()
236 { 235 {
237 document().updateLayoutIgnorePendingStylesheets(); 236 document().updateLayoutIgnorePendingStylesheets();
238 if (!renderBox()) 237 if (!renderBox())
239 return 0; 238 return 0;
240 return renderBox()->height(); 239 return renderBox()->height();
241 } 240 }
242 241
243 } // namespace WebCore 242 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698