File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 24
24
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
25
*/
26
26
27
+ #define PARSER_DEBUG
28
+
27
29
#include < AK/Utf32View.h>
28
30
#include < LibWeb/DOM/Comment.h>
29
31
#include < LibWeb/DOM/Document.h>
30
32
#include < LibWeb/DOM/DocumentType.h>
31
33
#include < LibWeb/DOM/ElementFactory.h>
34
+ #include < LibWeb/DOM/Event.h>
32
35
#include < LibWeb/DOM/HTMLFormElement.h>
33
36
#include < LibWeb/DOM/HTMLHeadElement.h>
34
37
#include < LibWeb/DOM/HTMLScriptElement.h>
@@ -65,12 +68,18 @@ void HTMLDocumentParser::run(const URL& url)
65
68
for (;;) {
66
69
auto optional_token = m_tokenizer.next_token ();
67
70
if (!optional_token.has_value ())
68
- return ;
71
+ break ;
69
72
auto & token = optional_token.value ();
70
73
74
+ #ifdef PARSER_DEBUG
71
75
dbg () << " [" << insertion_mode_name () << " ] " << token.to_string ();
76
+ #endif
72
77
process_using_the_rules_for (m_insertion_mode, token);
73
78
}
79
+
80
+ // "The end"
81
+
82
+ m_document->dispatch_event (Event::create (" DOMContentLoaded" ));
74
83
}
75
84
76
85
void HTMLDocumentParser::process_using_the_rules_for (InsertionMode mode, HTMLToken& token)
@@ -543,7 +552,7 @@ void HTMLDocumentParser::run_the_adoption_agency_algorithm(HTMLToken& token)
543
552
544
553
size_t outer_loop_counter = 0 ;
545
554
546
- // OuterLoop:
555
+ // OuterLoop:
547
556
if (outer_loop_counter >= 8 )
548
557
return ;
549
558
You can’t perform that action at this time.
0 commit comments