Focus events can cause the current focused node to be cleared, resulting in a nullptr deref. Let's fix this!
<rdar://problem/34138402>
Created attachment 322748 [details] Patch
Comment on attachment 322748 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=322748&action=review Can we write a test for this change? > Source/WebCore/dom/Document.cpp:3864 > + // Focus change can run script, changing the node. Can you please elaborate on what script/DOM event is dispatched by calling setFocus()? > Source/WebCore/dom/Document.cpp:3865 > + if (!m_focusedElement || m_focusedElement != newFocusedElement) { Is the first disjunct necessary?
Comment on attachment 322748 [details] Patch Attachment 322748 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/4762529 New failing tests: workers/wasm-long-compile.html
Created attachment 322779 [details] Archive of layout-test-results from ews114 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Comment on attachment 322748 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=322748&action=review >> Source/WebCore/dom/Document.cpp:3864 >> + // Focus change can run script, changing the node. > > Can you please elaborate on what script/DOM event is dispatched by calling setFocus()? Yes. I've got a reduced test case now, and I'll add some comments. >> Source/WebCore/dom/Document.cpp:3865 >> + if (!m_focusedElement || m_focusedElement != newFocusedElement) { > > Is the first disjunct necessary? Probably not. I'll remove it.
Created attachment 322880 [details] Patch
Comment on attachment 322880 [details] Patch Clearing flags on attachment: 322880 Committed r223028: <http://trac.webkit.org/changeset/223028>
All reviewed patches have been landed. Closing bug.
<rdar://problem/34874846>