New issue
Advanced search Search tips
Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

queryCommandState can return true for both list types

Reported by m...@mikechen.is, Jun 16 2014

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2053.0 Safari/537.36

Steps to reproduce the problem:
1. Create an ordered list nested in an unordered list (or vice versa)
2. Place the cursor in the nested list
3. Query the state of the command "insertOrderedList"
4. Query the state of the command "insertUnorderedList"

What is the expected behavior?
Only one of the queries in steps 3 and 4 should return "true." For example, if an ordered list is nested in an unordered list and you select an ordered list item, only step 3 should return "true."

What went wrong?
Both queries return true. See http://jsfiddle.net/mikechen/U5V65/

This also happens with the invalid list nesting that is created using the "indent" command: http://jsfiddle.net/mikechen/5qfwr/

Did this work before? N/A 

Chrome version: 37.0.2053.0  Channel: canary
OS Version: OS X 10.9.2
Flash Version: Shockwave Flash 14.0 r0

This is a Blink-Editing bug, but I'm unable to add this bug to that category.
 

Comment 1 by meh...@chromium.org, Jun 17 2014

Labels: Cr-Blink-Editing
Labels: -OS-Mac OS-All
Owner: yosin@chromium.org
Status: Available

Comment 3 by yosin@chromium.org, Jun 20 2014

The specification is https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selection's-list-state (still in draft and there comments for handling more cases)

Blink implementation found in |stateOrderedList()| and |stateUnorderedList()| in "core/editing/EditorCommand.cpp". They calls |Editor::selectionOrderedListState()|/|Editor::selectionUnorderedListState()|.

We'll visit this issue again for Editing-In-JS.

Comment 4 by yosin@chromium.org, Aug 28 2014

Labels: Cr-Blink-Editing-Command

Comment 5 by yosin@chromium.org, Aug 15 2015

Owner: ----
Project Member

Comment 6 by sheriffbot@chromium.org, Aug 14 2016

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been available for more than 365 days, and should be re-evaluated. Please re-triage this issue.
The Hotlist-Recharge-Cold label is applied for tracking purposes, and should not be removed after re-triaging the issue.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 7 by bugdroid1@chromium.org, Aug 23 2016

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

commit 9137922eb6ab50e97de5c53a06f553d086d2d862
Author: joone.hur <joone.hur@intel.com>
Date: Tue Aug 23 16:54:33 2016

queryCommandState should consider the nested list

When we run queryCommandState on the nested list,
it only finds the parent list so the nested list is not
considered. This CL allows the command to find the
nested list on the selection.

BUG= 385374 
TEST=editing/execCommand/queryCommandState-list.html

Review-Url: https://codereview.chromium.org/2268843002
Cr-Commit-Position: refs/heads/master@{#413764}

[add] https://crrev.com/9137922eb6ab50e97de5c53a06f553d086d2d862/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-list.html
[modify] https://crrev.com/9137922eb6ab50e97de5c53a06f553d086d2d862/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp

Comment 8 by yosin@chromium.org, Aug 24 2016

Labels: -Hotlist-Recharge-Cold
Status: Available (was: Untriaged)

Comment 9 by joone....@intel.com, Oct 17 2016

Owner: joone....@intel.com
Status: Assigned (was: Available)
Status: Started (was: Assigned)
Status: Fixed (was: Started)

Sign in to add a comment