|
@@ -18,39 +18,35 @@
|
|
|
|
|
|
namespace Web {
|
|
|
|
|
|
-BrowsingContext::BrowsingContext(DOM::Element& host_element, BrowsingContext& top_level_browsing_context)
|
|
|
- : m_page(*top_level_browsing_context.page())
|
|
|
+BrowsingContext::BrowsingContext(Page& page, DOM::Element* host_element, BrowsingContext& top_level_browsing_context)
|
|
|
+ : m_page(page)
|
|
|
, m_top_level_browsing_context(top_level_browsing_context)
|
|
|
, m_loader(*this)
|
|
|
, m_event_handler({}, *this)
|
|
|
, m_host_element(host_element)
|
|
|
{
|
|
|
- setup();
|
|
|
+ m_cursor_blink_timer = Core::Timer::construct(500, [this] {
|
|
|
+ if (!is_focused_context())
|
|
|
+ return;
|
|
|
+ if (m_cursor_position.node() && m_cursor_position.node()->layout_node()) {
|
|
|
+ m_cursor_blink_state = !m_cursor_blink_state;
|
|
|
+ m_cursor_position.node()->layout_node()->set_needs_display();
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
-BrowsingContext::BrowsingContext(Page& page)
|
|
|
- : m_page(page)
|
|
|
- , m_top_level_browsing_context(*this)
|
|
|
- , m_loader(*this)
|
|
|
- , m_event_handler({}, *this)
|
|
|
+BrowsingContext::BrowsingContext(DOM::Element& host_element, BrowsingContext& top_level_browsing_context)
|
|
|
+ : BrowsingContext(*top_level_browsing_context.page(), &host_element, top_level_browsing_context)
|
|
|
{
|
|
|
- setup();
|
|
|
}
|
|
|
|
|
|
-BrowsingContext::~BrowsingContext()
|
|
|
+BrowsingContext::BrowsingContext(Page& page)
|
|
|
+ : BrowsingContext(page, nullptr, *this)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
-void BrowsingContext::setup()
|
|
|
+BrowsingContext::~BrowsingContext()
|
|
|
{
|
|
|
- m_cursor_blink_timer = Core::Timer::construct(500, [this] {
|
|
|
- if (!is_focused_context())
|
|
|
- return;
|
|
|
- if (m_cursor_position.node() && m_cursor_position.node()->layout_node()) {
|
|
|
- m_cursor_blink_state = !m_cursor_blink_state;
|
|
|
- m_cursor_position.node()->layout_node()->set_needs_display();
|
|
|
- }
|
|
|
- });
|
|
|
}
|
|
|
|
|
|
void BrowsingContext::did_edit(Badge<EditEventHandler>)
|