
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.)
17 lines
537 B
C++
17 lines
537 B
C++
#include <LibGUI/GPainter.h>
|
|
#include <LibHTML/Layout/LayoutText.h>
|
|
#include <LibHTML/Layout/LineBoxFragment.h>
|
|
#include <LibHTML/RenderingContext.h>
|
|
|
|
void LineBoxFragment::render(RenderingContext& context)
|
|
{
|
|
for (auto* ancestor = layout_node().parent(); ancestor; ancestor = ancestor->parent()) {
|
|
if (!ancestor->is_visible())
|
|
return;
|
|
}
|
|
|
|
if (layout_node().is_text()) {
|
|
auto& layout_text = static_cast<const LayoutText&>(layout_node());
|
|
layout_text.render_fragment(context, *this);
|
|
}
|
|
}
|