[Bug 17529] New: Inserting multiple script elements using a document fragment isn't specified properly

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 17529] New: Inserting multiple script elements using a document fragment isn't specified properly

Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17529

           Summary: Inserting multiple script elements using a document
                    fragment isn't specified properly
           Product: WebAppsWG
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DOM
        AssignedTo: [hidden email]
        ReportedBy: [hidden email]
         QAContact: [hidden email]
                CC: [hidden email], [hidden email]


Per HTML spec inserting script element to DOM should execute it immediately
(I'm talking about var s = document.createElement("script"); s.textContent =
"alert('foo')"; document.body.appendChild(s); case)

Unfortunately it isn't clear what should happen when you have several
script elements in a document fragment and insert that document fragment to
DOM.

Gecko seems to execute scripts after all the nodes are in DOM.
This seems to be ok per spec, since nothing prevents to do
"HTML: An element is said to have been inserted into a document when its root
element changes and is now the document's root element." atomically for several
elements and DOM4 just says
"Insert all nodes in nodes before child or at the end of parent if child is
null."
The behavior Gecko has doesn't cause problems to Mutation Record creation.

Presto and Webkit execute scripts one by one during the document fragment
insertion
but not in the same way. Webkit seems to remove nodes first from the document
fragment,
Presto removes them one by one. (Webkit's follow the spec here)
Anyhow, the tricky thing is that what if some script moves nodes during
insertion.
What kinds of Mutation Records should be created? What should actually happen
to the nodes
which are being inserted to DOM but which some script moves to elsewhere just
before insertion.

--
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Reply | Threaded
Open this post in threaded view
|

[Bug 17529] Inserting multiple script elements using a document fragment isn't specified properly

Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17529

Travis Leithead [MSFT] <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |[hidden email]
         Resolution|---                         |FIXED
           Assignee|[hidden email]            |[hidden email]

--- Comment #10 from Travis Leithead [MSFT] <[hidden email]> ---
This was fixed by a previous commit:
https://github.com/w3c/html/commit/6afe9c0f52fc4ffc27be7a6c724ec0dd36877c5c

--
You are receiving this mail because:
You are on the CC list for the bug.