DescriptionPost-Mutation Event checks must re-check document constraints.
When appending and inserting nodes we check to ensure the author isn't
creating an invalid structure, such as a cycle, a document with
multiple doctypes, and so on. Appending or inserting a node may also
move that node as a convenience, which fires Mutation Events that can
in turn modify the DOM and invalidate the checks. So we perform the
checks a second time. However some checks only depend on the types of
nodes, which are invariant, and so are not repeated. This gives rise
to two similar methods: checkAcceptChild, which runs before Mutation
Events; and checkAcceptChildGuaranteedNodeTypes, which runs after but
skips the invariant checks.
This moves the checks for document nodes to
checkAcceptChildGuaranteedNodeTypes because although apparently based
on the parent node type (document node), the check is actually
structural and dynamic: That the document only has one doctype, one
document element, and so on. This also makes checkAcceptChild more
obviously share code with checkAcceptChildGuaranteedNodeTypes by
simply calling it.
BUG=478302
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=198929
Patch Set 1 #Patch Set 2 : Include future from patch for Issue 509912. #
Total comments: 1
Patch Set 3 : Add doctype, bring to ToT, rebaseline test #Patch Set 4 : Whoops. Insufficient coffee resolving conflicts. #Patch Set 5 : Rebaseline. #
Messages
Total messages: 16 (9 generated)
|