WebKit's focus events are UIEvents (instead of FocusEvent) and thus don't expose .relatedTarget
https://bugs.webkit.org/show_bug.cgi?id=76216

Reviewed by Eric Seidel.

Spec: http://www.w3.org/TR/DOM-Level-3-Events/#events-FocusEvent

This patch creates a new FocusEvent class with a relatedTarget attribute.
Now when focusin or focusout events are dispatched, a FocusEvent is created with
the relatedTarget attribute set accordingly.

Source/WebCore:

Test: fast/events/related-target-focusevent.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/Event.cpp:
(WebCore::Event::isFocusEvent):
(WebCore):
* dom/Event.h:
(Event):
* dom/EventContext.cpp:
(WebCore::EventContext::handleLocalEvents):
* dom/EventNames.in:
* dom/FocusEvent.h: Added.
(WebCore):
(FocusEvent):
(WebCore::FocusEvent::create):
(WebCore::FocusEvent::relatedTarget):
(WebCore::FocusEvent::setRelatedTarget):
(WebCore::toFocusEvent):
* dom/FocusEvent.idl: Added.
* dom/Node.cpp:
(WebCore::Node::dispatchFocusInEvent):
(WebCore::Node::dispatchFocusOutEvent):

LayoutTests:

* fast/dom/shadow/shadow-boundary-events-expected.txt:
* fast/dom/shadow/shadow-boundary-events.html:
* fast/events/related-target-focusevent-expected.txt: Added.
* fast/events/related-target-focusevent.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] Fold QtWebPageFindClient into QQuickWebViewPrivate
https://bugs.webkit.org/show_bug.cgi?id=108920

Reviewed by Jocelyn Turcotte, signed off for WK2 by Benjamin.

Employ the pattern suggested by Jocelyn to simply implement the C
callbacks directly using static functions.

* Target.pri:
* UIProcess/API/qt/qquickwebview.cpp:
(toQQuickWebViewPrivate):
(QQuickWebViewPrivate::initialize):
(QQuickWebViewPrivate::didFindString):
(QQuickWebViewPrivate::didFailToFindString):
* UIProcess/API/qt/qquickwebview_p_p.h:
(QQuickWebViewPrivate):
* UIProcess/qt/QtWebPageFindClient.cpp: Removed.
* UIProcess/qt/QtWebPageFindClient.h: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142073 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Native Memory Instrumentation: reduce native heap snapshot runtime memory footprint
https://bugs.webkit.org/show_bug.cgi?id=108824

Reviewed by Yury Semikhatsky.

New event was added into Memory domain addNativeSnapshotChunk.
The content of HeapGraphSerializer is completely rewritten according to new API.
Now it collects strings, nodes, edges and id2id map and pushes when the collected items count exceed a limit.
On the frontend side I added new method for the new event and fixed the postprocessing step.
MemoryInstrumentation was slightly changed. Now it reports base to real address map only after reporting the node with real address.

* inspector/HeapGraphSerializer.cpp:
(WebCore::HeapGraphSerializer::HeapGraphSerializer):
(WebCore::HeapGraphSerializer::pushUpdateIfNeed):
(WebCore):
(WebCore::HeapGraphSerializer::pushUpdate):
(WebCore::HeapGraphSerializer::reportNode):
(WebCore::HeapGraphSerializer::reportNodeImpl):
(WebCore::HeapGraphSerializer::reportEdge):
(WebCore::HeapGraphSerializer::reportEdgeImpl):
(WebCore::HeapGraphSerializer::reportLeaf):
(WebCore::HeapGraphSerializer::reportBaseAddress):
(WebCore::HeapGraphSerializer::finish):
(WebCore::HeapGraphSerializer::reportMemoryUsage):
(WebCore::HeapGraphSerializer::addString):
(WebCore::HeapGraphSerializer::toNodeId):
(WebCore::HeapGraphSerializer::addRootNode):
* inspector/HeapGraphSerializer.h:
(HeapGraphSerializer):
* inspector/Inspector.json:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::processMemoryDistribution):
* inspector/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::getProcessMemoryDistributionMap):
(WebCore):
(WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
(WebCore::InspectorMemoryAgent::getProcessMemoryDistributionImpl):
(WebCore::InspectorMemoryAgent::setFrontend):
(WebCore::InspectorMemoryAgent::clearFrontend):
* inspector/InspectorMemoryAgent.h:
(InspectorMemoryAgent):
* inspector/front-end/NativeHeapSnapshot.js:
(WebInspector.NativeHeapSnapshot):
(WebInspector.NativeHeapSnapshotNode.prototype.classIndex):
(WebInspector.NativeHeapSnapshotNode.prototype.id):
(WebInspector.NativeHeapSnapshotNode.prototype.name):
(WebInspector.NativeHeapSnapshotNode.prototype.serialize):
* inspector/front-end/NativeMemorySnapshotView.js:
(WebInspector.NativeSnapshotProfileType.prototype.buttonClicked.didReceiveMemorySnapshot):
(WebInspector.NativeSnapshotProfileType.prototype.buttonClicked):
(WebInspector.NativeSnapshotProfileHeader):
(WebInspector.NativeSnapshotProfileHeader.prototype.startSnapshotTransfer):
(WebInspector.NativeSnapshotProfileHeader.prototype.addNativeSnapshotChunk):
(WebInspector.NativeMemoryProfileType.prototype.buttonClicked.didReceiveMemorySnapshot):
(WebInspector.NativeMemoryProfileType.prototype.buttonClicked):
(WebInspector.NativeMemoryBarChart.prototype._updateStats):
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel):
(WebInspector.MemoryDispatcher):
(WebInspector.MemoryDispatcher.prototype.addNativeSnapshotChunk):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142074 268f45cc-cd09-0410-ab3c-d52691b4dbfc