| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 if (node != m_previousCaretNode) | 225 if (node != m_previousCaretNode) |
| 226 return; | 226 return; |
| 227 // Hits in ManualTests/caret-paint-after-last-text-is-removed.html | 227 // Hits in ManualTests/caret-paint-after-last-text-is-removed.html |
| 228 DisableCompositingQueryAsserts disabler; | 228 DisableCompositingQueryAsserts disabler; |
| 229 invalidateLocalCaretRect(m_previousCaretNode.get(), m_previousCaretRect); | 229 invalidateLocalCaretRect(m_previousCaretNode.get(), m_previousCaretRect); |
| 230 m_previousCaretNode = nullptr; | 230 m_previousCaretNode = nullptr; |
| 231 m_previousCaretRect = LayoutRect(); | 231 m_previousCaretRect = LayoutRect(); |
| 232 m_previousCaretVisibility = CaretVisibility::Hidden; | 232 m_previousCaretVisibility = CaretVisibility::Hidden; |
| 233 } | 233 } |
| 234 | 234 |
| 235 void FrameCaret::prepareForDestruction() | 235 void FrameCaret::documentDetached() |
| 236 { | 236 { |
| 237 m_caretPosition = PositionWithAffinity(); | 237 m_caretPosition = PositionWithAffinity(); |
| 238 m_caretBlinkTimer.stop(); | 238 m_caretBlinkTimer.stop(); |
| 239 m_previousCaretNode.clear(); | 239 m_previousCaretNode.clear(); |
| 240 } | 240 } |
| 241 | 241 |
| 242 bool FrameCaret::shouldBlinkCaret() const | 242 bool FrameCaret::shouldBlinkCaret() const |
| 243 { | 243 { |
| 244 if (!caretIsVisible() || !isActive()) | 244 if (!caretIsVisible() || !isActive()) |
| 245 return false; | 245 return false; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 261 void FrameCaret::caretBlinkTimerFired(Timer<FrameCaret>*) | 261 void FrameCaret::caretBlinkTimerFired(Timer<FrameCaret>*) |
| 262 { | 262 { |
| 263 DCHECK(caretIsVisible()); | 263 DCHECK(caretIsVisible()); |
| 264 if (isCaretBlinkingSuspended() && m_shouldPaintCaret) | 264 if (isCaretBlinkingSuspended() && m_shouldPaintCaret) |
| 265 return; | 265 return; |
| 266 m_shouldPaintCaret = !m_shouldPaintCaret; | 266 m_shouldPaintCaret = !m_shouldPaintCaret; |
| 267 setCaretRectNeedsUpdate(); | 267 setCaretRectNeedsUpdate(); |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // nemaspace blink | 270 } // nemaspace blink |
| OLD | NEW |