mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
This commit is contained in:
parent
63814ffebf
commit
04b9dc2d30
328 changed files with 36 additions and 36 deletions
39
Libraries/LibHTML/Layout/LayoutText.cpp
Normal file
39
Libraries/LibHTML/Layout/LayoutText.cpp
Normal file
|
@ -0,0 +1,39 @@
|
|||
#include <LibHTML/Layout/LayoutText.h>
|
||||
#include <ctype.h>
|
||||
|
||||
LayoutText::LayoutText(const Text& text, const StyledNode& styled_node)
|
||||
: LayoutNode(&text, styled_node)
|
||||
{
|
||||
}
|
||||
|
||||
LayoutText::~LayoutText()
|
||||
{
|
||||
}
|
||||
|
||||
static bool is_all_whitespace(const String& string)
|
||||
{
|
||||
for (int i = 0; i < string.length(); ++i) {
|
||||
if (!isspace(string[i]))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
const String& LayoutText::text() const
|
||||
{
|
||||
static String one_space = " ";
|
||||
if (is_all_whitespace(node().data()))
|
||||
return one_space;
|
||||
return node().data();
|
||||
}
|
||||
|
||||
void LayoutText::compute_runs()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void LayoutText::layout()
|
||||
{
|
||||
ASSERT(!has_children());
|
||||
compute_runs();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue