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, valueNo, 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
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