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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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)); | 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 | |
92 caretLayoutItem = containerItem; | 86 caretLayoutItem = containerItem; |
93 } | 87 } |
94 | 88 |
95 if (unrooted) | 89 if (unrooted) |
96 caretRect = LayoutRect(); | 90 caretRect = LayoutRect(); |
97 } | 91 } |
98 | 92 |
99 bool CaretBase::updateCaretRect(const PositionWithAffinity& caretPosition) | 93 bool CaretBase::updateCaretRect(const PositionWithAffinity& caretPosition) |
100 { | 94 { |
101 m_caretLocalRect = LayoutRect(); | 95 m_caretLocalRect = LayoutRect(); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 else | 194 else |
201 element = node->parentElement(); | 195 element = node->parentElement(); |
202 | 196 |
203 if (element && element->layoutObject()) | 197 if (element && element->layoutObject()) |
204 caretColor = element->layoutObject()->resolveColor(CSSPropertyColor); | 198 caretColor = element->layoutObject()->resolveColor(CSSPropertyColor); |
205 | 199 |
206 context.fillRect(FloatRect(drawingRect), caretColor); | 200 context.fillRect(FloatRect(drawingRect), caretColor); |
207 } | 201 } |
208 | 202 |
209 } // namespace blink | 203 } // namespace blink |
OLD | NEW |