Summary: | Null dereference loading Blink layout test editing/execCommand/indent-no-visible-contents-crash.html | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Jon Honeycutt <jhoneycutt> | ||||||||||
Component: | HTML Editing | Assignee: | Jiewen Tan <jiewen_tan> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | achristensen, commit-queue, jiewen_tan, webkit-bug-importer | ||||||||||
Priority: | P2 | Keywords: | BlinkMergeCandidate, HasReduction, InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Attachments: |
|
Description
Jon Honeycutt
2015-09-17 14:36:06 PDT
Created attachment 261427 [details]
crashing test
*** Bug 149293 has been marked as a duplicate of this bug. *** Created attachment 263629 [details]
Patch
Created attachment 263630 [details]
Patch
Comment on attachment 263630 [details]
Patch
Why does this fix the crash? Why don't we add checks before all the other calls to moveParagraphWithClones?
(In reply to comment #6) > Comment on attachment 263630 [details] > Patch > > Why does this fix the crash? Why don't we add checks before all the other > calls to moveParagraphWithClones? Quote from Blink review: "Don't try to move non visible contents in "Indent" command This patch makes "Indent" command not to try move non visible contents into block quote. The root cause of issue 343958 is "Indent" command calls |moveParagraphWithClones()| with null |VisiblePosition| for start and end of contents to move. This patch checks them before calling |moveParagraphWithClones()|." I don't know whether other functions/methods who call moveParagraphWithClones() will have the same problem. Certainly, this test case doesn't reveal all other possibilities. I think it will be good to keep this change now. We can add the check later on if any new bug reports come in for different function. Maybe I should add assertions at the beginning of moveParagraphWithClones()? Comment on attachment 263630 [details]
Patch
I think a better fix would be to add an early return in CompositeEditCommand::cloneParagraphUnderNewElement if !passedOuterNode.
Created attachment 264055 [details]
Patch
This is a more generic fix than the blink fix because it catches all calls to moveParagraphWithClones Comment on attachment 264055 [details] Patch Clearing flags on attachment: 264055 Committed r191596: <http://trac.webkit.org/changeset/191596> All reviewed patches have been landed. Closing bug. |