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

Side by Side Diff: Source/core/editing/Caret.cpp

Issue 1198433002: *** NOT FOR LANDING *** mapLocalToContainer and offsetFromContainer cleanup. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: There's also work that LayoutBoxModelObject::offsetFromContainer could do instead of LayoutObject. Created 5 years, 6 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 | « no previous file | Source/core/layout/LayoutBox.h » ('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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 ASSERT(caretLayoutObject->isDescendantOf(caretPainter)); 146 ASSERT(caretLayoutObject->isDescendantOf(caretPainter));
147 147
148 bool unrooted = false; 148 bool unrooted = false;
149 while (caretLayoutObject != caretPainter) { 149 while (caretLayoutObject != caretPainter) {
150 LayoutObject* containerObject = caretLayoutObject->container(); 150 LayoutObject* containerObject = caretLayoutObject->container();
151 if (!containerObject) { 151 if (!containerObject) {
152 unrooted = true; 152 unrooted = true;
153 break; 153 break;
154 } 154 }
155 caretRect.move(caretLayoutObject->offsetFromContainer(containerObject, c aretRect.location())); 155 caretRect.move(caretLayoutObject->offsetFromContainer(containerObject));
156 caretRect.move(caretLayoutObject->columnOffset(caretRect.location())); / / TODO(mstensho): do we need this? And what about the FIXME further above that s uggests that we use mapLocalToContainer() instead?
156 caretLayoutObject = containerObject; 157 caretLayoutObject = containerObject;
157 } 158 }
158 159
159 if (unrooted) 160 if (unrooted)
160 caretRect = LayoutRect(); 161 caretRect = LayoutRect();
161 } 162 }
162 163
163 bool CaretBase::updateCaretRect(Document* document, const PositionWithAffinity& caretPosition) 164 bool CaretBase::updateCaretRect(Document* document, const PositionWithAffinity& caretPosition)
164 { 165 {
165 m_caretLocalRect = LayoutRect(); 166 m_caretLocalRect = LayoutRect();
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 context->fillRect(caret, caretColor); 279 context->fillRect(caret, caretColor);
279 } 280 }
280 281
281 void DragCaretController::paintDragCaret(LocalFrame* frame, GraphicsContext* p, const LayoutPoint& paintOffset, const LayoutRect& clipRect) const 282 void DragCaretController::paintDragCaret(LocalFrame* frame, GraphicsContext* p, const LayoutPoint& paintOffset, const LayoutRect& clipRect) const
282 { 283 {
283 if (m_position.deepEquivalent().deprecatedNode()->document().frame() == fram e) 284 if (m_position.deepEquivalent().deprecatedNode()->document().frame() == fram e)
284 paintCaret(m_position.deepEquivalent().deprecatedNode(), p, paintOffset, clipRect); 285 paintCaret(m_position.deepEquivalent().deprecatedNode(), p, paintOffset, clipRect);
285 } 286 }
286 287
287 } 288 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/layout/LayoutBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698