summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-25 18:29:44 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-25 18:29:44 +0000
commit378aa56ae0fd1ab0f631d2e44f47cf14b344f657 (patch)
tree3a523b0b3c8a956a43a945f0fa03a46641f3bca7 /webkit
parent9f653edfb27d8a6c0f9680c10095618d8318caed (diff)
downloadchromium_src-378aa56ae0fd1ab0f631d2e44f47cf14b344f657.zip
chromium_src-378aa56ae0fd1ab0f631d2e44f47cf14b344f657.tar.gz
chromium_src-378aa56ae0fd1ab0f631d2e44f47cf14b344f657.tar.bz2
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
Diffstat (limited to 'webkit')
-rw-r--r--webkit/port/rendering/RenderThemeWin.cpp14
1 files changed, 12 insertions, 2 deletions
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