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

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

Issue 977113003: Rename renderer() to layoutObject(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 using namespace HTMLNames; 80 using namespace HTMLNames;
81 81
82 namespace { 82 namespace {
83 83
84 struct ScopedFramePaintingState { 84 struct ScopedFramePaintingState {
85 ScopedFramePaintingState(LocalFrame* frame, Node* node) 85 ScopedFramePaintingState(LocalFrame* frame, Node* node)
86 : frame(frame) 86 : frame(frame)
87 , node(node) 87 , node(node)
88 , paintBehavior(frame->view()->paintBehavior()) 88 , paintBehavior(frame->view()->paintBehavior())
89 { 89 {
90 ASSERT(!node || node->renderer()); 90 ASSERT(!node || node->layoutObject());
91 if (node) 91 if (node)
92 node->renderer()->updateDragState(true); 92 node->layoutObject()->updateDragState(true);
93 } 93 }
94 94
95 ~ScopedFramePaintingState() 95 ~ScopedFramePaintingState()
96 { 96 {
97 if (node && node->renderer()) 97 if (node && node->layoutObject())
98 node->renderer()->updateDragState(false); 98 node->layoutObject()->updateDragState(false);
99 frame->view()->setPaintBehavior(paintBehavior); 99 frame->view()->setPaintBehavior(paintBehavior);
100 frame->view()->setNodeToDraw(0); 100 frame->view()->setNodeToDraw(0);
101 } 101 }
102 102
103 LocalFrame* frame; 103 LocalFrame* frame;
104 Node* node; 104 Node* node;
105 PaintBehavior paintBehavior; 105 PaintBehavior paintBehavior;
106 }; 106 };
107 107
108 inline float parentPageZoomFactor(LocalFrame* frame) 108 inline float parentPageZoomFactor(LocalFrame* frame)
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 632
633 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) 633 if (RuntimeEnabledFeatures::slimmingPaintEnabled())
634 displayItemList->replay(buffer->context()); 634 displayItemList->replay(buffer->context());
635 635
636 RefPtr<Image> image = buffer->copyImage(); 636 RefPtr<Image> image = buffer->copyImage();
637 return DragImage::create(image.get(), shouldRespectImageOrientation, deviceS caleFactor); 637 return DragImage::create(image.get(), shouldRespectImageOrientation, deviceS caleFactor);
638 } 638 }
639 639
640 PassOwnPtr<DragImage> LocalFrame::nodeImage(Node& node) 640 PassOwnPtr<DragImage> LocalFrame::nodeImage(Node& node)
641 { 641 {
642 if (!node.renderer()) 642 if (!node.layoutObject())
643 return nullptr; 643 return nullptr;
644 644
645 const ScopedFramePaintingState state(this, &node); 645 const ScopedFramePaintingState state(this, &node);
646 646
647 m_view->updateLayoutAndStyleForPainting(); 647 m_view->updateLayoutAndStyleForPainting();
648 648
649 m_view->setPaintBehavior(state.paintBehavior | PaintBehaviorFlattenCompositi ngLayers); 649 m_view->setPaintBehavior(state.paintBehavior | PaintBehaviorFlattenCompositi ngLayers);
650 650
651 m_view->setNodeToDraw(&node); // Enable special sub-tree drawing mode. 651 m_view->setNodeToDraw(&node); // Enable special sub-tree drawing mode.
652 652
653 // Document::updateLayout may have blown away the original LayoutObject. 653 // Document::updateLayout may have blown away the original LayoutObject.
654 LayoutObject* renderer = node.renderer(); 654 LayoutObject* renderer = node.layoutObject();
655 if (!renderer) 655 if (!renderer)
656 return nullptr; 656 return nullptr;
657 657
658 IntRect rect; 658 IntRect rect;
659 659
660 return paintIntoDragImage(renderer->displayItemClient(), DisplayItem::ClipNo deImage, renderer->shouldRespectImageOrientation(), 660 return paintIntoDragImage(renderer->displayItemClient(), DisplayItem::ClipNo deImage, renderer->shouldRespectImageOrientation(),
661 renderer->paintingRootRect(rect)); 661 renderer->paintingRootRect(rect));
662 } 662 }
663 663
664 PassOwnPtr<DragImage> LocalFrame::dragImageForSelection() 664 PassOwnPtr<DragImage> LocalFrame::dragImageForSelection()
(...skipping 18 matching lines...) Expand all
683 { 683 {
684 return selection().selectedTextForClipboard(); 684 return selection().selectedTextForClipboard();
685 } 685 }
686 686
687 VisiblePosition LocalFrame::visiblePositionForPoint(const IntPoint& framePoint) 687 VisiblePosition LocalFrame::visiblePositionForPoint(const IntPoint& framePoint)
688 { 688 {
689 HitTestResult result = eventHandler().hitTestResultAtPoint(framePoint); 689 HitTestResult result = eventHandler().hitTestResultAtPoint(framePoint);
690 Node* node = result.innerNonSharedNode(); 690 Node* node = result.innerNonSharedNode();
691 if (!node) 691 if (!node)
692 return VisiblePosition(); 692 return VisiblePosition();
693 LayoutObject* renderer = node->renderer(); 693 LayoutObject* renderer = node->layoutObject();
694 if (!renderer) 694 if (!renderer)
695 return VisiblePosition(); 695 return VisiblePosition();
696 VisiblePosition visiblePos = VisiblePosition(renderer->positionForPoint(resu lt.localPoint())); 696 VisiblePosition visiblePos = VisiblePosition(renderer->positionForPoint(resu lt.localPoint()));
697 if (visiblePos.isNull()) 697 if (visiblePos.isNull())
698 visiblePos = VisiblePosition(firstPositionInOrBeforeNode(node)); 698 visiblePos = VisiblePosition(firstPositionInOrBeforeNode(node));
699 return visiblePos; 699 return visiblePos;
700 } 700 }
701 701
702 Document* LocalFrame::documentAtPoint(const IntPoint& point) 702 Document* LocalFrame::documentAtPoint(const IntPoint& point)
703 { 703 {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 // We detach the FrameView's custom scroll bars as early as 824 // We detach the FrameView's custom scroll bars as early as
825 // possible to prevent m_doc->detach() from messing with the view 825 // possible to prevent m_doc->detach() from messing with the view
826 // such that its scroll bars won't be torn down. 826 // such that its scroll bars won't be torn down.
827 // 827 //
828 // FIXME: We should revisit this. 828 // FIXME: We should revisit this.
829 if (m_view) 829 if (m_view)
830 m_view->prepareForDetach(); 830 m_view->prepareForDetach();
831 } 831 }
832 832
833 } // namespace blink 833 } // 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