|
|
Chromium Code Reviews
Description[Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks()|
The root cause is we are removing & re-inserting children nodes during
|CompositeEditCommand::removeNodePreservingChildren()|, which means if the child
contains style "* {-webkit-user-modify: read-write;}" we won't be able to re-insert
it back as parent has lost editable attribute as soon as we've removed it.
BUG=675727
Committed: https://crrev.com/3c4ea2111cb111f66c87f8cd6bf3909eeaa15c9b
Cr-Commit-Position: refs/heads/master@{#440459}
Patch Set 1 #Patch Set 2 : xiaochengh's review: Add layout test #
Total comments: 6
Patch Set 3 : Review 2&3: Add bug number to test; Tweak test description #Patch Set 4 : dominicc's suggestion: Use unit test instead of layout test #
Messages
Total messages: 60 (48 generated)
The CQ bit was checked by chongz@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Add null check in DeleteSelectionCommand::removeRedundantBlocks BUG=675727 ========== to ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| |Node::parentNode()| could be null by executing |node.outerHTML = ''|, so we need to do null check before proceeding. BUG=675727 ==========
Description was changed from ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| |Node::parentNode()| could be null by executing |node.outerHTML = ''|, so we need to do null check before proceeding. BUG=675727 ========== to ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| |Node::parentNode()| could be null by executing |node.outerHTML = ''|, so we need to do null check before proceeding. However it's hard to minimize a test case as the one from clusterfuzz is too complex. BUG=675727 ==========
Description was changed from ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| |Node::parentNode()| could be null by executing |node.outerHTML = ''|, so we need to do null check before proceeding. However it's hard to minimize a test case as the one from clusterfuzz is too complex. BUG=675727 ========== to ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| |Node::parentNode()| could be null by executing |node.outerHTML = ''|, so we need to do null check before proceeding. However it's hard to minimize a test case as the one from clusterfuzz is too complex. TEST=https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIMwOlUl-jbFJvxsU97o-VP74cJ4NwaReSV4PBIEE8qZ1q-eGkMGeu3KXCsvHiSiyoIINmpwzPoU6PWiWgqxIY93jkdXQ60TrfwB_pT9xbMtWWmTSTtTLA1Up2mdZotImw?testcase_id=4800242794102784 BUG=675727 ==========
Description was changed from ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| |Node::parentNode()| could be null by executing |node.outerHTML = ''|, so we need to do null check before proceeding. However it's hard to minimize a test case as the one from clusterfuzz is too complex. TEST=https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIMwOlUl-jbFJvxsU97o-VP74cJ4NwaReSV4PBIEE8qZ1q-eGkMGeu3KXCsvHiSiyoIINmpwzPoU6PWiWgqxIY93jkdXQ60TrfwB_pT9xbMtWWmTSTtTLA1Up2mdZotImw?testcase_id=4800242794102784 BUG=675727 ========== to ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| |Node::parentNode()| could be null by executing |node.outerHTML = ''|, so we need to do null check before proceeding. However it's hard to minimize a test case as the one from clusterfuzz is too complex. TEST: https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIM... BUG=675727 ==========
Description was changed from ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| |Node::parentNode()| could be null by executing |node.outerHTML = ''|, so we need to do null check before proceeding. However it's hard to minimize a test case as the one from clusterfuzz is too complex. TEST: https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIM... BUG=675727 ========== to ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| |Node::parentNode()| could be null by executing |node.outerHTML = ''|, so we need to do null check before proceeding. However it's hard to minimize a test case as the one from clusterfuzz is too complex. Minimized Testcase from ClusterFuzz: https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIM... BUG=675727 ==========
Description was changed from ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| |Node::parentNode()| could be null by executing |node.outerHTML = ''|, so we need to do null check before proceeding. However it's hard to minimize a test case as the one from clusterfuzz is too complex. Minimized Testcase from ClusterFuzz: https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIM... BUG=675727 ========== to ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| |Node::parentNode()| could be null by executing |node.outerHTML = ''|, so we need to do null check before proceeding. However it's hard to minimize a test case as the one from clusterfuzz is too complex. Note: Safari has this issue as well. Minimized Testcase from ClusterFuzz: https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIM... BUG=675727 ==========
Description was changed from ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| |Node::parentNode()| could be null by executing |node.outerHTML = ''|, so we need to do null check before proceeding. However it's hard to minimize a test case as the one from clusterfuzz is too complex. Note: Safari has this issue as well. Minimized Testcase from ClusterFuzz: https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIM... BUG=675727 ========== to ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| |Node::parentNode()| could be null by executing |node.outerHTML = ''|, so we need to do null check before proceeding. Note: Safari has this issue as well. Minimized Testcase from ClusterFuzz: https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIM... BUG=675727 ==========
chongz@chromium.org changed reviewers: + xiaochengh@chromium.org
xiaochengh@ PTAL, thanks!
Please add a regression test. A unit test is preferred. The clusterfuzz-minimized test case is not very readable. A good regression test helps us understand the root cause.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by chongz@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| |Node::parentNode()| could be null by executing |node.outerHTML = ''|, so we need to do null check before proceeding. Note: Safari has this issue as well. Minimized Testcase from ClusterFuzz: https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIM... BUG=675727 ========== to ========== [Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks| The root cause is we are removing & re-inserting children nodes during |DeleteSelectionCommand::removeRedundantBlocks()|, which means if the child contains style "* {-webkit-user-modify: read-write;}" we won't be able to re-insert it back as parent has lost editable attribute after removing it. Note: Safari has this issue as well. Minimized Testcase from ClusterFuzz: https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIM... BUG=675727 ==========
Description was changed from
==========
[Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks|
The root cause is we are removing & re-inserting children nodes during
|DeleteSelectionCommand::removeRedundantBlocks()|, which means if the child
contains style "* {-webkit-user-modify: read-write;}" we won't be able to
re-insert
it back as parent has lost editable attribute after removing it.
Note:
Safari has this issue as well.
Minimized Testcase from ClusterFuzz:
https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIM...
BUG=675727
==========
to
==========
[Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks()|
The root cause is we are removing & re-inserting children nodes during
|CompositeEditCommand::removeNodePreservingChildren()|, which means if the child
contains style "* {-webkit-user-modify: read-write;}" we won't be able to
re-insert
it back as parent has lost editable attribute after removing it.
Note:
Safari has this issue as well.
Minimized Testcase from ClusterFuzz:
https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIM...
BUG=675727
==========
Description was changed from
==========
[Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks()|
The root cause is we are removing & re-inserting children nodes during
|CompositeEditCommand::removeNodePreservingChildren()|, which means if the child
contains style "* {-webkit-user-modify: read-write;}" we won't be able to
re-insert
it back as parent has lost editable attribute after removing it.
Note:
Safari has this issue as well.
Minimized Testcase from ClusterFuzz:
https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIM...
BUG=675727
==========
to
==========
[Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks()|
The root cause is we are removing & re-inserting children nodes during
|CompositeEditCommand::removeNodePreservingChildren()|, which means if the child
contains style "* {-webkit-user-modify: read-write;}" we won't be able to
re-insert
it back as parent has lost editable attribute as soon as we've removed it.
Note:
Safari has this issue as well.
Minimized Testcase from ClusterFuzz:
https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIM...
BUG=675727
==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by chongz@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #2 (id:20001) has been deleted
xiaochengh@ I've added a simpler layout test and updated CL description, does that look good to you? I tried to minimized it into a unit test but failed as I'm not very familiar about the details of |DeleteSelectionCommand| and |ApplyStyleCommand|.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
xiaochengh@chromium.org changed reviewers: + dominicc@chromium.org
I agree that it's a little bit tricky to make it a unit test, so lgtm with code change. +dominicc https://codereview.chromium.org/2595783002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/execCommand/justify-center-editable-style-on-child-crash.html (right): https://codereview.chromium.org/2595783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/execCommand/justify-center-editable-style-on-child-crash.html:1: <title>Justify center and remove redounded div wont crash</title> Could you mentioned the bug number in the layout test?
On 2016/12/22 at 03:25:52, Xiaocheng wrote: > I agree that it's a little bit tricky to make it a unit test, so lgtm with code change. > > +dominicc > > https://codereview.chromium.org/2595783002/diff/40001/third_party/WebKit/Layo... > File third_party/WebKit/LayoutTests/editing/execCommand/justify-center-editable-style-on-child-crash.html (right): > > https://codereview.chromium.org/2595783002/diff/40001/third_party/WebKit/Layo... > third_party/WebKit/LayoutTests/editing/execCommand/justify-center-editable-style-on-child-crash.html:1: <title>Justify center and remove redounded div wont crash</title> > Could you mentioned the bug number in the layout test? ClusterFuzz is not accessible by everyone. Could you also remove the link from patch description?
Description was changed from
==========
[Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks()|
The root cause is we are removing & re-inserting children nodes during
|CompositeEditCommand::removeNodePreservingChildren()|, which means if the child
contains style "* {-webkit-user-modify: read-write;}" we won't be able to
re-insert
it back as parent has lost editable attribute as soon as we've removed it.
Note:
Safari has this issue as well.
Minimized Testcase from ClusterFuzz:
https://cluster-fuzz.appspot.com/download/AMIfv94ZvHhjFEVY0tUnt5jhZc6Vj-WRFIM...
BUG=675727
==========
to
==========
[Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks()|
The root cause is we are removing & re-inserting children nodes during
|CompositeEditCommand::removeNodePreservingChildren()|, which means if the child
contains style "* {-webkit-user-modify: read-write;}" we won't be able to
re-insert
it back as parent has lost editable attribute as soon as we've removed it.
Note:
Safari has this issue as well.
BUG=675727
==========
Your change description is really clear, very nice. I don't think you need to mention Safari since this isn't really interesting from a web compatibility perspective. Maybe just comment on the CR bug and include something useful like the Safari version number? +1 to all of xiaochengh's comments. Some more comments of my own inline to improve the test. You mentioned unit testing in was hard; can you upload a WIP patch of what you tried? What in particular was hard? https://codereview.chromium.org/2595783002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/execCommand/justify-center-editable-style-on-child-crash.html (right): https://codereview.chromium.org/2595783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/execCommand/justify-center-editable-style-on-child-crash.html:15: const li = document.getElementsByTagName("li")[0]; If you just do querySelector you'll get the 0th one. https://codereview.chromium.org/2595783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/execCommand/justify-center-editable-style-on-child-crash.html:18: }, 'Justify center and remove redounded div wont crash'); This description needs some work. Is this Justify, center and remove something? If it's a sequence a comma makes it easier to understand that. What is redounded? wont => won't
The CQ bit was checked by chongz@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from
==========
[Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks()|
The root cause is we are removing & re-inserting children nodes during
|CompositeEditCommand::removeNodePreservingChildren()|, which means if the child
contains style "* {-webkit-user-modify: read-write;}" we won't be able to
re-insert
it back as parent has lost editable attribute as soon as we've removed it.
Note:
Safari has this issue as well.
BUG=675727
==========
to
==========
[Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks()|
The root cause is we are removing & re-inserting children nodes during
|CompositeEditCommand::removeNodePreservingChildren()|, which means if the child
contains style "* {-webkit-user-modify: read-write;}" we won't be able to
re-insert
it back as parent has lost editable attribute as soon as we've removed it.
BUG=675727
==========
The CQ bit was checked by chongz@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by chongz@chromium.org to run a CQ dry run
Patchset #3 (id:60001) has been deleted
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #3 (id:80001) has been deleted
The CQ bit was checked by chongz@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
dominicc@ Thanks for the review! I've: 1. Added bug number to layout test; 2. Removed ClusterFuzz link; 3. Removed note about Safari; 4. Upload WIP patch for unit tests https://crrev.com/2599663002 5. Switched to using |querySelector()| 6. Updated description in layout tests PTAL again, thanks! https://codereview.chromium.org/2595783002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/execCommand/justify-center-editable-style-on-child-crash.html (right): https://codereview.chromium.org/2595783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/execCommand/justify-center-editable-style-on-child-crash.html:1: <title>Justify center and remove redounded div wont crash</title> On 2016/12/22 03:25:51, Xiaocheng wrote: > Could you mentioned the bug number in the layout test? Done. https://codereview.chromium.org/2595783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/execCommand/justify-center-editable-style-on-child-crash.html:15: const li = document.getElementsByTagName("li")[0]; On 2016/12/22 03:56:32, dominicc (away 12.23-1.10) wrote: > If you just do querySelector you'll get the 0th one. Done. https://codereview.chromium.org/2595783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/execCommand/justify-center-editable-style-on-child-crash.html:18: }, 'Justify center and remove redounded div wont crash'); On 2016/12/22 03:56:32, dominicc (away 12.23-1.10) wrote: > This description needs some work. Is this Justify, center and remove something? > If it's a sequence a comma makes it easier to understand that. > > What is redounded? > > wont => won't Sorry for the typo... I've added a comment for the redundant <div> and moved description to <title> (Since there is only one test case).
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm LGTM, thank you. Use your judgement about including the unit test. I think you should include it but I could be persuaded either way. You can ignore my comment about the DOM in that unit test; Xiaocheng explained it's simply hand minimized and hand minimization would go no further. That's fine if there's no deeper theory about what's happening in this bug.
The CQ bit was checked by chongz@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2016/12/22 12:11:06, dominicc (away 12.23-1.10) wrote: > lgtm > > LGTM, thank you. > > Use your judgement about including the unit test. I think you should include it > but I could be persuaded either way. > > You can ignore my comment about the DOM in that unit test; Xiaocheng explained > it's simply hand minimized and hand minimization would go no further. That's > fine if there's no deeper theory about what's happening in this bug. Thanks for the review! I don't have a strong opinion between layout tests or unit tests. I've included the unit test given that it's faster and easier to debug.
The CQ bit was checked by chongz@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from xiaochengh@chromium.org, dominicc@chromium.org Link to the patchset: https://codereview.chromium.org/2595783002/#ps120001 (title: "dominicc's suggestion: Use unit test instead of layout test")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 120001, "attempt_start_ts": 1482432603019690,
"parent_rev": "ab2f32a5504f569726f3b85b61b88bc095519190", "commit_rev":
"5a8143410c67c68b0fa60b653453c5b7fea0cfad"}
Message was sent while issue was closed.
Description was changed from
==========
[Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks()|
The root cause is we are removing & re-inserting children nodes during
|CompositeEditCommand::removeNodePreservingChildren()|, which means if the child
contains style "* {-webkit-user-modify: read-write;}" we won't be able to
re-insert
it back as parent has lost editable attribute as soon as we've removed it.
BUG=675727
==========
to
==========
[Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks()|
The root cause is we are removing & re-inserting children nodes during
|CompositeEditCommand::removeNodePreservingChildren()|, which means if the child
contains style "* {-webkit-user-modify: read-write;}" we won't be able to
re-insert
it back as parent has lost editable attribute as soon as we've removed it.
BUG=675727
Review-Url: https://codereview.chromium.org/2595783002
==========
Message was sent while issue was closed.
Committed patchset #4 (id:120001)
Message was sent while issue was closed.
Description was changed from
==========
[Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks()|
The root cause is we are removing & re-inserting children nodes during
|CompositeEditCommand::removeNodePreservingChildren()|, which means if the child
contains style "* {-webkit-user-modify: read-write;}" we won't be able to
re-insert
it back as parent has lost editable attribute as soon as we've removed it.
BUG=675727
Review-Url: https://codereview.chromium.org/2595783002
==========
to
==========
[Editing] Add null check in |DeleteSelectionCommand::removeRedundantBlocks()|
The root cause is we are removing & re-inserting children nodes during
|CompositeEditCommand::removeNodePreservingChildren()|, which means if the child
contains style "* {-webkit-user-modify: read-write;}" we won't be able to
re-insert
it back as parent has lost editable attribute as soon as we've removed it.
BUG=675727
Committed: https://crrev.com/3c4ea2111cb111f66c87f8cd6bf3909eeaa15c9b
Cr-Commit-Position: refs/heads/master@{#440459}
==========
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/3c4ea2111cb111f66c87f8cd6bf3909eeaa15c9b Cr-Commit-Position: refs/heads/master@{#440459} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
