Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: third_party/WebKit/Source/core/editing/FrameCaret.cpp

Issue 2381373002: Disable caret blinking for blimp (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698