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

Side by Side Diff: Source/core/editing/FrameSelection.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/editing/EditorCommand.cpp ('k') | Source/core/editing/HTMLInterchange.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) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 // Treat a collapsed selection like no selection. 1294 // Treat a collapsed selection like no selection.
1295 if (!isRange()) 1295 if (!isRange())
1296 return false; 1296 return false;
1297 if (!document->layoutView()) 1297 if (!document->layoutView())
1298 return false; 1298 return false;
1299 1299
1300 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); 1300 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
1301 HitTestResult result(point); 1301 HitTestResult result(point);
1302 document->layoutView()->hitTest(request, result); 1302 document->layoutView()->hitTest(request, result);
1303 Node* innerNode = result.innerNode(); 1303 Node* innerNode = result.innerNode();
1304 if (!innerNode || !innerNode->renderer()) 1304 if (!innerNode || !innerNode->layoutObject())
1305 return false; 1305 return false;
1306 1306
1307 VisiblePosition visiblePos(innerNode->renderer()->positionForPoint(result.lo calPoint())); 1307 VisiblePosition visiblePos(innerNode->layoutObject()->positionForPoint(resul t.localPoint()));
1308 if (visiblePos.isNull()) 1308 if (visiblePos.isNull())
1309 return false; 1309 return false;
1310 1310
1311 if (m_selection.visibleStart().isNull() || m_selection.visibleEnd().isNull() ) 1311 if (m_selection.visibleStart().isNull() || m_selection.visibleEnd().isNull() )
1312 return false; 1312 return false;
1313 1313
1314 Position start(m_selection.visibleStart().deepEquivalent()); 1314 Position start(m_selection.visibleStart().deepEquivalent());
1315 Position end(m_selection.visibleEnd().deepEquivalent()); 1315 Position end(m_selection.visibleEnd().deepEquivalent());
1316 Position p(visiblePos.deepEquivalent()); 1316 Position p(visiblePos.deepEquivalent());
1317 1317
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1611 if (HTMLTextFormControlElement* textControl = enclosingTextFormControl(start ())) 1611 if (HTMLTextFormControlElement* textControl = enclosingTextFormControl(start ()))
1612 textControl->selectionChanged(userTriggered == UserTriggered); 1612 textControl->selectionChanged(userTriggered == UserTriggered);
1613 } 1613 }
1614 1614
1615 // Helper function that tells whether a particular node is an element that has a n entire 1615 // Helper function that tells whether a particular node is an element that has a n entire
1616 // LocalFrame and FrameView, a <frame>, <iframe>, or <object>. 1616 // LocalFrame and FrameView, a <frame>, <iframe>, or <object>.
1617 static bool isFrameElement(const Node* n) 1617 static bool isFrameElement(const Node* n)
1618 { 1618 {
1619 if (!n) 1619 if (!n)
1620 return false; 1620 return false;
1621 LayoutObject* renderer = n->renderer(); 1621 LayoutObject* renderer = n->layoutObject();
1622 if (!renderer || !renderer->isLayoutPart()) 1622 if (!renderer || !renderer->isLayoutPart())
1623 return false; 1623 return false;
1624 Widget* widget = toLayoutPart(renderer)->widget(); 1624 Widget* widget = toLayoutPart(renderer)->widget();
1625 return widget && widget->isFrameView(); 1625 return widget && widget->isFrameView();
1626 } 1626 }
1627 1627
1628 void FrameSelection::setFocusedNodeIfNeeded() 1628 void FrameSelection::setFocusedNodeIfNeeded()
1629 { 1629 {
1630 if (isNone() || !isFocused()) 1630 if (isNone() || !isFocused())
1631 return; 1631 return;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 case CaretSelection: 1753 case CaretSelection:
1754 rect = LayoutRect(absoluteCaretBounds()); 1754 rect = LayoutRect(absoluteCaretBounds());
1755 break; 1755 break;
1756 case RangeSelection: 1756 case RangeSelection:
1757 rect = LayoutRect(revealExtentOption == RevealExtent ? VisiblePosition(e xtent()).absoluteCaretBounds() : enclosingIntRect(unclippedBounds())); 1757 rect = LayoutRect(revealExtentOption == RevealExtent ? VisiblePosition(e xtent()).absoluteCaretBounds() : enclosingIntRect(unclippedBounds()));
1758 break; 1758 break;
1759 } 1759 }
1760 1760
1761 Position start = this->start(); 1761 Position start = this->start();
1762 ASSERT(start.deprecatedNode()); 1762 ASSERT(start.deprecatedNode());
1763 if (start.deprecatedNode() && start.deprecatedNode()->renderer()) { 1763 if (start.deprecatedNode() && start.deprecatedNode()->layoutObject()) {
1764 // FIXME: This code only handles scrolling the startContainer's layer, b ut 1764 // FIXME: This code only handles scrolling the startContainer's layer, b ut
1765 // the selection rect could intersect more than just that. 1765 // the selection rect could intersect more than just that.
1766 // See <rdar://problem/4799899>. 1766 // See <rdar://problem/4799899>.
1767 if (start.deprecatedNode()->renderer()->scrollRectToVisible(rect, alignm ent, alignment)) 1767 if (start.deprecatedNode()->layoutObject()->scrollRectToVisible(rect, al ignment, alignment))
1768 updateAppearance(); 1768 updateAppearance();
1769 } 1769 }
1770 } 1770 }
1771 1771
1772 void FrameSelection::setSelectionFromNone() 1772 void FrameSelection::setSelectionFromNone()
1773 { 1773 {
1774 // Put a caret inside the body if the entire frame is editable (either the 1774 // Put a caret inside the body if the entire frame is editable (either the
1775 // entire WebView is editable or designMode is on for this document). 1775 // entire WebView is editable or designMode is on for this document).
1776 1776
1777 Document* document = m_frame->document(); 1777 Document* document = m_frame->document();
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1943 sel.showTreeForThis(); 1943 sel.showTreeForThis();
1944 } 1944 }
1945 1945
1946 void showTree(const blink::FrameSelection* sel) 1946 void showTree(const blink::FrameSelection* sel)
1947 { 1947 {
1948 if (sel) 1948 if (sel)
1949 sel->showTreeForThis(); 1949 sel->showTreeForThis();
1950 } 1950 }
1951 1951
1952 #endif 1952 #endif
OLDNEW
« no previous file with comments | « Source/core/editing/EditorCommand.cpp ('k') | Source/core/editing/HTMLInterchange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698