mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 18:15:07 +00:00
LibHTML: Create some subdirectories.
This commit is contained in:
parent
0522a8f71c
commit
1f51c2b7da
25 changed files with 49 additions and 50 deletions
|
@ -1,28 +0,0 @@
|
|||
#include <LibHTML/LayoutText.h>
|
||||
#include <ctype.h>
|
||||
|
||||
LayoutText::LayoutText(const Text& text)
|
||||
: LayoutNode(&text)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue