diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-10-09 21:25:29 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-10-09 21:25:29 +0200 |
commit | fdbad6284c6884a3d5b0b1c125b26711fbe585f8 (patch) | |
tree | 97ff4be8efff228ef23486e9324b5b0d44509063 /Libraries/LibHTML/HtmlView.cpp | |
parent | 33043941f97e89cfdb2148265dda379a489e5247 (diff) | |
download | serenity-fdbad6284c6884a3d5b0b1c125b26711fbe585f8.zip |
LibHTML: Implement the <blink> element
Just in time for Serenity's 1st birthday, here is the <blink> element!
This patch adds a bunch of different mechanisms to enable partial
repaints of the layout tree (LayoutNode::set_needs_display()))
It also adds LayoutNode::is_visible(), which can be toggled to prevent
a LayoutNode from rendering anything (it still takes up space though.)
Diffstat (limited to 'Libraries/LibHTML/HtmlView.cpp')
-rw-r--r-- | Libraries/LibHTML/HtmlView.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibHTML/HtmlView.cpp b/Libraries/LibHTML/HtmlView.cpp index b909fbb2bd..a1c0c8162c 100644 --- a/Libraries/LibHTML/HtmlView.cpp +++ b/Libraries/LibHTML/HtmlView.cpp @@ -17,6 +17,12 @@ HtmlView::HtmlView(GWidget* parent) : GScrollableWidget(parent) , m_main_frame(Frame::create()) { + main_frame().on_set_needs_display = [this](auto& content_rect) { + Rect adjusted_rect = content_rect; + adjusted_rect.set_location(to_widget_position(content_rect.location())); + update(adjusted_rect); + }; + set_frame_shape(FrameShape::Container); set_frame_shadow(FrameShadow::Sunken); set_frame_thickness(2); |