OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |