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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 253 } |
254 | 254 |
255 bool FrameCaret::shouldBlinkCaret() const | 255 bool FrameCaret::shouldBlinkCaret() const |
256 { | 256 { |
257 if (m_caretVisibility != CaretVisibility::Visible || !isActive()) | 257 if (m_caretVisibility != CaretVisibility::Visible || !isActive()) |
258 return false; | 258 return false; |
259 | 259 |
260 if (m_frame->settings() && m_frame->settings()->caretBrowsingEnabled()) | 260 if (m_frame->settings() && m_frame->settings()->caretBrowsingEnabled()) |
261 return false; | 261 return false; |
262 | 262 |
| 263 if (m_frame->settings() && m_frame->settings()->disableCaretBlinking()) |
| 264 return false; |
| 265 |
263 Element* root = rootEditableElementOf(caretPosition().position()); | 266 Element* root = rootEditableElementOf(caretPosition().position()); |
264 if (!root) | 267 if (!root) |
265 return false; | 268 return false; |
266 | 269 |
267 Element* focusedElement = root->document().focusedElement(); | 270 Element* focusedElement = root->document().focusedElement(); |
268 if (!focusedElement) | 271 if (!focusedElement) |
269 return false; | 272 return false; |
270 | 273 |
271 return focusedElement->isShadowIncludingInclusiveAncestorOf(caretPosition().
position().anchorNode()); | 274 return focusedElement->isShadowIncludingInclusiveAncestorOf(caretPosition().
position().anchorNode()); |
272 } | 275 } |
273 | 276 |
274 void FrameCaret::caretBlinkTimerFired(TimerBase*) | 277 void FrameCaret::caretBlinkTimerFired(TimerBase*) |
275 { | 278 { |
276 DCHECK_EQ(m_caretVisibility, CaretVisibility::Visible); | 279 DCHECK_EQ(m_caretVisibility, CaretVisibility::Visible); |
277 if (isCaretBlinkingSuspended() && m_shouldPaintCaret) | 280 if (isCaretBlinkingSuspended() && m_shouldPaintCaret) |
278 return; | 281 return; |
279 m_shouldPaintCaret = !m_shouldPaintCaret; | 282 m_shouldPaintCaret = !m_shouldPaintCaret; |
280 setCaretRectNeedsUpdate(); | 283 setCaretRectNeedsUpdate(); |
281 } | 284 } |
282 | 285 |
283 } // nemaspace blink | 286 } // nemaspace blink |
OLD | NEW |