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

Side by Side Diff: Source/WebCore/rendering/RenderObject.cpp

Issue 10914111: Merge 125737 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 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
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 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 // Not in the middle of layout so have to find the thread the slow way. 579 // Not in the middle of layout so have to find the thread the slow way.
580 RenderObject* curr = const_cast<RenderObject*>(this); 580 RenderObject* curr = const_cast<RenderObject*>(this);
581 while (curr) { 581 while (curr) {
582 if (curr->isRenderFlowThread()) 582 if (curr->isRenderFlowThread())
583 return toRenderFlowThread(curr); 583 return toRenderFlowThread(curr);
584 curr = curr->parent(); 584 curr = curr->parent();
585 } 585 }
586 return 0; 586 return 0;
587 } 587 }
588 588
589 RenderNamedFlowThread* RenderObject::enclosingRenderNamedFlowThread() const
590 {
591 RenderObject* object = const_cast<RenderObject*>(this);
592 while (object && object->isAnonymousBlock() && !object->isRenderNamedFlowThr ead())
593 object = object->parent();
594
595 return object && object->isRenderNamedFlowThread() ? toRenderNamedFlowThread (object) : 0;
596 }
597
589 RenderBlock* RenderObject::firstLineBlock() const 598 RenderBlock* RenderObject::firstLineBlock() const
590 { 599 {
591 return 0; 600 return 0;
592 } 601 }
593 602
594 static inline bool objectIsRelayoutBoundary(const RenderObject* object) 603 static inline bool objectIsRelayoutBoundary(const RenderObject* object)
595 { 604 {
596 // FIXME: In future it may be possible to broaden these conditions in order to improve performance. 605 // FIXME: In future it may be possible to broaden these conditions in order to improve performance.
597 if (object->isTextControl()) 606 if (object->isTextControl())
598 return true; 607 return true;
(...skipping 1751 matching lines...) Expand 10 before | Expand all | Expand 10 after
2350 if (hasLayer()) { 2359 if (hasLayer()) {
2351 setHasLayer(false); 2360 setHasLayer(false);
2352 toRenderBoxModelObject(this)->destroyLayer(); 2361 toRenderBoxModelObject(this)->destroyLayer();
2353 } 2362 }
2354 2363
2355 setAncestorLineBoxDirty(false); 2364 setAncestorLineBoxDirty(false);
2356 2365
2357 clearLayoutRootIfNeeded(); 2366 clearLayoutRootIfNeeded();
2358 } 2367 }
2359 2368
2369 void RenderObject::insertedIntoTree()
2370 {
2371 // FIXME: We should ASSERT(isRooted()) here but generated content makes some out-of-order insertion.
2372
2373 // Keep our layer hierarchy updated. Optimize for the common case where we d on't have any children
2374 // and don't have a layer attached to ourselves.
2375 RenderLayer* layer = 0;
2376 if (firstChild() || hasLayer()) {
2377 layer = parent()->enclosingLayer();
2378 addLayers(layer);
2379 }
2380
2381 // If |this| is visible but this object was not, tell the layer it has some visible content
2382 // that needs to be drawn and layer visibility optimization can't be used
2383 if (parent()->style()->visibility() != VISIBLE && style()->visibility() == V ISIBLE && !hasLayer()) {
2384 if (!layer)
2385 layer = parent()->enclosingLayer();
2386 if (layer)
2387 layer->setHasVisibleContent();
2388 }
2389
2390 if (!isFloating() && parent()->childrenInline())
2391 parent()->dirtyLinesFromChangedChild(this);
2392
2393 if (RenderNamedFlowThread* containerFlowThread = parent()->enclosingRenderNa medFlowThread())
2394 containerFlowThread->addFlowChild(this);
2395 }
2396
2360 void RenderObject::destroyAndCleanupAnonymousWrappers() 2397 void RenderObject::destroyAndCleanupAnonymousWrappers()
2361 { 2398 {
2362 RenderObject* parent = this->parent(); 2399 RenderObject* parent = this->parent();
2363 2400
2364 // If the tree is destroyed or our parent is not anonymous, there is no need for a clean-up phase. 2401 // If the tree is destroyed or our parent is not anonymous, there is no need for a clean-up phase.
2365 if (documentBeingDestroyed() || !parent || !parent->isAnonymous()) { 2402 if (documentBeingDestroyed() || !parent || !parent->isAnonymous()) {
2366 destroy(); 2403 destroy();
2367 return; 2404 return;
2368 } 2405 }
2369 2406
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
2994 { 3031 {
2995 if (object1) { 3032 if (object1) {
2996 const WebCore::RenderObject* root = object1; 3033 const WebCore::RenderObject* root = object1;
2997 while (root->parent()) 3034 while (root->parent())
2998 root = root->parent(); 3035 root = root->parent();
2999 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3036 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3000 } 3037 }
3001 } 3038 }
3002 3039
3003 #endif 3040 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderObject.h ('k') | Source/WebCore/rendering/RenderObjectChildList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698