New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 628229 link

Starred by 5 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

document.execCommand("outdent") behaving strangely if selection is partial

Project Member Reported by torne@chromium.org, Jul 14 2016

Issue description

Ported from internal bugtracker:

In a certain HTML, document.execCommand("outdent") moves the selection up above its <blockquote> parent.

REPRO STEPS:
1. Go to https://jsfiddle.net/44m3q6xj/2/
2. Select the line that says "Outdent me!!!!"
3. Press the OUTDENT button
4. That outdents correctly ("Outdent me!!!!" line is between "first line" and "third line")
5. Press the OUTDENT button again. Make sure the selection still is on the "Outdent me!!!!" line
6. BUG: The "Outdent me!!!!" is moved *above* "first line" instead of below

Is this WAI? or bug?

ADDITIONAL INFO:
Repros on:
1. Chrome on linux (51.0.2704.106 (64-bit))
2. Android Chrome 51.0.2704.81, 44.0.2403.633 
3. WebView 51.0.2704.81, 44.0.2403.117
 

Comment 1 by yosin@chromium.org, Jul 15 2016

Status: Available (was: Untriaged)
Project Member

Comment 2 by sheriffbot@chromium.org, Jul 17 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Summary: document.execCommand("outdent") behaving strangely if selection is partial (was: document.execCommand("outdent") behaving strangely)
If I select all, it works.
Status: Available (was: Untriaged)
Project Member

Comment 5 by bugdroid1@chromium.org, Feb 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fa3098e3f6b7231aeed5cd704597562f7298f821

commit fa3098e3f6b7231aeed5cd704597562f7298f821
Author: tanvir.rizvi <tanvir.rizvi@samsung.com>
Date: Fri Feb 09 09:43:16 2018

Use proper node to split tree for outdent command.

Nested blockquote on outdent command gives wrong result,
as the splitTreeToNode is done on wrong node.
If there are nested blockquotes and a partial selection
is made, then blockquotes get separated,
making the tree to split on wrong node.

This CL makes outdent command to work on correct node.
If the nested block quotes are present
with selection done partially,then we should split tree based
on the scope of the selection anchor node.

Bug: 628229
Change-Id: Icc0c39e6f3502b2014aa1be932fe14b6b54168bd
Reviewed-on: https://chromium-review.googlesource.com/903663
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Tanvir Rizvi <tanvir.rizvi@samsung.com>
Cr-Commit-Position: refs/heads/master@{#535675}
[add] https://crrev.com/fa3098e3f6b7231aeed5cd704597562f7298f821/third_party/WebKit/LayoutTests/editing/execCommand/outdent/nested_blockquotes_on_partial_selection.html
[modify] https://crrev.com/fa3098e3f6b7231aeed5cd704597562f7298f821/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp

Sign in to add a comment