mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:47:47 +00:00
LibWeb: Demangle the names returned by Layout::Node::class_name()
Note that these are only used in debugging/test output so it's not performance sensitive.
This commit is contained in:
parent
730af2c524
commit
fc86717f43
3 changed files with 10 additions and 5 deletions
|
@ -24,6 +24,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <AK/Demangle.h>
|
||||||
#include <LibGUI/Painter.h>
|
#include <LibGUI/Painter.h>
|
||||||
#include <LibWeb/DOM/Document.h>
|
#include <LibWeb/DOM/Document.h>
|
||||||
#include <LibWeb/DOM/Element.h>
|
#include <LibWeb/DOM/Element.h>
|
||||||
|
@ -297,9 +298,9 @@ bool Node::is_root_element() const
|
||||||
return is<HTML::HTMLHtmlElement>(*dom_node());
|
return is<HTML::HTMLHtmlElement>(*dom_node());
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* Node::class_name() const
|
String Node::class_name() const
|
||||||
{
|
{
|
||||||
return typeid(*this).name();
|
return demangle(typeid(*this).name());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,8 @@ public:
|
||||||
|
|
||||||
bool is_root_element() const;
|
bool is_root_element() const;
|
||||||
|
|
||||||
const char* class_name() const;
|
String class_name() const;
|
||||||
|
|
||||||
virtual bool is_initial_containing_block() const { return false; }
|
virtual bool is_initial_containing_block() const { return false; }
|
||||||
virtual bool is_text() const { return false; }
|
virtual bool is_text() const { return false; }
|
||||||
virtual bool is_block() const { return false; }
|
virtual bool is_block() const { return false; }
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/QuickSort.h>
|
#include <AK/QuickSort.h>
|
||||||
|
#include <AK/StringBuilder.h>
|
||||||
#include <LibWeb/DOM/Node.h>
|
#include <LibWeb/DOM/Node.h>
|
||||||
#include <LibWeb/Layout/Box.h>
|
#include <LibWeb/Layout/Box.h>
|
||||||
#include <LibWeb/Layout/InitialContainingBlockBox.h>
|
#include <LibWeb/Layout/InitialContainingBlockBox.h>
|
||||||
|
@ -82,9 +83,11 @@ HitTestResult StackingContext::hit_test(const Gfx::IntPoint& position, HitTestTy
|
||||||
|
|
||||||
void StackingContext::dump(int indent) const
|
void StackingContext::dump(int indent) const
|
||||||
{
|
{
|
||||||
|
StringBuilder builder;
|
||||||
for (int i = 0; i < indent; ++i)
|
for (int i = 0; i < indent; ++i)
|
||||||
dbgprintf(" ");
|
builder.append(' ');
|
||||||
dbgprintf("SC for %s{%s} %s [children: %zu]\n", m_box.class_name(), m_box.dom_node() ? m_box.dom_node()->node_name().characters() : "(anonymous)", m_box.absolute_rect().to_string().characters(), m_children.size());
|
builder.appendff("SC for {}({}) {} [children: {}]", m_box.class_name(), m_box.dom_node() ? m_box.dom_node()->node_name().characters() : "(anonymous)", m_box.absolute_rect().to_string().characters(), m_children.size());
|
||||||
|
dbgln("{}", builder.string_view());
|
||||||
for (auto& child : m_children)
|
for (auto& child : m_children)
|
||||||
child->dump(indent + 1);
|
child->dump(indent + 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue