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

Side by Side Diff: Source/core/layout/LayoutObject.cpp

Issue 927773002: Keep track of multiple layout roots (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address concerns. Created 5 years, 10 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
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 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2256 matching lines...) Expand 10 before | Expand all | Expand 10 after
2267 } 2267 }
2268 2268
2269 bool LayoutObject::isSelectionBorder() const 2269 bool LayoutObject::isSelectionBorder() const
2270 { 2270 {
2271 SelectionState st = selectionState(); 2271 SelectionState st = selectionState();
2272 return st == SelectionStart || st == SelectionEnd || st == SelectionBoth; 2272 return st == SelectionStart || st == SelectionEnd || st == SelectionBoth;
2273 } 2273 }
2274 2274
2275 inline void LayoutObject::clearLayoutRootIfNeeded() const 2275 inline void LayoutObject::clearLayoutRootIfNeeded() const
2276 { 2276 {
2277 if (frame()) { 2277 if (FrameView* view = frameView()) {
2278 if (FrameView* view = frame()->view()) { 2278 if (!documentBeingDestroyed())
2279 if (view->layoutRoot() == this) { 2279 view->clearLayoutSubtreeRoot(this);
2280 if (!documentBeingDestroyed())
2281 ASSERT_NOT_REACHED();
2282 // This indicates a failure to layout the child, which is why
2283 // the layout root is still set to |this|. Make sure to clear it
2284 // since we are getting destroyed.
2285 view->clearLayoutSubtreeRoot();
2286 }
2287 }
2288 } 2280 }
2289 } 2281 }
2290 2282
2291 void LayoutObject::willBeDestroyed() 2283 void LayoutObject::willBeDestroyed()
2292 { 2284 {
2293 // Destroy any leftover anonymous children. 2285 // Destroy any leftover anonymous children.
2294 LayoutObjectChildList* children = virtualChildren(); 2286 LayoutObjectChildList* children = virtualChildren();
2295 if (children) 2287 if (children)
2296 children->destroyLeftoverChildren(); 2288 children->destroyLeftoverChildren();
2297 2289
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
3184 { 3176 {
3185 if (object1) { 3177 if (object1) {
3186 const blink::LayoutObject* root = object1; 3178 const blink::LayoutObject* root = object1;
3187 while (root->parent()) 3179 while (root->parent())
3188 root = root->parent(); 3180 root = root->parent();
3189 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3181 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3190 } 3182 }
3191 } 3183 }
3192 3184
3193 #endif 3185 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698