| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 } | 178 } |
| 179 return false; | 179 return false; |
| 180 } | 180 } |
| 181 | 181 |
| 182 void CaretBase::invalidateCaretRect(Node* node, bool caretRectChanged) | 182 void CaretBase::invalidateCaretRect(Node* node, bool caretRectChanged) |
| 183 { | 183 { |
| 184 if (caretRectChanged) | 184 if (caretRectChanged) |
| 185 return; | 185 return; |
| 186 | 186 |
| 187 if (LayoutViewItem view = node->document().layoutViewItem()) { | 187 if (LayoutViewItem view = node->document().layoutViewItem()) { |
| 188 if (node->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable) || s
houldRepaintCaret(view)) | 188 if (node->isContentEditable() || shouldRepaintCaret(view)) |
| 189 invalidateLocalCaretRect(node, localCaretRectWithoutUpdate()); | 189 invalidateLocalCaretRect(node, localCaretRectWithoutUpdate()); |
| 190 } | 190 } |
| 191 } | 191 } |
| 192 | 192 |
| 193 void CaretBase::paintCaret(Node* node, GraphicsContext& context, const LayoutPoi
nt& paintOffset) const | 193 void CaretBase::paintCaret(Node* node, GraphicsContext& context, const LayoutPoi
nt& paintOffset) const |
| 194 { | 194 { |
| 195 if (m_caretVisibility == CaretVisibility::Hidden) | 195 if (m_caretVisibility == CaretVisibility::Hidden) |
| 196 return; | 196 return; |
| 197 | 197 |
| 198 LayoutRect drawingRect = localCaretRectWithoutUpdate(); | 198 LayoutRect drawingRect = localCaretRectWithoutUpdate(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 213 | 213 |
| 214 context.fillRect(FloatRect(drawingRect), caretColor); | 214 context.fillRect(FloatRect(drawingRect), caretColor); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void CaretBase::setCaretVisibility(CaretVisibility visibility) | 217 void CaretBase::setCaretVisibility(CaretVisibility visibility) |
| 218 { | 218 { |
| 219 m_caretVisibility = visibility; | 219 m_caretVisibility = visibility; |
| 220 } | 220 } |
| 221 | 221 |
| 222 } // namespace blink | 222 } // namespace blink |
| OLD | NEW |