New perf dashboard should provide UI to create a new analysis task
https://bugs.webkit.org/show_bug.cgi?id=138910

Reviewed by Benjamin Poulain.

This patch reverts some parts of r175006 and re-introduces bugs associated with analysis tasks.
I'll add UI to show and edit bug numbers associated with an analysis task in a follow up patch.

With this patch, we can create a new analysis task by selection a range of points and opening
"analysis pane" (renamed from "bugs pane"). Each analysis task created is represented by a yellow bar
in the chart hyperlinked to the analysis task.

* init-database.sql: Redefined the bugs to be associated with an analysis task instead of a test run.

* public/api/analysis-tasks.php: Added the support for querying analysis tasks for a specific metric
on a specific platform. Also retrieve and return all bugs associated with analysis tasks.
(main):
(fetch_and_push_bugs_to_tasks): Added. Fetches all bugs associated with an array of analysis tasks
and adds the associated bugs to each task in the array.
(format_task):

* public/api/runs.php: Reverted changes made in r175006.
(fetch_runs_for_config):
(format_run): 

* public/api/test-groups.php:
(fetch_test_groups_for_task): Use the newly added Database::select_rows.

* public/include/db.php:
(Database::select_first_or_last_row):
(Database::select_rows): Extracted from select_first_or_last_row.

* public/v2/analysis.js:
(App.AnalysisTask): Added "bugs" property.
(App.Bug): Added now that bugs are regular data store objects.

* public/v2/app.js:
(App.Pane._fetch): Calls this.fetchAnalyticRanges to fetch analysis tasks as well as test runs.
(App.Pane.fetchAnalyticRanges): Added. Fetches analysis tasks for the current metric on the current
platform that are associated with a specific range of runs.
(App.PaneController.actions.toggleBugsPane): Updated per showingBugsPane to showingAnalysisPane rename.
(App.PaneController.actions.associateBug): Deleted.
(App.PaneController.actions.createAnalysisTask): Replaced the pre-condition checks with assertions as
this action should never be triggered when the pre-condition is not met. Also re-fetch analysis tasks
once we've created one.
(App.PaneController.toggleSearchPane): Updated per showingBugsPane to showingAnalysisPane rename.
(App.PaneController._detailsChanged): Ditto. Removed selectedSinglePoint since it's no longer used.
(App.PaneController._showDetails): Call _updateCanAnalyze to update the status of "Analyze" button.
(App.PaneController._updateBugs): Deleted.
(App.PaneController._updateMarkedPoints): Deleted.
(App.PaneController._updateCanAnalyze): Added. Disables the button to create an analysis task when
the name is missing or when at most one point is selected.
        
(App.InteractiveChartComponent._constructGraphIfPossible): Update the locations of range rects.
(App.InteractiveChartComponent._relayoutDataAndAxes): Ditto.
(App.InteractiveChartComponent._mousePointInGraph): Don't return a point unless the mouse cursor is
on our svg element to avoid locking the current item when a bar shown for an analysis task is clicked.
(App.InteractiveChartComponent._rangesChanged): Added. Creates an array of objects representing
clickable bars for analysis tasks.
(App.InteractiveChartComponent._updateRangeBarRects): Computes the inline style used by each clickable
bar for analysis tasks to place them at the right location.
(App.InteractiveChartComponent.actions.openRange): Added. Forwards the action to the parent controller.

* public/v2/chart-pane.css:
(.chart .extent): Use the same color as the vertical indicator in the highlight behind the selection.
(.chart .rangeBar): Added.

* public/v2/data.js:
(TimeSeries.prototype.nextPoint): Added. Used by _rangesChanged.

* public/v2/index.html: Renamed "bugs pane" to "analysis pane" and removed the UI to associate bugs.
This ability will be reinstated in a follow up patch. Also added a container div and spans for analysis
task bars in the interactive chart component.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support unprefixed animation event types
https://bugs.webkit.org/show_bug.cgi?id=138931
<rdar://problem/18943167>

Reviewed by Simon Fraser.

Source/WebCore:

Tests: animations/unprefixed-events-mixed-with-prefixed.html
       animations/unprefixed-events.html

Support the unprefixed animation event names:
- animationstart (was webkitAnimationStart)
- animationiteration (was webkitAnimationIteration)
- animationend (was webkitAnimationEnd)

(Yes, event types are case sensitive and yes, this will
likely cause some head-scratching as people change content)

The approach here is to follow what transitions does:
- listener only for old event name -> fire old event name
- listener for both old and new event name -> fire new event name
- listener only for new event name -> fire new event name

That way pages that were trying to anticipate the new event name
won't get duplicate events.

* CMakeLists.txt: Add new AnimationEvent* stuff.
* DerivedSources.make: Ditto.
* WebCore.vcxproj/WebCore.vcxproj: Ditto.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.

* bindings/js/JSBindingsAllInOne.cpp: New files for all in one builds.
* dom/DOMAllInOne.cpp:

* dom/AnimationEvent.cpp: Added. Copied from WebKitAnimationEvent.cpp.
(WebCore::AnimationEventInit::AnimationEventInit):
(WebCore::AnimationEvent::AnimationEvent):
(WebCore::AnimationEvent::~AnimationEvent):
(WebCore::AnimationEvent::animationName):
(WebCore::AnimationEvent::elapsedTime):
(WebCore::AnimationEvent::eventInterface):
* dom/AnimationEvent.h: Added. Copied from WebKitAnimationEvent.h.
* dom/AnimationEvent.idl: Added. Copied from WebKitAnimationEvent.idl.

