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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 ASSERT(caretLayoutItem.isDescendantOf(caretPainterItem)); | 76 ASSERT(caretLayoutItem.isDescendantOf(caretPainterItem)); |
77 | 77 |
78 bool unrooted = false; | 78 bool unrooted = false; |
79 while (caretLayoutItem != caretPainterItem) { | 79 while (caretLayoutItem != caretPainterItem) { |
80 LayoutItem containerItem = caretLayoutItem.container(); | 80 LayoutItem containerItem = caretLayoutItem.container(); |
81 if (containerItem.isNull()) { | 81 if (containerItem.isNull()) { |
82 unrooted = true; | 82 unrooted = true; |
83 break; | 83 break; |
84 } | 84 } |
85 caretRect.move(caretLayoutItem.offsetFromContainer(containerItem, caretR
ect.location())); | 85 caretRect.move(caretLayoutItem.offsetFromContainer(containerItem)); |
| 86 |
| 87 // TODO(mstensho): Fix crbug.com/596070 and get rid of this flowthread/m
ulticol thing |
| 88 // here. It was added to keep the same behavior as before flowthread-to-
visual coordinate |
| 89 // space conversion was moved out from offsetFromContainer() to mapLocal
ToAncestor(). |
| 90 caretRect.move(containerItem.columnOffset(caretRect.location())); |
| 91 |
86 caretLayoutItem = containerItem; | 92 caretLayoutItem = containerItem; |
87 } | 93 } |
88 | 94 |
89 if (unrooted) | 95 if (unrooted) |
90 caretRect = LayoutRect(); | 96 caretRect = LayoutRect(); |
91 } | 97 } |
92 | 98 |
93 bool CaretBase::updateCaretRect(const PositionWithAffinity& caretPosition) | 99 bool CaretBase::updateCaretRect(const PositionWithAffinity& caretPosition) |
94 { | 100 { |
95 m_caretLocalRect = LayoutRect(); | 101 m_caretLocalRect = LayoutRect(); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 else | 200 else |
195 element = node->parentElement(); | 201 element = node->parentElement(); |
196 | 202 |
197 if (element && element->layoutObject()) | 203 if (element && element->layoutObject()) |
198 caretColor = element->layoutObject()->resolveColor(CSSPropertyColor); | 204 caretColor = element->layoutObject()->resolveColor(CSSPropertyColor); |
199 | 205 |
200 context.fillRect(FloatRect(drawingRect), caretColor); | 206 context.fillRect(FloatRect(drawingRect), caretColor); |
201 } | 207 } |
202 | 208 |
203 } // namespace blink | 209 } // namespace blink |
OLD | NEW |