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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 bool CaretBase::shouldRepaintCaret(const LayoutViewItem view) const | 174 bool CaretBase::shouldRepaintCaret(const LayoutViewItem view) const |
175 { | 175 { |
176 DCHECK(view); | 176 DCHECK(view); |
177 if (FrameView* frameView = view.frameView()) { | 177 if (FrameView* frameView = view.frameView()) { |
178 LocalFrame& frame = frameView->frame(); // The frame where the selection
started | 178 LocalFrame& frame = frameView->frame(); // The frame where the selection
started |
179 return frame.settings() && frame.settings()->caretBrowsingEnabled(); | 179 return frame.settings() && frame.settings()->caretBrowsingEnabled(); |
180 } | 180 } |
181 return false; | 181 return false; |
182 } | 182 } |
183 | 183 |
184 void CaretBase::invalidateCaretRect(Node* node, bool caretRectChanged) | 184 void CaretBase::invalidateCaretRect(Node* node) |
185 { | 185 { |
186 if (caretRectChanged) | |
187 return; | |
188 | |
189 if (LayoutViewItem view = node->document().layoutViewItem()) { | 186 if (LayoutViewItem view = node->document().layoutViewItem()) { |
190 node->document().updateStyleAndLayoutTree(); | 187 node->document().updateStyleAndLayoutTree(); |
191 if (hasEditableStyle(*node) || shouldRepaintCaret(view)) | 188 if (hasEditableStyle(*node) || shouldRepaintCaret(view)) |
192 invalidateLocalCaretRect(node, localCaretRectWithoutUpdate()); | 189 invalidateLocalCaretRect(node, localCaretRectWithoutUpdate()); |
193 } | 190 } |
194 } | 191 } |
195 | 192 |
196 void CaretBase::paintCaret(Node* node, GraphicsContext& context, const LayoutPoi
nt& paintOffset, DisplayItem::Type displayItemType) const | 193 void CaretBase::paintCaret(Node* node, GraphicsContext& context, const LayoutPoi
nt& paintOffset, DisplayItem::Type displayItemType) const |
197 { | 194 { |
198 if (m_caretVisibility == CaretVisibility::Hidden) | 195 if (m_caretVisibility == CaretVisibility::Hidden) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 { | 228 { |
232 return "Caret"; | 229 return "Caret"; |
233 } | 230 } |
234 | 231 |
235 LayoutRect CaretBase::visualRect() const | 232 LayoutRect CaretBase::visualRect() const |
236 { | 233 { |
237 return m_visualRect; | 234 return m_visualRect; |
238 } | 235 } |
239 | 236 |
240 } // namespace blink | 237 } // namespace blink |
OLD | NEW |