New issue
Advanced search Search tips

Issue 704458 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

queryCommandValue("stylewithcss") should return an empty string

Project Member Reported by tkent@chromium.org, Mar 23 2017

Issue description

Chrome Version: 59 canary
OS: All but iOS

What steps will reproduce the problem?
(1) Open any page, including NTP
(2) Open DevTools
(3) Type the following and ENTER in the console.
    document.queryCommandValue("stylewithcss")

What is the expected result?
It always show ""

What happens instead?
It shows "false" or "true".

Please use labels and text to provide additional information.

According to the non-supported draft [1], styleWithCSS command doesn't have "value", and Firefox and Edge work so. Our implementation looks to be confused with "value" and "state".


EditorCommand.cpp:
      {WebEditingCommandType::StyleWithCSS, executeStyleWithCSS, supported,
       enabled, stateStyleWithCSS, valueNull, notTextInsertion,
       doNotAllowExecutionWhenDisabled},

String Editor::Command::value(Event* triggeringEvent) const {
  if (!isSupported() || !m_frame)
    return String();
  if (m_command->value == valueNull && m_command->state != stateNone)
    return m_command->state(*m_frame, triggeringEvent) == TrueTriState
               ? "true"
               : "false";
  return m_command->value(*m_frame, triggeringEvent);
}

[1] https://w3c.github.io/editing/execCommand.html#the-stylewithcss-command
 

Comment 1 by tkent@chromium.org, Mar 23 2017

Description: Show this description
Project Member

Comment 2 by bugdroid1@chromium.org, Mar 24 2017

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

commit 57c2207020be6758153102c90902b4b49781744e
Author: tkent <tkent@chromium.org>
Date: Fri Mar 24 01:20:14 2017

Editing: queryCommandValue("stylewithcss") should always return an empty string.

The new behavior is compatible with Firefox and Edge.
This CL fixes 4,622 tests in external/wpt/editing/.

BUG= 704458 

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

[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/editing/editability/empty-document-stylewithcss.html
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/editing/execCommand/reset-values-after-navigation-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/editing/execCommand/reset-values-after-navigation.html
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/editing/execCommand/style-with-css-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/editing/execCommand/style-with-css.html
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/backcolor-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/bold-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/fontname-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/fontsize-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/forecolor-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/formatblock-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/forwarddelete-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/hilitecolor-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/indent-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/inserthorizontalrule-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/inserthtml-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/insertimage-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/insertlinebreak-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/insertorderedlist-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/insertparagraph-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/inserttext-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/insertunorderedlist-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/justifycenter-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/justifyfull-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/justifyleft-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/justifyright-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/misc-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/outdent-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/external/wpt/editing/run/removeformat-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/platform/mac/external/wpt/editing/run/italic-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/platform/mac/external/wpt/editing/run/strikethrough-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/platform/mac/external/wpt/editing/run/subscript-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/platform/mac/external/wpt/editing/run/superscript-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/platform/mac/external/wpt/editing/run/underline-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/platform/win/external/wpt/editing/run/bold-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/platform/win/external/wpt/editing/run/italic-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/platform/win/external/wpt/editing/run/justifycenter-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/platform/win/external/wpt/editing/run/justifyfull-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/platform/win/external/wpt/editing/run/justifyright-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/platform/win/external/wpt/editing/run/strikethrough-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/platform/win/external/wpt/editing/run/subscript-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/platform/win/external/wpt/editing/run/superscript-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/LayoutTests/platform/win/external/wpt/editing/run/underline-expected.txt
[modify] https://crrev.com/57c2207020be6758153102c90902b4b49781744e/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp

Comment 3 by tkent@chromium.org, Mar 24 2017

Labels: M-59
Status: Fixed (was: Started)

Sign in to add a comment