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

Side by Side Diff: Source/core/frame/LocalFrame.cpp

Issue 899163003: Move rendering/RenderObject to layout/LayoutObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/frame/SmartClip.cpp » ('j') | 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 return false; 444 return false;
445 // FIXME: This check is broken in for OOPI. 445 // FIXME: This check is broken in for OOPI.
446 HTMLFrameOwnerElement* owner = doc->ownerElement(); 446 HTMLFrameOwnerElement* owner = doc->ownerElement();
447 if (!owner) 447 if (!owner)
448 return false; 448 return false;
449 return owner->treeScope() == scope; 449 return owner->treeScope() == scope;
450 } 450 }
451 451
452 void LocalFrame::countObjectsNeedingLayout(unsigned& needsLayoutObjects, unsigne d& totalObjects, bool& isPartial) 452 void LocalFrame::countObjectsNeedingLayout(unsigned& needsLayoutObjects, unsigne d& totalObjects, bool& isPartial)
453 { 453 {
454 RenderObject* root = view()->layoutRoot(); 454 LayoutObject* root = view()->layoutRoot();
455 isPartial = true; 455 isPartial = true;
456 if (!root) { 456 if (!root) {
457 isPartial = false; 457 isPartial = false;
458 root = contentRenderer(); 458 root = contentRenderer();
459 } 459 }
460 460
461 needsLayoutObjects = 0; 461 needsLayoutObjects = 0;
462 totalObjects = 0; 462 totalObjects = 0;
463 463
464 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) { 464 for (LayoutObject* o = root; o; o = o->nextInPreOrder(root)) {
465 ++totalObjects; 465 ++totalObjects;
466 if (o->needsLayout()) 466 if (o->needsLayout())
467 ++needsLayoutObjects; 467 ++needsLayoutObjects;
468 } 468 }
469 } 469 }
470 470
471 String LocalFrame::layerTreeAsText(LayerTreeFlags flags) const 471 String LocalFrame::layerTreeAsText(LayerTreeFlags flags) const
472 { 472 {
473 TextStream textStream; 473 TextStream textStream;
474 textStream << localLayerTreeAsText(flags); 474 textStream << localLayerTreeAsText(flags);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 return nullptr; 657 return nullptr;
658 658
659 const ScopedFramePaintingState state(this, &node); 659 const ScopedFramePaintingState state(this, &node);
660 660
661 m_view->updateLayoutAndStyleForPainting(); 661 m_view->updateLayoutAndStyleForPainting();
662 662
663 m_view->setPaintBehavior(state.paintBehavior | PaintBehaviorFlattenCompositi ngLayers); 663 m_view->setPaintBehavior(state.paintBehavior | PaintBehaviorFlattenCompositi ngLayers);
664 664
665 m_view->setNodeToDraw(&node); // Enable special sub-tree drawing mode. 665 m_view->setNodeToDraw(&node); // Enable special sub-tree drawing mode.
666 666
667 // Document::updateLayout may have blown away the original RenderObject. 667 // Document::updateLayout may have blown away the original LayoutObject.
668 RenderObject* renderer = node.renderer(); 668 LayoutObject* renderer = node.renderer();
669 if (!renderer) 669 if (!renderer)
670 return nullptr; 670 return nullptr;
671 671
672 LayoutRect rect; 672 LayoutRect rect;
673 673
674 return paintIntoDragImage(renderer->displayItemClient(), DisplayItem::ClipNo deImage, renderer->shouldRespectImageOrientation(), 674 return paintIntoDragImage(renderer->displayItemClient(), DisplayItem::ClipNo deImage, renderer->shouldRespectImageOrientation(),
675 pixelSnappedIntRect(renderer->paintingRootRect(rect))); 675 pixelSnappedIntRect(renderer->paintingRootRect(rect)));
676 } 676 }
677 677
678 PassOwnPtr<DragImage> LocalFrame::dragImageForSelection() 678 PassOwnPtr<DragImage> LocalFrame::dragImageForSelection()
(...skipping 18 matching lines...) Expand all
697 { 697 {
698 return selection().selectedTextForClipboard(); 698 return selection().selectedTextForClipboard();
699 } 699 }
700 700
701 VisiblePosition LocalFrame::visiblePositionForPoint(const IntPoint& framePoint) 701 VisiblePosition LocalFrame::visiblePositionForPoint(const IntPoint& framePoint)
702 { 702 {
703 HitTestResult result = eventHandler().hitTestResultAtPoint(framePoint); 703 HitTestResult result = eventHandler().hitTestResultAtPoint(framePoint);
704 Node* node = result.innerNonSharedNode(); 704 Node* node = result.innerNonSharedNode();
705 if (!node) 705 if (!node)
706 return VisiblePosition(); 706 return VisiblePosition();
707 RenderObject* renderer = node->renderer(); 707 LayoutObject* renderer = node->renderer();
708 if (!renderer) 708 if (!renderer)
709 return VisiblePosition(); 709 return VisiblePosition();
710 VisiblePosition visiblePos = VisiblePosition(renderer->positionForPoint(resu lt.localPoint())); 710 VisiblePosition visiblePos = VisiblePosition(renderer->positionForPoint(resu lt.localPoint()));
711 if (visiblePos.isNull()) 711 if (visiblePos.isNull())
712 visiblePos = VisiblePosition(firstPositionInOrBeforeNode(node)); 712 visiblePos = VisiblePosition(firstPositionInOrBeforeNode(node));
713 return visiblePos; 713 return visiblePos;
714 } 714 }
715 715
716 Document* LocalFrame::documentAtPoint(const IntPoint& point) 716 Document* LocalFrame::documentAtPoint(const IntPoint& point)
717 { 717 {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 // We detach the FrameView's custom scroll bars as early as 836 // We detach the FrameView's custom scroll bars as early as
837 // possible to prevent m_doc->detach() from messing with the view 837 // possible to prevent m_doc->detach() from messing with the view
838 // such that its scroll bars won't be torn down. 838 // such that its scroll bars won't be torn down.
839 // 839 //
840 // FIXME: We should revisit this. 840 // FIXME: We should revisit this.
841 if (m_view) 841 if (m_view)
842 m_view->prepareForDetach(); 842 m_view->prepareForDetach();
843 } 843 }
844 844
845 } // namespace blink 845 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/frame/SmartClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698