<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - execCommand('underline') does not 'toggle' value returned by subsequent call to queryCommandState('underline') when content is underlined and no selection is made."
href="https://bugs.webkit.org/show_bug.cgi?id=158115">158115</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>execCommand('underline') does not 'toggle' value returned by subsequent call to queryCommandState('underline') when content is underlined and no selection is made.
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>Safari 9
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>Bindings
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jhargreaves4@bloomberg.net
</td>
</tr>
<tr>
<th>CC</th>
<td>cdumez@apple.com
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=279878" name="attach_279878" title="bug_demo">attachment 279878</a> <a href="attachment.cgi?id=279878&action=edit" title="bug_demo">[details]</a></span>
bug_demo
When using the attribute 'contenteditable=true' on an element, if said element in underlined and no selection is made,
a call to execCommand('underline') will not result in the value returned by 'queryCommandState('underline')' to be 'toggled' from true to false and vice versa;
this behavior is inconsistent with the behavior of 'execCommand('bold')', 'execCommand('italic')' for example, where the relevant command states
are in fact toggled.
The attached demo will behave differently in chrome when compared to safari. (clicking toggle underline does toggled the state in chrome).
I believe this bug to be the inverse of this bug: <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - queryCommandState returns false for Underline command when no selection is made"
href="show_bug.cgi?id=17594">https://bugs.webkit.org/show_bug.cgi?id=17594</a>
As far as I'm aware this is a bug, but please forgive me if it's desired behavior?
Bug is at least present on IOS 9.2 and Safari 9 on Mac. I have not had time to test other platforms.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>