summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Frame
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibWeb/Frame')
-rw-r--r--Libraries/LibWeb/Frame/EventHandler.cpp8
-rw-r--r--Libraries/LibWeb/Frame/EventHandler.h6
-rw-r--r--Libraries/LibWeb/Frame/Frame.cpp10
-rw-r--r--Libraries/LibWeb/Frame/Frame.h18
4 files changed, 21 insertions, 21 deletions
diff --git a/Libraries/LibWeb/Frame/EventHandler.cpp b/Libraries/LibWeb/Frame/EventHandler.cpp
index 5145cc43e4..be2775a92b 100644
--- a/Libraries/LibWeb/Frame/EventHandler.cpp
+++ b/Libraries/LibWeb/Frame/EventHandler.cpp
@@ -38,7 +38,7 @@
namespace Web {
-static Gfx::Point compute_mouse_event_offset(const Gfx::Point& position, const LayoutNode& layout_node)
+static Gfx::IntPoint compute_mouse_event_offset(const Gfx::IntPoint& position, const LayoutNode& layout_node)
{
auto top_left_of_layout_node = layout_node.box_type_agnostic_position();
return {
@@ -70,7 +70,7 @@ LayoutDocument* EventHandler::layout_root()
return const_cast<LayoutDocument*>(m_frame.document()->layout_node());
}
-bool EventHandler::handle_mouseup(const Gfx::Point& position, unsigned button, unsigned modifiers)
+bool EventHandler::handle_mouseup(const Gfx::IntPoint& position, unsigned button, unsigned modifiers)
{
auto* layout_root_ptr = this->layout_root();
if (!layout_root_ptr)
@@ -98,7 +98,7 @@ bool EventHandler::handle_mouseup(const Gfx::Point& position, unsigned button, u
return handled_event;
}
-bool EventHandler::handle_mousedown(const Gfx::Point& position, unsigned button, unsigned modifiers)
+bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned button, unsigned modifiers)
{
auto* layout_root_ptr = this->layout_root();
if (!layout_root_ptr)
@@ -154,7 +154,7 @@ bool EventHandler::handle_mousedown(const Gfx::Point& position, unsigned button,
return true;
}
-bool EventHandler::handle_mousemove(const Gfx::Point& position, unsigned buttons, unsigned modifiers)
+bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned buttons, unsigned modifiers)
{
auto* layout_root_ptr = this->layout_root();
if (!layout_root_ptr)
diff --git a/Libraries/LibWeb/Frame/EventHandler.h b/Libraries/LibWeb/Frame/EventHandler.h
index 21f893617c..9a06a83c2e 100644
--- a/Libraries/LibWeb/Frame/EventHandler.h
+++ b/Libraries/LibWeb/Frame/EventHandler.h
@@ -40,9 +40,9 @@ public:
explicit EventHandler(Badge<Frame>, Frame&);
~EventHandler();
- bool handle_mouseup(const Gfx::Point&, unsigned button, unsigned modifiers);
- bool handle_mousedown(const Gfx::Point&, unsigned button, unsigned modifiers);
- bool handle_mousemove(const Gfx::Point&, unsigned buttons, unsigned modifiers);
+ bool handle_mouseup(const Gfx::IntPoint&, unsigned button, unsigned modifiers);
+ bool handle_mousedown(const Gfx::IntPoint&, unsigned button, unsigned modifiers);
+ bool handle_mousemove(const Gfx::IntPoint&, unsigned buttons, unsigned modifiers);
private:
LayoutDocument* layout_root();
diff --git a/Libraries/LibWeb/Frame/Frame.cpp b/Libraries/LibWeb/Frame/Frame.cpp
index 64efa4a533..11f4ade734 100644
--- a/Libraries/LibWeb/Frame/Frame.cpp
+++ b/Libraries/LibWeb/Frame/Frame.cpp
@@ -69,7 +69,7 @@ void Frame::set_document(Document* document)
page().client().page_did_set_document_in_main_frame(m_document);
}
-void Frame::set_size(const Gfx::Size& size)
+void Frame::set_size(const Gfx::IntSize& size)
{
if (m_size == size)
return;
@@ -78,7 +78,7 @@ void Frame::set_size(const Gfx::Size& size)
m_document->layout();
}
-void Frame::set_viewport_rect(const Gfx::Rect& rect)
+void Frame::set_viewport_rect(const Gfx::IntRect& rect)
{
if (m_viewport_rect == rect)
return;
@@ -88,7 +88,7 @@ void Frame::set_viewport_rect(const Gfx::Rect& rect)
m_document->layout_node()->did_set_viewport_rect({}, rect);
}
-void Frame::set_needs_display(const Gfx::Rect& rect)
+void Frame::set_needs_display(const Gfx::IntRect& rect)
{
if (!m_viewport_rect.intersects(rect))
return;
@@ -121,14 +121,14 @@ void Frame::scroll_to_anchor(const String& fragment)
page().client().page_did_request_scroll_to_anchor(fragment);
}
-Gfx::Rect Frame::to_main_frame_rect(const Gfx::Rect& a_rect)
+Gfx::IntRect Frame::to_main_frame_rect(const Gfx::IntRect& a_rect)
{
auto rect = a_rect;
rect.set_location(to_main_frame_position(a_rect.location()));
return rect;
}
-Gfx::Point Frame::to_main_frame_position(const Gfx::Point& a_position)
+Gfx::IntPoint Frame::to_main_frame_position(const Gfx::IntPoint& a_position)
{
auto position = a_position;
for (auto* ancestor = parent(); ancestor; ancestor = ancestor->parent()) {
diff --git a/Libraries/LibWeb/Frame/Frame.h b/Libraries/LibWeb/Frame/Frame.h
index af259be517..b72e25c912 100644
--- a/Libraries/LibWeb/Frame/Frame.h
+++ b/Libraries/LibWeb/Frame/Frame.h
@@ -55,13 +55,13 @@ public:
Page& page() { return m_page; }
const Page& page() const { return m_page; }
- const Gfx::Size& size() const { return m_size; }
- void set_size(const Gfx::Size&);
+ const Gfx::IntSize& size() const { return m_size; }
+ void set_size(const Gfx::IntSize&);
- void set_needs_display(const Gfx::Rect&);
+ void set_needs_display(const Gfx::IntRect&);
- void set_viewport_rect(const Gfx::Rect&);
- Gfx::Rect viewport_rect() const { return m_viewport_rect; }
+ void set_viewport_rect(const Gfx::IntRect&);
+ Gfx::IntRect viewport_rect() const { return m_viewport_rect; }
void did_scroll(Badge<PageView>);
@@ -79,8 +79,8 @@ public:
Element* host_element() { return m_host_element; }
const Element* host_element() const { return m_host_element; }
- Gfx::Point to_main_frame_position(const Gfx::Point&);
- Gfx::Rect to_main_frame_rect(const Gfx::Rect&);
+ Gfx::IntPoint to_main_frame_position(const Gfx::IntPoint&);
+ Gfx::IntRect to_main_frame_rect(const Gfx::IntRect&);
private:
explicit Frame(Element& host_element, Frame& main_frame);
@@ -94,8 +94,8 @@ private:
WeakPtr<Element> m_host_element;
RefPtr<Document> m_document;
- Gfx::Size m_size;
- Gfx::Rect m_viewport_rect;
+ Gfx::IntSize m_size;
+ Gfx::IntRect m_viewport_rect;
};
}