Bug 90487

Summary: Autocorrection in blockquotes causes text to break out of quote
Product: WebKit Reporter: Alice Cheng <alice_cheng>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: adele, enrica, mifenton, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
enrica: review-
patch
none
Patch
enrica: review+
patch
none
patch none

Description Alice Cheng 2012-07-03 11:48:14 PDT
Reproduce Steps:
1) have a blockquote with nested stylings in it. Following is an example:
<blockquote type="cite"><font style = "font-family:Arial"><br> would this <b id = "bold"><br></b><b><br></b>make a difference?<span><br></span><span><br></span></font></blockquote>
2) misspell such that auto correction takes place within the block quote. For example, in the id=bold element

Expected Results:
Misspelled words are corrected without breaking out of the quote, without missing white spaces.

Actual Results:
The replaced word appears in another newly inserted blockquote. Sometimes, white spaces are missing due to ReplaceSelectionCommand not working well in blockquote.
Comment 1 Alice Cheng 2012-07-03 11:49:05 PDT
<rdar://problem/11769020>
Comment 2 Alice Cheng 2012-07-03 12:37:59 PDT
Created attachment 150660 [details]
Patch

Fixing the problem and made changes to the previous tests to reflect it.
Comment 3 WebKit Review Bot 2012-07-03 12:41:23 PDT
Attachment 150660 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/platform/mac/editing/spelling/..." exit_code: 1
Source/WebCore/editing/SpellingCorrectionCommand.cpp:36:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Alice Cheng 2012-07-03 15:20:12 PDT
Created attachment 150678 [details]
Patch

Fixed the problem and made changes to the previous test to reflect it.
Comment 5 Enrica Casucci 2012-07-03 17:13:53 PDT
Comment on attachment 150678 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=150678&action=review

You need to have ChangeLog entry both for WebCore and LayoutTests. I'm assuming this is a new test you've added. Run prepare-ChangeLog at the root of your OpenSource tree.

> Source/WebCore/editing/SpellingCorrectionCommand.cpp:38
> +

Remove this unnecessary line
Comment 6 Enrica Casucci 2012-07-03 17:21:18 PDT
You should also consider changing the title of the bug. It is not very intuitive.
Comment 7 Alice Cheng 2012-07-05 10:17:10 PDT
Created attachment 150952 [details]
patch

ChangeLog included, and removed the unnecessary new line.
Comment 8 Alice Cheng 2012-07-05 10:18:13 PDT
changed the summary (title).
Comment 9 WebKit Review Bot 2012-07-05 10:20:07 PDT
Attachment 150952 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1
LayoutTests/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Source/WebCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 2 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 Alice Cheng 2012-07-05 10:26:25 PDT
Created attachment 150953 [details]
Patch

Added bug number
Comment 11 Enrica Casucci 2012-07-09 10:30:58 PDT
Comment on attachment 150953 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=150953&action=review

Looks good to me.

> Source/WebCore/ChangeLog:11
> +        SpellingCorrectionCommand uses ReplaceSelectionCommand to replace the misspelled word with the auto-corrected word. Specifically, ReplaceSelectionCommand does a smart copy, where it breaks out of blockquotes. Thus this patch that replaces ReplaceSelectionCommand with InsertTextCommand will fix the problem

I would change it to: The fix is to substitute ReplaceSelectionCommand with InserTextCommand.
Comment 12 Alice Cheng 2012-07-09 17:11:46 PDT
Created attachment 151361 [details]
patch

Fixed ChangeLog according to review comments.

Posting for commit queue.
Comment 13 Alice Cheng 2012-07-09 17:18:13 PDT
Created attachment 151363 [details]
patch

Fixed ChangeLog according to review comments

posting for commit queue
Comment 14 WebKit Review Bot 2012-07-09 18:25:26 PDT
Comment on attachment 151363 [details]
patch

Clearing flags on attachment: 151363

Committed r122176: <http://trac.webkit.org/changeset/122176>
Comment 15 Alexey Proskuryakov 2020-08-19 15:21:56 PDT
This was landed a long time ago.