diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-07 22:15:22 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-07 23:01:43 +0200 |
commit | a53cf813748927ed03a862be847769a58453950b (patch) | |
tree | d6aa283b0f18642de86e155bed4443dbca649987 /Libraries/LibWeb/DOM | |
parent | f813041f67daa7a17197dee27ba5ed3fa2421235 (diff) | |
download | serenity-a53cf813748927ed03a862be847769a58453950b.zip |
LibCore: Add Core::Timer::create_single_shot()
This is just a convenience function for creating single-shot timers.
Diffstat (limited to 'Libraries/LibWeb/DOM')
-rw-r--r-- | Libraries/LibWeb/DOM/Document.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index d7fdc1dd5f..43c881ce8f 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -62,12 +62,9 @@ Document::Document() , m_style_resolver(make<StyleResolver>(*this)) , m_window(Window::create_with_document(*this)) { - m_style_update_timer = Core::Timer::construct(); - m_style_update_timer->set_single_shot(true); - m_style_update_timer->set_interval(0); - m_style_update_timer->on_timeout = [this] { + m_style_update_timer = Core::Timer::create_single_shot(0, [this] { update_style(); - }; + }); } Document::~Document() |