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

Issue 214313002: Don't inherit block style if text is inserted after paragraph selection. (Closed)

Created:
6 years, 9 months ago by Yuta Kitamura
Modified:
6 years, 9 months ago
Reviewers:
yoichio, yosin_UTC9
CC:
blink-reviews
Visibility:
Public.

Description

Don't inherit block style if text is inserted after paragraph selection. It is reported that, under some condition, an unexpected <div> is inserted when text is inserted after a paragraph is selected. This was caused by InsertText::doApply() adjusting the text style according to the current typing style after the insertion. This patch clears block properties from the typing style if the selection ends at the start of a block. Additionally, this patch fixes another issue in DeleteSelectionCommand, which may erroneously insert a placeholder <br> if the return value of VisiblePosition::previous() or next() is a null VisiblePosition. BUG=349531 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170157

Patch Set 1 #

Total comments: 3

Patch Set 2 : Use Selection.collapse(). #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -4 lines) Patch
A LayoutTests/editing/execCommand/insert-text-not-inheriting-block-properties.html View 1 1 chunk +51 lines, -0 lines 0 comments Download
A LayoutTests/editing/execCommand/insert-text-not-inheriting-block-properties-expected.txt View 1 chunk +10 lines, -0 lines 0 comments Download
M Source/core/editing/DeleteSelectionCommand.cpp View 1 chunk +10 lines, -4 lines 0 comments Download
M Source/core/editing/InsertTextCommand.cpp View 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
Yuta Kitamura
6 years, 9 months ago (2014-03-27 06:33:30 UTC) #1
yosin_UTC9
LGTM! TypingStyle is another evil in FrameSelection. It is better to move TypingStyle into Editor ...
6 years, 9 months ago (2014-03-27 07:01:05 UTC) #2
Yuta Kitamura
https://codereview.chromium.org/214313002/diff/1/LayoutTests/editing/execCommand/insert-text-not-inheriting-block-properties.html File LayoutTests/editing/execCommand/insert-text-not-inheriting-block-properties.html (right): https://codereview.chromium.org/214313002/diff/1/LayoutTests/editing/execCommand/insert-text-not-inheriting-block-properties.html#newcode41 LayoutTests/editing/execCommand/insert-text-not-inheriting-block-properties.html:41: range.setStart(container.firstChild.firstChild, 0); // First <span>. On 2014/03/27 07:01:05, Yoshi ...
6 years, 9 months ago (2014-03-27 07:12:35 UTC) #3
Yuta Kitamura
The CQ bit was checked by yutak@chromium.org
6 years, 9 months ago (2014-03-27 07:12:38 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yutak@chromium.org/214313002/20001
6 years, 9 months ago (2014-03-27 07:12:44 UTC) #5
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-27 07:22:20 UTC) #6
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on win_blink_compile_dbg
6 years, 9 months ago (2014-03-27 07:22:21 UTC) #7
Yuta Kitamura
The CQ bit was checked by yutak@chromium.org
6 years, 9 months ago (2014-03-27 07:28:32 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yutak@chromium.org/214313002/20001
6 years, 9 months ago (2014-03-27 07:28:40 UTC) #9
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-27 08:19:05 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on linux_blink_dbg
6 years, 9 months ago (2014-03-27 08:19:05 UTC) #11
Yuta Kitamura
The CQ bit was checked by yutak@chromium.org
6 years, 9 months ago (2014-03-27 08:55:05 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yutak@chromium.org/214313002/20001
6 years, 9 months ago (2014-03-27 08:55:09 UTC) #13
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-27 08:59:06 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on win_blink_rel
6 years, 9 months ago (2014-03-27 08:59:07 UTC) #15
Yuta Kitamura
The CQ bit was checked by yutak@chromium.org
6 years, 9 months ago (2014-03-27 09:00:47 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yutak@chromium.org/214313002/20001
6 years, 9 months ago (2014-03-27 09:00:51 UTC) #17
commit-bot: I haz the power
6 years, 9 months ago (2014-03-27 09:59:55 UTC) #18
Message was sent while issue was closed.
Change committed as 170157

Powered by Google App Engine
This is Rietveld 408576698