Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Issue 1237623006: Post-Mutation Event checks must re-check document constraints. (Closed)

Created:
5 years, 5 months ago by dominicc (has gone to gerrit)
Modified:
5 years, 5 months ago
Reviewers:
esprehn
CC:
blink-reviews, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Post-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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -28 lines) Patch
M LayoutTests/fast/dom/DOMException/prototype-object.html View 1 2 chunks +2 lines, -3 lines 0 comments Download
M LayoutTests/fast/dom/DOMException/prototype-object-expected.txt View 1 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/dom/DOMException/stack-trace.html View 1 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/dom/DOMException/stack-trace-expected.txt View 1 1 chunk +2 lines, -2 lines 0 comments Download
A LayoutTests/fast/dom/append-multiple-document-elements.html View 1 2 1 chunk +19 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/append-multiple-document-elements-expected.txt View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/ContainerNode.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/ContainerNode.cpp View 1 2 3 3 chunks +10 lines, -18 lines 0 comments Download

Messages

Total messages: 16 (9 generated)
esprehn
lgtm https://codereview.chromium.org/1237623006/diff/20001/LayoutTests/fast/dom/append-multiple-document-elements.html File LayoutTests/fast/dom/append-multiple-document-elements.html (right): https://codereview.chromium.org/1237623006/diff/20001/LayoutTests/fast/dom/append-multiple-document-elements.html#newcode1 LayoutTests/fast/dom/append-multiple-document-elements.html:1: <body> Add a DOCTYPE unless this test needs ...
5 years, 5 months ago (2015-07-14 07:29:17 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1237623006/40001
5 years, 5 months ago (2015-07-14 22:25:37 UTC) #5
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/linux_chromium_gn_rel/builds/41359) (exceeded global retry quota)
5 years, 5 months ago (2015-07-14 22:37:10 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1237623006/60001
5 years, 5 months ago (2015-07-15 00:16:52 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/mac_blink_rel/builds/62908) (exceeded global retry quota)
5 years, 5 months ago (2015-07-15 01:36:15 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1237623006/80001
5 years, 5 months ago (2015-07-15 04:37:44 UTC) #15
commit-bot: I haz the power
5 years, 5 months ago (2015-07-15 05:49:50 UTC) #16
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=198929

Powered by Google App Engine
This is Rietveld 408576698