* dom/Document.cpp:
(WebCore::Document::addListenerTypeIfNeeded): Handle new event types.

* dom/EventNames.h: New names.
* dom/EventNames.in:

* dom/EventTarget.cpp:
(WebCore::legacyType): Provide a mapping from the new names to the older
prefixed forms.

* html/HTMLAttributeNames.in: Support the on* attributes, even though I
hate them and wish this approach would die.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::populateEventNameForAttributeLocalNameMap):

* page/DOMWindow.h: New names, and constructors.
* page/DOMWindow.idl:

* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle): Fire new type.

* page/animation/KeyframeAnimation.cpp: Fire the new types of events.
(WebCore::KeyframeAnimation::onAnimationStart):
(WebCore::KeyframeAnimation::onAnimationIteration):
(WebCore::KeyframeAnimation::onAnimationEnd):
(WebCore::KeyframeAnimation::sendAnimationEvent):

LayoutTests:

Add a test for unprefixed animation event names, as well
as a test that ensures we don't get multiple dispatches if
we're still listening for the old events.

And for the older tests, just add the new things from the
window namespace.

* animations/unprefixed-events-expected.txt: Added.
* animations/unprefixed-events-mixed-with-prefixed-expected.txt: Added.
* animations/unprefixed-events-mixed-with-prefixed.html: Added.
* animations/unprefixed-events.html: Added.

* fast/events/event-creation-expected.txt:
* fast/events/event-creation.html:
* js/dom/constructor-length.html:
* js/dom/global-constructors-attributes-expected.txt:
* platform/efl/js/dom/constructor-length-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/constructor-length-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-mountainlion/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/constructor-length-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176423 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add Heap verification infrastructure.
<https://webkit.org/b/138851>

Reviewed by Geoffrey Garen.

The verification infrastructure code is always built in but disabled by
default.  When disabled, the cost is minimal:
1. Heap has a m_verifier field.
2. GC does a few "if (m_verifier)" checks that should fail.
3. HeapVerifier takes up code space though not used.

When enabled:
1. The HeapVerifier will keep N number of GC cycle data.
   Each GC cycle will contain a "before marking" and "after marking" live
   object list.
   The GC cycles is a circular buffer.  Only data for the last N GC cycles
   will be retained.
2. During GC, the current GC cycle's live objects lists will be populated
   before and after marking.
3. The current GC cycle's live object lists will be validated before GC,
   after marking, and after GC.

Currently, the only validation being done is to verify that object
butterflies are allocated from valid blocks in the Storage (aka Copied)
space.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::collect):
* heap/Heap.h:
* heap/HeapVerifier.cpp: Added.
(JSC::LiveObjectList::findObject):
(JSC::HeapVerifier::HeapVerifier):
(JSC::HeapVerifier::collectionTypeName):
(JSC::HeapVerifier::phaseName):
(JSC::getButterflyDetails):
(JSC::HeapVerifier::initializeGCCycle):
(JSC::GatherLiveObjFunctor::GatherLiveObjFunctor):
(JSC::GatherLiveObjFunctor::operator()):
(JSC::HeapVerifier::gatherLiveObjects):
(JSC::HeapVerifier::liveObjectListForGathering):
(JSC::trimDeadObjectsFromList):
(JSC::HeapVerifier::trimDeadObjects):
(JSC::HeapVerifier::verifyButterflyIsInStorageSpace):
(JSC::HeapVerifier::verify):
(JSC::HeapVerifier::reportObject):
(JSC::HeapVerifier::checkIfRecorded):
* heap/HeapVerifier.h: Added.
(JSC::LiveObjectData::LiveObjectData):
(JSC::LiveObjectList::LiveObjectList):
(JSC::LiveObjectList::reset):
(JSC::HeapVerifier::GCCycle::GCCycle):
(JSC::HeapVerifier::GCCycle::collectionTypeName):
(JSC::HeapVerifier::incrementCycle):
(JSC::HeapVerifier::currentCycle):
(JSC::HeapVerifier::cycleForIndex):
* runtime/Options.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add some comments to describe the DFG UseKind representations.
<https://webkit.org/b/138934>

Reviewed by Filip Pizlo.

* dfg/DFGUseKind.h:
- Also regrouped the UseKind enums by representation to be more readable.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clients should be able to customize preview click behavior
https://bugs.webkit.org/show_bug.cgi?id=138940

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKViewPrivate.h:
Declare -_handleClickInPreviewView:URL:.

* UIProcess/API/mac/WKView.mm:
(-[WKView _handleClickInPreviewView:URL:]):
Extracted from -[WKActionMenuController pagePreviewViewControllerWasClicked:].

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController pagePreviewViewControllerWasClicked:]):
Extract code to -[WKView _handleClickInPreviewView:URL:].

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clicks on previews can be recognized multiple times
https://bugs.webkit.org/show_bug.cgi?id=138944

Reviewed by Tim Horton.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKPagePreviewViewController _clickRecognized:]):
Only dispatch the delegate message on the appropriate gesture recognizer state transition.

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