<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:rniwa@webkit.org" title="Ryosuke Niwa <rniwa@webkit.org>"> <span class="fn">Ryosuke Niwa</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - Need to updateEditorState if an element change edit-ability without changing selection"
href="https://bugs.webkit.org/show_bug.cgi?id=161546">bug 161546</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #287811 Flags</td>
<td>review?
</td>
<td>review+
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Need to updateEditorState if an element change edit-ability without changing selection"
href="https://bugs.webkit.org/show_bug.cgi?id=161546#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Need to updateEditorState if an element change edit-ability without changing selection"
href="https://bugs.webkit.org/show_bug.cgi?id=161546">bug 161546</a>
from <span class="vcard"><a class="email" href="mailto:rniwa@webkit.org" title="Ryosuke Niwa <rniwa@webkit.org>"> <span class="fn">Ryosuke Niwa</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=287811&action=diff" name="attach_287811" title="Patch">attachment 287811</a> <a href="attachment.cgi?id=287811&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=287811&action=review">https://bugs.webkit.org/attachment.cgi?id=287811&action=review</a>
r=me assuming you fix builds & tests and stuff.
<span class="quote">> Source/WebCore/editing/FrameSelection.cpp:2386
> + client->updateEditorStateAfterLayoutIfNeeded();</span >
Instead of saying IfNeeded, can we explicitly say IfEditabilityChanged to make semantics clear?
<span class="quote">> Source/WebCore/page/EditorClient.h:187
> +
> + virtual void updateEditorStateAfterLayoutIfNeeded() = 0;</span >
We should add this right at where didChangeSelectionAndUpdateLayout is declared.
<span class="quote">> Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp:557
> +void WebEditorClient::updateEditorStateAfterLayoutIfNeeded()
> +{
> + m_page->updateEditorStateAfterLayoutIfNeeded();
> +}
> +</span >
Ditto about defining this next to didChangeSelectionAndUpdateLayout.
<span class="quote">> Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h:172
> + void updateEditorStateAfterLayoutIfNeeded() final;
> +</span >
Ditto about the location.
<span class="quote">> Source/WebKit2/WebProcess/WebPage/WebPage.cpp:910
> + EditorStateIsContentEditable editorStateIsContentEditable = frame.selection().selection().isContentEditable() ? EditorStateIsContentEditable::Yes : EditorStateIsContentEditable::No;</span >
This doesn't detect the case when the value changes between plaintextonly and true.
It's probably not a big deal but you can check that condition by checking both isContentEditable and isContentRichlyEditable.
You might wanna add FIXME for now.
<span class="quote">> Source/WebKit2/WebProcess/WebPage/WebPage.h:1479
> + EditorStateIsContentEditable m_lastEditorStateWasContentEditable { EditorStateIsContentEditable::Unset };</span >
Should we just make this mutable instead of removing const from editorState?</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>