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

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

Issue 2190523002: Assert that we never insert an frame element that already has a frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years 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 | 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 return InsertionShouldCallDidNotifySubtreeInsertions; 173 return InsertionShouldCallDidNotifySubtreeInsertions;
174 } 174 }
175 175
176 void HTMLFrameElementBase::didNotifySubtreeInsertionsToDocument() { 176 void HTMLFrameElementBase::didNotifySubtreeInsertionsToDocument() {
177 if (!document().frame()) 177 if (!document().frame())
178 return; 178 return;
179 179
180 if (!SubframeLoadingDisabler::canLoadFrame(*this)) 180 if (!SubframeLoadingDisabler::canLoadFrame(*this))
181 return; 181 return;
182 182
183 // We should never have a content frame at the point where we got inserted
184 // into a tree.
185 SECURITY_CHECK(!contentFrame());
186
183 setNameAndOpenURL(); 187 setNameAndOpenURL();
184 } 188 }
185 189
186 void HTMLFrameElementBase::attachLayoutTree(const AttachContext& context) { 190 void HTMLFrameElementBase::attachLayoutTree(const AttachContext& context) {
187 HTMLFrameOwnerElement::attachLayoutTree(context); 191 HTMLFrameOwnerElement::attachLayoutTree(context);
188 192
189 if (layoutPart()) { 193 if (layoutPart()) {
190 if (Frame* frame = contentFrame()) { 194 if (Frame* frame = contentFrame()) {
191 if (frame->isLocalFrame()) 195 if (frame->isLocalFrame())
192 setWidget(toLocalFrame(frame)->view()); 196 setWidget(toLocalFrame(frame)->view());
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 279
276 if (contentDocument()) { 280 if (contentDocument()) {
277 contentDocument()->willChangeFrameOwnerProperties( 281 contentDocument()->willChangeFrameOwnerProperties(
278 m_marginWidth, marginHeight, m_scrollingMode); 282 m_marginWidth, marginHeight, m_scrollingMode);
279 } 283 }
280 m_marginHeight = marginHeight; 284 m_marginHeight = marginHeight;
281 frameOwnerPropertiesChanged(); 285 frameOwnerPropertiesChanged();
282 } 286 }
283 287
284 } // namespace blink 288 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698