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 LayoutObject* containerObject = (LayoutObject*)containerItem; | |
mstensho (USE GERRIT)
2016/03/18 20:51:40
Pretty sure I'm violating the API encapsulation li
leviw_travelin_and_unemployed
2016/03/18 22:27:02
Really you should be adding that method to the API
mstensho (USE GERRIT)
2016/03/18 22:45:23
Done.
| |
91 if (containerObject->isLayoutFlowThread()) | |
92 caretRect.move(containerObject->columnOffset(caretRect.location())); | |
93 | |
86 caretLayoutItem = containerItem; | 94 caretLayoutItem = containerItem; |
87 } | 95 } |
88 | 96 |
89 if (unrooted) | 97 if (unrooted) |
90 caretRect = LayoutRect(); | 98 caretRect = LayoutRect(); |
91 } | 99 } |
92 | 100 |
93 bool CaretBase::updateCaretRect(const PositionWithAffinity& caretPosition) | 101 bool CaretBase::updateCaretRect(const PositionWithAffinity& caretPosition) |
94 { | 102 { |
95 m_caretLocalRect = LayoutRect(); | 103 m_caretLocalRect = LayoutRect(); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 else | 202 else |
195 element = node->parentElement(); | 203 element = node->parentElement(); |
196 | 204 |
197 if (element && element->layoutObject()) | 205 if (element && element->layoutObject()) |
198 caretColor = element->layoutObject()->resolveColor(CSSPropertyColor); | 206 caretColor = element->layoutObject()->resolveColor(CSSPropertyColor); |
199 | 207 |
200 context.fillRect(FloatRect(drawingRect), caretColor); | 208 context.fillRect(FloatRect(drawingRect), caretColor); |
201 } | 209 } |
202 | 210 |
203 } // namespace blink | 211 } // namespace blink |
OLD | NEW |