JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
set node.parent on <script> and comments
authorJason Woofenden <jason@jasonwoof.com>
Wed, 7 Jun 2017 03:41:12 +0000 (23:41 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Wed, 7 Jun 2017 03:41:12 +0000 (23:41 -0400)
parser.js

index 4493ed1..1d8a53a 100644 (file)
--- a/parser.js
+++ b/parser.js
@@ -1673,6 +1673,7 @@ parse_html = function (args_html, args) {
                        position = adjusted_insertion_location()
                }
                position[0].children.splice(position[1], 0, t)
+               t.parent = position[0]
                return
        }
 
@@ -1919,6 +1920,7 @@ parse_html = function (args_html, args) {
                        el.flag('parser-inserted', true)
                        // fixfull frament case
                        ail[0].children.splice(ail[1], 0, el)
+                       el.parent = ail[0]
                        open_els.unshift(el)
                        tok_state = tok_state_script_data
                        original_ins_mode = ins_mode // make sure orig... is defined