From 378aa56ae0fd1ab0f631d2e44f47cf14b344f657 Mon Sep 17 00:00:00 2001 From: "deanm@chromium.org" Date: Tue, 25 Nov 2008 18:29:44 +0000 Subject: Query the system for the blink interval setting. Review URL: http://codereview.chromium.org/12421 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5978 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/port/rendering/RenderThemeWin.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'webkit') diff --git a/webkit/port/rendering/RenderThemeWin.cpp b/webkit/port/rendering/RenderThemeWin.cpp index a740c9e..c086823 100644 --- a/webkit/port/rendering/RenderThemeWin.cpp +++ b/webkit/port/rendering/RenderThemeWin.cpp @@ -182,6 +182,15 @@ static void setSizeIfAuto(RenderStyle* style, const IntSize& size) style->setHeight(Length(size.height(), Fixed)); } +static double querySystemBlinkInterval() { + UINT blinkTime = ::GetCaretBlinkTime(); + if (blinkTime == 0) + return RenderTheme::caretBlinkFrequency(); + if (blinkTime == INFINITE) + return 0; + return blinkTime / 1000.0; +} + // Implement WebCore::theme() for getting the global RenderTheme. RenderTheme* theme() { @@ -243,8 +252,9 @@ double RenderThemeWin::caretBlinkFrequency() const if (ChromiumBridge::layoutTestMode()) return 0; - // TODO(ericroman): this should be using the platform's blink frequency. - return RenderTheme::caretBlinkFrequency(); + // This involves a system call, so we cache the result. + static double blinkInterval = querySystemBlinkInterval(); + return blinkInterval; } void RenderThemeWin::systemFont(int propId, Document* document, FontDescription& fontDescription) const -- cgit v1.1