27
27
28
28
namespace Web {
29
29
30
- void dump_tree (const DOM::Node& node)
30
+ void dump_tree (DOM::Node const & node)
31
31
{
32
32
StringBuilder builder;
33
33
dump_tree (builder, node);
34
34
dbgln (" {}" , builder.string_view ());
35
35
}
36
36
37
- void dump_tree (StringBuilder& builder, const DOM::Node& node)
37
+ void dump_tree (StringBuilder& builder, DOM::Node const & node)
38
38
{
39
39
static int indent = 0 ;
40
40
for (int i = 0 ; i < indent; ++i)
@@ -56,7 +56,7 @@ void dump_tree(StringBuilder& builder, const DOM::Node& node)
56
56
}
57
57
if (is<DOM::ParentNode>(node)) {
58
58
if (!is<HTML::HTMLTemplateElement>(node)) {
59
- static_cast <const DOM::ParentNode&>(node).for_each_child ([](auto & child) {
59
+ static_cast <DOM::ParentNode const &>(node).for_each_child ([](auto & child) {
60
60
dump_tree (child);
61
61
});
62
62
} else {
@@ -67,14 +67,14 @@ void dump_tree(StringBuilder& builder, const DOM::Node& node)
67
67
--indent;
68
68
}
69
69
70
- void dump_tree (const Layout::Node& layout_node, bool show_box_model, bool show_specified_style)
70
+ void dump_tree (Layout::Node const & layout_node, bool show_box_model, bool show_specified_style)
71
71
{
72
72
StringBuilder builder;
73
73
dump_tree (builder, layout_node, show_box_model, show_specified_style, true );
74
74
dbgln (" {}" , builder.string_view ());
75
75
}
76
76
77
- void dump_tree (StringBuilder& builder, const Layout::Node& layout_node, bool show_box_model, bool show_specified_style, bool interactive)
77
+ void dump_tree (StringBuilder& builder, Layout::Node const & layout_node, bool show_box_model, bool show_specified_style, bool interactive)
78
78
{
79
79
static size_t indent = 0 ;
80
80
for (size_t i = 0 ; i < indent; ++i)
@@ -104,15 +104,15 @@ void dump_tree(StringBuilder& builder, const Layout::Node& layout_node, bool sho
104
104
identifier = builder.to_string ();
105
105
}
106
106
107
- const char * nonbox_color_on = " " ;
108
- const char * box_color_on = " " ;
109
- const char * positioned_color_on = " " ;
110
- const char * floating_color_on = " " ;
111
- const char * inline_block_color_on = " " ;
112
- const char * line_box_color_on = " " ;
113
- const char * fragment_color_on = " " ;
114
- const char * flex_color_on = " " ;
115
- const char * color_off = " " ;
107
+ char const * nonbox_color_on = " " ;
108
+ char const * box_color_on = " " ;
109
+ char const * positioned_color_on = " " ;
110
+ char const * floating_color_on = " " ;
111
+ char const * inline_block_color_on = " " ;
112
+ char const * line_box_color_on = " " ;
113
+ char const * fragment_color_on = " " ;
114
+ char const * flex_color_on = " " ;
115
+ char const * color_off = " " ;
116
116
117
117
if (interactive) {
118
118
nonbox_color_on = " \033 [33m" ;
@@ -194,8 +194,8 @@ void dump_tree(StringBuilder& builder, const Layout::Node& layout_node, bool sho
194
194
builder.append (" \n " );
195
195
}
196
196
197
- if (is<Layout::BlockBox>(layout_node) && static_cast <const Layout::BlockBox&>(layout_node).children_are_inline ()) {
198
- auto & block = static_cast <const Layout::BlockBox&>(layout_node);
197
+ if (is<Layout::BlockBox>(layout_node) && static_cast <Layout::BlockBox const &>(layout_node).children_are_inline ()) {
198
+ auto & block = static_cast <Layout::BlockBox const &>(layout_node);
199
199
for (size_t line_box_index = 0 ; line_box_index < block.line_boxes ().size (); ++line_box_index) {
200
200
auto & line_box = block.line_boxes ()[line_box_index];
201
201
for (size_t i = 0 ; i < indent; ++i)
@@ -223,7 +223,7 @@ void dump_tree(StringBuilder& builder, const Layout::Node& layout_node, bool sho
223
223
if (is<Layout::TextNode>(fragment.layout_node ())) {
224
224
for (size_t i = 0 ; i < indent; ++i)
225
225
builder.append (" " );
226
- auto & layout_text = static_cast <const Layout::TextNode&>(fragment.layout_node ());
226
+ auto & layout_text = static_cast <Layout::TextNode const &>(fragment.layout_node ());
227
227
auto fragment_text = layout_text.text_for_rendering ().substring (fragment.start (), fragment.length ());
228
228
builder.appendff (" \" {}\"\n " , fragment_text);
229
229
}
@@ -256,21 +256,21 @@ void dump_tree(StringBuilder& builder, const Layout::Node& layout_node, bool sho
256
256
--indent;
257
257
}
258
258
259
- void dump_selector (const CSS::Selector& selector)
259
+ void dump_selector (CSS::Selector const & selector)
260
260
{
261
261
StringBuilder builder;
262
262
dump_selector (builder, selector);
263
263
dbgln (" {}" , builder.string_view ());
264
264
}
265
265
266
- void dump_selector (StringBuilder& builder, const CSS::Selector& selector)
266
+ void dump_selector (StringBuilder& builder, CSS::Selector const & selector)
267
267
{
268
268
builder.append (" CSS::Selector:\n " );
269
269
270
270
for (auto & complex_selector : selector.complex_selectors ()) {
271
271
builder.append (" " );
272
272
273
- const char * relation_description = " " ;
273
+ char const * relation_description = " " ;
274
274
switch (complex_selector.relation ) {
275
275
case CSS::Selector::ComplexSelector::Relation::None:
276
276
relation_description = " None" ;
@@ -297,7 +297,7 @@ void dump_selector(StringBuilder& builder, const CSS::Selector& selector)
297
297
298
298
for (size_t i = 0 ; i < complex_selector.compound_selector .size (); ++i) {
299
299
auto & simple_selector = complex_selector.compound_selector [i];
300
- const char * type_description = " Unknown" ;
300
+ char const * type_description = " Unknown" ;
301
301
switch (simple_selector.type ) {
302
302
case CSS::Selector::SimpleSelector::Type::Invalid:
303
303
type_description = " Invalid" ;
@@ -342,7 +342,7 @@ void dump_selector(StringBuilder& builder, const CSS::Selector& selector)
342
342
break ;
343
343
}
344
344
345
- const char * pseudo_class_description = " " ;
345
+ char const * pseudo_class_description = " " ;
346
346
switch (simple_selector.pseudo_class ) {
347
347
case CSS::Selector::SimpleSelector::PseudoClass::Link:
348
348
pseudo_class_description = " Link" ;
@@ -417,34 +417,34 @@ void dump_selector(StringBuilder& builder, const CSS::Selector& selector)
417
417
}
418
418
}
419
419
420
- void dump_rule (const CSS::CSSRule& rule)
420
+ void dump_rule (CSS::CSSRule const & rule)
421
421
{
422
422
StringBuilder builder;
423
423
dump_rule (builder, rule);
424
424
dbgln (" {}" , builder.string_view ());
425
425
}
426
426
427
- void dump_rule (StringBuilder& builder, const CSS::CSSRule& rule)
427
+ void dump_rule (StringBuilder& builder, CSS::CSSRule const & rule)
428
428
{
429
429
builder.appendff (" {}:\n " , rule.class_name ());
430
430
switch (rule.type ()) {
431
431
case CSS::CSSRule::Type::Style:
432
- dump_style_rule (builder, verify_cast<const CSS::CSSStyleRule>(rule));
432
+ dump_style_rule (builder, verify_cast<CSS::CSSStyleRule const >(rule));
433
433
break ;
434
434
case CSS::CSSRule::Type::Import:
435
- dump_import_rule (builder, verify_cast<const CSS::CSSImportRule>(rule));
435
+ dump_import_rule (builder, verify_cast<CSS::CSSImportRule const >(rule));
436
436
break ;
437
437
default :
438
438
VERIFY_NOT_REACHED ();
439
439
}
440
440
}
441
441
442
- void dump_import_rule (StringBuilder& builder, const CSS::CSSImportRule& rule)
442
+ void dump_import_rule (StringBuilder& builder, CSS::CSSImportRule const & rule)
443
443
{
444
444
builder.appendff (" Document URL: {}\n " , rule.url ());
445
445
}
446
446
447
- void dump_style_rule (StringBuilder& builder, const CSS::CSSStyleRule& rule)
447
+ void dump_style_rule (StringBuilder& builder, CSS::CSSStyleRule const & rule)
448
448
{
449
449
for (auto & selector : rule.selectors ()) {
450
450
dump_selector (builder, selector);
@@ -455,7 +455,7 @@ void dump_style_rule(StringBuilder& builder, const CSS::CSSStyleRule& rule)
455
455
}
456
456
}
457
457
458
- void dump_sheet (const CSS::StyleSheet& sheet)
458
+ void dump_sheet (CSS::StyleSheet const & sheet)
459
459
{
460
460
StringBuilder builder;
461
461
dump_sheet (builder, sheet);
0 commit comments