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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |