Code clean up: Move Rotater function closer to Stage static methods.
[WebKit-https.git] / PerformanceTests / ChangeLog
1 2016-02-06  Jon Lee  <jonlee@apple.com>
2
3         Code clean up: Move Rotater function closer to Stage static methods.
4         The Rotater is used together with those methods; keep them close.
5
6         * Animometer/tests/resources/main.js:
7
8 2016-02-06  Jon Lee  <jonlee@apple.com>
9
10         Update the JS includes due to ResultsTable move.
11
12         * Animometer/developer.html:
13         * Animometer/index.html:
14
15 2016-02-06  Jon Lee  <jonlee@apple.com>
16
17         Move createElement and createSVGElement to Utilities.
18
19         * Animometer/resources/extensions.js:
20         (Utilities.createElement): Added.
21         (Utilities.createSVGElement): Added.
22         (DocumentExtension.createElement): Deleted.
23         (DocumentExtension.createSvgElement): Deleted.
24
25         * Animometer/resources/debug-runner/animometer.js:
26         * Animometer/resources/runner/animometer.js:
27         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
28         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
29         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
30
31 2016-02-06  Jon Lee  <jonlee@apple.com>
32
33         Add a convenience function for creating a class.
34
35         The pattern for creating a class is common enough to add as a Utilities
36         helper function. It also makes it easy to collapse class definitions when
37         editing.
38
39         * Animometer/resources/debug-runner/animometer.js: Move ProgressBar definition,
40         since it is only used here.
41         * Animometer/resources/runner/animometer.js: Move ResultsDashboard and
42         ResultsTable definition, since it is only used here.
43         * Animometer/resources/extensions.js: Move Utilities definition to the top. Convert
44         Point, Insets, SimplePromise.
45         (ProgressBar): Moved to animometer.js.
46         (ResultsDashboard): Moved to animometer.js.
47         (ResultsTable): Moved to animometer.js.
48         * Animometer/resources/runner/benchmark-runner.js: Convert BenchmarkRunnerState,
49         BenchmarkRunner.
50         * Animometer/tests/resources/main.js: Convert Rotater, Stage, Animator, Benchmark.
51         * Animometer/tests/resources/sampler.js: Convert Experiment, Sampler.
52
53         Convert test primitives.
54         * Animometer/tests/master/resources/canvas-tests.js: Convert CanvasLineSegment,
55         CanvasArc, CanvasLinePoint.
56         * Animometer/tests/simple/resources/simple-canvas-paths.js: Convert CanvasLineSegment,
57         CanvasLinePoint, CanvasQuadraticSegment, CanvasQuadraticPoint, CanvasBezierSegment,
58         CanvasBezierPoint, CanvasArcToSegment, CanvasArcToSegmentFill, CanvasArcSegment,
59         CanvasArcSegmentFill, CanvasRect, CanvasRectFill.
60         * Animometer/tests/simple/resources/tiled-canvas-image.js: Convert CanvasImageTile.
61
62 2016-02-06  Jon Lee  <jonlee@apple.com>
63
64         Minor improvements to debug harness.
65
66         * Animometer/developer.html:
67         * Animometer/resources/debug-runner/animometer.css:
68         (#suites): Put the complexity text boxes closer to the test names.
69         (#options):
70         (#rawFPS circle): Make the interval FPS appear as a separate data series, with a line.
71         (#intervalFPS path):
72         (#intervalFPS circle):
73         * Animometer/resources/debug-runner/animometer.js:
74         (window.optionsManager.updateLocalStorageFromUI): Convert number inputs from text.
75         (window.suitesManager._onChangeTestCheckbox): Refactor to take a checkbox.
76         (window.suitesManager._createTestElement): Enhance such that typing into the complexity
77         input will automatically select that test for running.
78         (window.suitesManager.updateLocalStorageFromJSON): Make the harness work for private
79         browsing.
80         * Animometer/resources/debug-runner/graph.js: Separate the intervalFPS data, and show
81         more accuracy in timestamps.
82
83 2016-02-06  Jon Lee  <jonlee@apple.com>
84
85         Refactor helper methods for getting random values for a stage.
86
87         Instead of requiring a Stage instance, just attach it to the Stage object.
88
89         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
90         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
91         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
92         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
93         * Animometer/tests/master/resources/canvas-tests.js:
94         * Animometer/tests/master/resources/particles.js:
95         * Animometer/tests/misc/resources/canvas-electrons.js:
96         * Animometer/tests/misc/resources/canvas-stars.js:
97         * Animometer/tests/misc/resources/compositing-transforms.js:
98         * Animometer/tests/resources/main.js:
99         * Animometer/tests/simple/resources/simple-canvas-paths.js:
100
101 2016-02-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
102
103         Add a new graphics test for CanvasRenderingContext2D functions: getImageData and putImageData
104         https://bugs.webkit.org/show_bug.cgi?id=151716
105
106         Reviewed by Darin Adler.
107
108         The purpose of this test is to measure the performance of getImageData
109         and putImageData functions. This test draws a background on the canvas
110         and then gets some random tiles from this background and draw them in
111         destinations different from their original sources.
112
113         * Animometer/resources/debug-runner/tests.js: Adding the new test to the canvas simple tests suite.
114
115         * Animometer/resources/extensions.js:
116         (Array.prototype.shuffle): Shuffles the elements of an array.
117
118         (Point.zero): Returns a new Point object whose x and y are equal zero.
119         (Point.prototype.str): Used for debugging the Point object.
120
121         * Animometer/tests/simple/resources/tiled-canvas-image.js: Added.
122         (CanvasImageTile):
123         (CanvasImageTile.prototype.getImageData):
124         (CanvasImageTile.prototype.putImageData):
125         (Stage.call.initialize):
126         (Stage.call._createTiles):
127         (Stage.call._nextTilePosition):
128         (Stage.call.tune):
129         (Stage.call._drawBackground):
130         (Stage.call.animate):
131         (Stage.call.complexity):
132         (Stage.call):
133         * Animometer/tests/simple/tiled-canvas-image.html: Added.
134
135 2016-01-07  Jon Lee  <jonlee@apple.com>
136
137         Fix new test.
138
139         * Animometer/resources/runner/tests.js: Wrong URL from an
140         old patch.
141         * Animometer/tests/master/particles.html:
142         * Animometer/tests/master/resources/dom-particles.js:
143         (Particle.call.reset): Figured out a simpler way to set up
144         the particles.
145         (this.move.reset): Deleted.
146         (this.move._applyAttributes): Deleted.
147         * Animometer/tests/master/resources/particles.js:
148         (Particle): Call move() after reset().
149
150 2016-01-07  Jon Lee  <jonlee@apple.com>
151
152         Update benchmark test suite
153         https://bugs.webkit.org/show_bug.cgi?id=152679
154
155         Reviewed by Simon Fraser.
156
157         Add a new test. The test has a rotating background
158         gradient, and does a better job physically simulating
159         particles.
160
161         * Animometer/resources/extensions.js: Teach Point to take constants as well as other Points.
162         (Point.prototype.length): Added.
163         (Point.prototype.normalize): Added.
164         * Animometer/resources/runner/tests.js: Add the test to the master suite.
165         * Animometer/tests/master/particles.html: Added.
166         * Animometer/tests/master/resources/particles.js: Added. Parent class for different kinds of particles.
167         (Particle):
168         (Particle.prototype.reset): If the particle starts slowing down in terms of its animation,
169         reset it.
170         (Particle.prototype.animate): Bounce off the walls elastically, and include gravity.
171         (Particle.prototype.move): Subclasses should override.
172         (ParticlesStage): Stage includes a rotating gradient background.
173         * Animometer/tests/master/resources/dom-particles.js: Added. Creates a <div> and adds it to
174         the stage.
175         * Animometer/tests/resources/star.svg: Added.
176
177 2016-01-03  Jon Lee  <jonlee@apple.com>
178
179         Update benchmark test suite
180         https://bugs.webkit.org/show_bug.cgi?id=152679
181
182         Reviewed by Simon Fraser.
183
184         Move algorithm.js and sampler.js to tests/ and benchmark-runner.js to runner/.
185
186         Needed by both harnesses.
187         * Animometer/resources/runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/resources/debug-runner/benchmark-runner.js.
188         * Animometer/developer.html:
189         * Animometer/index.html:
190
191         Needed only by the tests. Move to tests/. Statistics, in sampler.js, is used by ResultsDashboard, so move that
192         into extensions.js.
193         * Animometer/resources/extensions.js:
194         * Animometer/tests/resources/algorithm.js: Renamed from PerformanceTests/Animometer/resources/algorithm.js.
195         * Animometer/tests/resources/sampler.js: Renamed from PerformanceTests/Animometer/resources/sampler.js.
196         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
197         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
198         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
199         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
200         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
201         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
202         * Animometer/tests/master/canvas-stage.html:
203         * Animometer/tests/misc/canvas-electrons.html:
204         * Animometer/tests/misc/canvas-stars.html:
205         * Animometer/tests/misc/compositing-transforms.html:
206         * Animometer/tests/simple/simple-canvas-paths.html:
207         * Animometer/tests/template/template-canvas.html:
208         * Animometer/tests/template/template-css.html:
209         * Animometer/tests/template/template-svg.html:
210         * Animometer/tests/text/layering-text.html:
211         * Animometer/tests/text/text-boxes.html:
212
213 2016-01-07  Jon Lee  <jonlee@apple.com>
214
215         Update benchmark test suite
216         https://bugs.webkit.org/show_bug.cgi?id=152679
217
218         Reviewed by Simon Fraser.
219
220         Fix tests for other browsers.
221
222         * Animometer/resources/extensions.js:
223         (Point.elementClientSize): Some browsers return 0 for SVG clientWidth and clientHeight.
224         Use getBoundingClientRect() instead.
225         * Animometer/tests/misc/resources/canvas-electrons.js:
226         (CanvasElectron.prototype._draw): Some browsers don't support ellipse.
227
228 2016-01-07  Jon Lee  <jonlee@apple.com>
229
230         Add a waitUntilReady() step
231         https://bugs.webkit.org/show_bug.cgi?id=152862
232
233         Reviewed by Simon Fraser.
234
235         Add a waitUntilReady() callback that lets the benchmark complete
236         its setup before running the benchmark.
237
238         * Animometer/tests/resources/main.js:
239         (Benchmark.prototype.run): First call waitUntilReady, which returns
240         a promise. When the promise resolves, run everything that was in this
241         function.
242         (Benchmark.prototype.waitUntilReady): Default implementation returns
243         a resolved promise.
244         (Benchmark.prototype.resolveWhenFinished): Deleted.
245         * Animometer/tests/template/resources/template-canvas.js:
246         (new.TemplateCanvasStage.waitUntilReady): Example on how to override.
247
248 2016-01-03  Jon Lee  <jonlee@apple.com>
249
250         Update data reporting and analysis
251         https://bugs.webkit.org/show_bug.cgi?id=152670
252
253         Reviewed by Simon Fraser.
254
255         Show new graph data. Provide controls to show different series data. Provide an
256         interactive cursor that shows the data at a given sample.
257
258         * Animometer/developer.html: Add a nav section in #results. Each part of the graph
259         has a checkbox for visual toggling, as well as companion spans to contain the data.
260                 The numbers will always be shown even if the SVG isn't.
261         * Animometer/resources/debug-runner/animometer.css:
262         (#suites): Adjust spacing when doing fixed complexity.
263         (#test-graph nav): Place the nav in the upper right corner.
264         (#test-graph-data > svg): Fix the FPS scale from 0-60. It makes the raw FPS goes past
265         that scale. Allow it to show.
266         (.target-fps): Add a dotted line for where the benchmark is supposed to settle for FPS.
267         (#cursor line): The cursor contains a line and highlight circles for the data being shown.
268         (#cursor circle):
269         (#complexity path): This and rules afterward are named by series type.
270         (#complexity circle):
271         (#filteredFPS path):
272         (#filteredFPS circle):
273         (#rawFPS path):
274         (#intervalFPS circle):
275         (.left-samples): Deleted.
276         (.right-samples): Deleted.
277         * Animometer/resources/debug-runner/animometer.js:
278         (initialize): Add a "changed" listener when the checkboxes change in the nav.
279         (onBenchmarkOptionsChanged): Renamed.
280         (showTestGraph): All graph data is passed in as graphData instead of as arguments.
281         * Animometer/resources/debug-runner/graph.js: Extend BenchmarkController. When showing
282         a new graph, call updateGraphData(). It creates all of the d3 graphs. onGraphOptionsChanged()
283         toggles the data on and off.
284         (updateGraphData): Add the axes. Add the average lines and markers for sample time and
285         target FPS. Add the cursor group. Use helper function addData() to add the data. On top of
286         everything add a transparent area which will catch all of the mouse events. When the mouse
287         moves in the graph, find the closest data point, show the data in the nav area, and highlight
288         the data points.
289         (addData): Adds a line and circle for each data point. Also adds a highlight cursor with a
290         size a little larger than the circle radius for the data points.
291         (onGraphOptionsChanged): Called when data is visually toggled.
292         (showOrHideNodes): Helper function to toggle the .hidden class.
293         * Animometer/resources/extensions.js:
294         (ResultsDashboard.prototype.get data): Get rid of the arguments for _processData.
295         (ResultsTable.prototype._addGraphButton): Shove all of the graph data into a singular object.
296
297         Producing the JSON can take a while with all of the data. Make it on-demand with a
298         button.
299
300         * Animometer/resources/debug-runner/animometer.js:
301         (showResults): When showing the results, don't serialize the JSON data. Move that to...
302         (showJSONResults): ...here. Remove the button.
303
304         * Animometer/developer.html: Add a button. The button will remove itself and populate
305         the textarea with the JSON data.
306         * Animometer/resources/debug-runner/animometer.css:
307         (.hidden): Add a universal hidden class.
308         (#results button.small-button): Promote the small-button styles to the whole results
309         section for use in the JSON button.
310         (#results button.small-button:active):
311         (#results-data button.small-button): Deleted.
312         (#results-data button.small-button:active): Deleted.
313
314         Refactor how Animator does its recording.
315
316         * Animometer/tests/resources/math.js: Create a new, simple estimator that just returns
317         the same interval frame rate for adjustment.
318         * Animometer/tests/resources/main.js:
319         (Animator): Remove _dropFrameCount, and make variables more accurate described.
320         (Animator.prototype.initialize): Use the identity estimator instead of using a bool.
321         (Animator.prototype._intervalTimeDelta): Rename, only used internally.
322         (Animator.prototype._shouldRequestAnotherFrame): Assume we drop one frame for adjustment
323         of the scene. If we are within the number of frames to measure for the interval, just
324         record the timestamp. Otherwise we are ready to evaluate and adjust the scene. Record
325         the interval frame rate and the estimator's frame rate.
326
327         Avoid processing the data through the Experiment while the test is running. Reconfigure
328         the sampler to just record the raw samples. After the test is done, run the samples through
329         the Experiment to get the score.
330
331         * Animometer/resources/sampler.js:
332         (Experiment): Fold _init() into the constructor since nobody else will call it. This is not
333         needed until the test concludes, so remove startSampling(). Clients should just call sample().
334         (Sampler): Pre-allocate arrays given the number of data points being recorded, and a capacity
335         of how many samples will be used. The processor is a called when it's time to process the data
336         since that is the client also telling the Sampler what to record.
337                 Introduce the notion of marks as well, which allows the client to mark when an
338         event occurs. When we mark sample start, we can attach the timestamp there, instead of storing
339         it separately.
340         (Sampler.prototype.startSampling): Deleted. Clients should just call record().
341         (Sampler.prototype.record): The data to record is passed in as variable arguments.
342         (Sampler.prototype.mark): When adding a mark, a client needs to provide a unique string, and
343         can provide extra data object for later retrieval.
344         (Sampler.prototype.process): Renamed from toJSON. Trim the sampling arrays to what was used.
345         Call the processor to process the samples.
346         * Animometer/resources/debug-runner/benchmark-runner.js:
347         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Call process().
348
349         * Animometer/resources/strings.js: Add some new strings, remove the graph ones since they are
350         not used.
351         * Animometer/tests/resources/main.js:
352         (Benchmark): Create a sampler with 4 series. The maximum number of points expected is the
353         number of seconds multiplied by 60 fps. Benchmark, as a client of the Sampler, knows about all
354         of the data being added to the Sampler. It is added through record(), and processed through
355         processSamples().
356         (Benchmark.prototype.update): Mark when we've passed warmup and are starting to sample. Include
357         the timestamp in the custom data for the mark. This avoids the need to store is separately in
358         the Sampler. Fold what was in record() here, since nothing else needs this functionality.
359         record() now just relays the information to the sampler.
360         (Benchmark.prototype.record): Called by Animator, which provides the data to the sampler.
361         Animator's calls to this is part of a later patch. Requires each stage to return its complexity.
362         (Benchmark.prototype.processSamples): If the sampling mark exists, add it to the results.
363                 Go through all of the samples. All samples contain a timestamp and complexity. We
364         calculate "raw FPS" which is the time differential from the previous sample. At regular intervals
365         the Kalman-filtered FPS and the interval average FPS are also recorded. We also create two
366         experiments, to get the scores for the complexity and smoothed FPS, and add those samples to
367         the experiments. Grab those scores and add them into results also.
368
369         Add complexity() to the tests for Benchmark.record().
370         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
371         * Animometer/tests/misc/resources/canvas-electrons.js:
372         * Animometer/tests/misc/resources/canvas-stars.js:
373         * Animometer/tests/text/resources/layering-text.js:
374
375 2015-12-27  Jon Lee  <jonlee@apple.com>
376
377         Simplify the test harness
378         https://bugs.webkit.org/show_bug.cgi?id=152562
379
380         Reviewed by Simon Fraser.
381
382         Update the simple canvas tests. For the paths, start from the center instead of the
383         top-left corner. Instead of using a coordinate limit, use a canonized factor, and
384         use that along both the x and y axes, so that more capable tests use more of the
385         canvas.
386
387         * Animometer/tests/simple/resources/simple-canvas-paths.js:
388         (CanvasLinePoint): Rewrite to use the coordinate maximum factor.
389         (CanvasQuadraticPoint): Ditto.
390         (CanvasBezierPoint): Ditto.
391         * Animometer/tests/simple/resources/simple-canvas.js:
392         (tune): Calculate a factor instead of a maximum coordinate.
393
394 2015-12-27  Jon Lee  <jonlee@apple.com>
395
396         Simplify the test harness
397         https://bugs.webkit.org/show_bug.cgi?id=152562
398
399         Reviewed by Simon Fraser.
400
401         All of the benchmarks use the default Animator(). Don't require new tests
402         to pass a new instance, and instead just make one in the Benchmark constructor.
403
404         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
405         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
406         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
407         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
408         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
409         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
410         * Animometer/tests/master/resources/canvas-tests.js:
411         * Animometer/tests/misc/resources/canvas-electrons.js:
412         * Animometer/tests/misc/resources/canvas-stars.js:
413         * Animometer/tests/misc/resources/compositing-transforms.js:
414         * Animometer/tests/resources/main.js:
415         * Animometer/tests/simple/resources/simple-canvas-paths.js:
416         * Animometer/tests/template/resources/template-canvas.js:
417         * Animometer/tests/template/resources/template-css.js:
418         * Animometer/tests/template/resources/template-svg.js:
419         * Animometer/tests/text/resources/layering-text.js:
420         * Animometer/tests/text/resources/text-boxes.js:
421
422         Refactor the template.
423
424         * Animometer/tests/template/resources/template-canvas.js:
425         * Animometer/tests/template/resources/template-css.js:
426         * Animometer/tests/template/resources/template-svg.js:
427         * Animometer/tests/template/template-canvas.html:
428         * Animometer/tests/template/template-css.html:
429         * Animometer/tests/template/template-svg.html:
430
431         Refactor the SVG suite.
432
433         * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Move scripts to the end.
434         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto.
435
436         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Remove extraneous includes
437         to stage.js.
438         * Animometer/tests/text/text-boxes.html: Ditto.
439
440         BouncingCanvasParticlesBenchmark is not necessary. Use Benchmark directly when subclassing.
441         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Remove
442         BouncingCanvasParticlesBenchmark.
443         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Use Benchmark.
444         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Ditto.
445
446         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: Require the shape
447         in the constructor instead of having subclasses set the private variable.
448
449         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: Refactor.
450         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
451
452         Refactor the HTML suite.
453
454         Move scripts to the end.
455         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
456         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
457         * Animometer/tests/text/layering-text.html:
458         * Animometer/tests/text/text-boxes.html:
459
460         Refactor to use the new variables.
461         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
462         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
463         * Animometer/tests/text/resources/layering-text.js:
464         * Animometer/tests/text/resources/text-boxes.js:
465
466         Refactor the bouncing canvas tests.
467
468         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Move scripts to the end.
469         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Move scripts to the end.
470
471         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Promote a few
472         properties to "public" since they are used by subclasses.
473         (BouncingParticlesStage): Fix the constructor, which was missing "this". Make particles
474         "public" for subclasses.
475         (BouncingParticlesStage.initialize): Fix the max velocity, which was accidentally changed.
476         * Animometer/tests/misc/resources/compositing-transforms.js: Refactor.
477
478         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
479         BouncingCanvasParticlesAnimator is no longer needed.
480         (BouncingCanvasParticle): Change constructor to take a shape as a parameter instead of
481         having subclasses set the variable.
482
483         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Refactor.
484         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Refactor.
485
486         Move example/ files into misc/.
487
488         * Animometer/tests/misc/canvas-electrons.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-electrons.html.
489         * Animometer/tests/misc/canvas-stars.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-stars.html.
490         * Animometer/tests/misc/resources/canvas-electrons.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-electrons.js.
491         * Animometer/tests/misc/resources/canvas-stars.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-stars.js.
492
493         * Animometer/resources/debug-runner/tests.js: Update test URLs.
494
495         Refactor miscellaneous suite.
496
497         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
498         Remove BouncingParticlesAnimator and BouncingParticleBenchmark, which are
499         not needed.
500         (tune): Remove console assert.
501         * Animometer/tests/resources/main.js: Add Rotater back in from stage.js.
502
503         * Animometer/tests/examples/resources/canvas-electrons.js: Remove CanvasElectronsAnimator.
504         * Animometer/tests/examples/resources/canvas-stars.js: Remove CanvasStarsAnimator.
505         * Animometer/tests/misc/resources/compositing-transforms.js:
506         * Animometer/tests/examples/canvas-electrons.html: Move scripts to the end.
507         * Animometer/tests/examples/canvas-stars.html: Ditto.
508         * Animometer/tests/misc/compositing-transforms.html: Ditto.
509
510         Refactor the simple suite.
511
512         * Animometer/tests/master/resources/canvas-stage.js:
513         (tune): Remove coordinateMaximum since it is not needed in any
514         of the master tests.
515         * Animometer/tests/simple/resources/simple-canvas.js:
516         SimpleCanvasAnimator and SimpleCanvasBenchmark are no longer
517         needed.
518         (tune): Manage the objects differently, but instead of duplicating
519         all of SimpleCanvasStage here, just replace tune(). Include
520         coordinateMaximum, and remove items from the end of the list
521         instead of the beginning.
522         (StageBenchmark.call.createAnimator): Deleted.
523         (StageBenchmark.call): Deleted.
524         * Animometer/tests/simple/resources/simple-canvas-paths.js:
525         * Animometer/tests/simple/simple-canvas-paths.html: Move
526         scripts to the end.
527
528         Get rid of stage.js, StageAnimator, and StageBenchmark. Don't have the progress bar update during the test.
529
530         * Animometer/resources/debug-runner/animometer.js:
531         (initialize): Move the setting of testsCount to the debug runner.
532         (didRunTest): Nicer name.
533         * Animometer/resources/debug-runner/benchmark-runner.js:
534         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Don't pass in the progress bar to benchmarks.
535         * Animometer/resources/extensions.js:
536         (ProgressBar): Refactor. Make variables "private". Resetting the progress when instantiating.
537         (ProgressBar.prototype.incrementRange): This is called every time a benchmark completes.
538         * Animometer/resources/runner/animometer.js:
539         (window.benchmarkRunnerClient.initialize): Remove unneeded setting of testsCount.
540         * Animometer/resources/strings.js: These are no longer needed.
541         * Animometer/tests/master/canvas-stage.html: Remove script inclusion. Other tests will follow.
542         * Animometer/tests/master/resources/canvas-tests.js: Use Benchmark instead of StageBenchmark.
543         * Animometer/tests/resources/main.js: Messages are no longer needed
544         (Animator.prototype._shouldRequestAnotherFrame): Rename from animate(), since this method returns a boolean
545         indicating whether another frame should be requested. Collapse the logic from StageAnimator into animateLoop.
546         (BenchmarkState.prototype.currentStage): Deleted.
547         (BenchmarkState.prototype.currentMessage): Deleted.
548         (BenchmarkState.prototype.currentProgress): Deleted.
549         (Animator.prototype.animate): Deleted.
550         (Animator.prototype.animateLoop): The stage is animated only when we have another frame to draw.
551         (Benchmark.prototype.record): No need to update the progress bar.
552         * Animometer/tests/resources/stage.js: Removed. Rotater will appear in a later patch, in main.js.
553
554         * Animometer/resources/debug-runner/benchmark-runner.js:
555         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Each test is run as a benchmark.
556         Remove the call to runBenchmark by merging the options here, and calling benchmark.run()
557         directly.
558
559         Make the class relationships more easily understandable. The benchmark owns the stage,
560         animator, and options. Make the stage and animator no longer have their own references to
561         the options. Make Stage a first-class citizen by promoting it to main.js. Later patches
562         will try to get rid of stage.js altogether.
563         * Animometer/tests/resources/main.js:
564         (Stage): Moved from stage.js.
565         (Animator): Don't pass in benchmark and options in its constructor. It will get initialized
566         by benchmark-related parameters in initialize().
567         (Animator.prototype.initialize): Add a back-reference to benchmark and cache an option.
568         (Animator.prototype.get benchmark):
569         (Animator.prototype.animate): Refactor to use the cached option, to remove its dependency on
570         the options dictionary.
571         (Benchmark): Require all benchmarks to have a stage and animator. The instance will initialize
572         them.
573         (Benchmark.prototype.get options):
574         (Benchmark.prototype.get stage): BenchmarkStates.stages will need to be renamed to avoid confusion.
575         (Benchmark.prototype.get animator):
576         (Benchmark.prototype.start):
577         (Benchmark.prototype.update): Ask the stage directly to tune or clear instead of adding another
578         level of indirection.
579         (window.runBenchmark): Deleted. Remove the need for a benchmarkClient. Also remove the standalone
580         path, since tests can be individually selected, and remove the need for runBenchmark since that is
581         handled in BenchmarkRunner._runBenchmarkAndRecordResults.
582         * Animometer/tests/resources/stage.js:
583         (Stage): Deleted. Moved to main.js.
584         (StageBenchmark): What's left is updating the progress bar; to be removed.
585         (StageAnimator): What's left can be folded in Animator.
586
587         Refactor master suite.
588         * Animometer/tests/master/resources/canvas-stage.js: This now only has SimpleCanvasStage.
589         (animate): Push the clearRect() into each stage.
590         (complexity):
591         (StageBenchmark.call.createAnimator): Deleted.
592         (StageBenchmark.call): Deleted.
593         * Animometer/tests/master/resources/canvas-tests.js: SimpleCanvasPathStrokeStage is no longer needed.
594         (CanvasLineSegment.prototype.draw):
595         (CanvasArc):
596         (CanvasLinePoint): Remove the draw call because depending on its index it either needs to be moveTo
597         or lineTo, and it is otherwise a very small draw operation that doesn't need the overhead of the
598         function call. Do all of the drawing through the stage.
599
600         Refactor the subclass pattern. Introduce Utilities.createSubclass().
601
602         * Animometer/resources/debug-runner/benchmark-runner.js:
603         * Animometer/resources/extensions.js:
604         (window.Utilities.createSubclass): Takes the super class, a function representing
605         the class's constructor, and additional methods to attach to the new class's
606         prototype object.
607         * Animometer/tests/text/text-boxes.html: Remove unneeded reference to utilities.js.
608
609         Refactor tests.
610         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
611         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
612         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
613         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
614         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
615         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
616         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
617         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
618         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
619         * Animometer/tests/examples/resources/canvas-electrons.js:
620         * Animometer/tests/examples/resources/canvas-stars.js:
621         * Animometer/tests/master/resources/canvas-stage.js:
622         * Animometer/tests/master/resources/canvas-tests.js:
623         * Animometer/tests/misc/resources/compositing-transforms.js:
624         * Animometer/tests/resources/stage.js:
625         * Animometer/tests/simple/resources/simple-canvas-paths.js:
626         * Animometer/tests/simple/resources/simple-canvas.js:
627         * Animometer/tests/template/resources/template-canvas.js:
628         * Animometer/tests/template/resources/template-css.js:
629         * Animometer/tests/template/resources/template-svg.js:
630         * Animometer/tests/text/resources/layering-text.js: Reorder some of the methods
631         and properties since they rely on each other.
632         * Animometer/tests/text/resources/text-boxes.js:
633
634         * Animometer/resources/debug-runner/animometer.js: Arrange calls
635         in the order they are evoked.
636         * Animometer/resources/debug-runner/benchmark-runner.js:
637         (BenchmarkRunnerState.prototype.next): Get rid of return value since
638         no caller to next() uses it.
639         (BenchmarkRunnerState.prototype.prepareCurrentTest): Refactor the
640         promise to resolve simply when onload() is called instead of
641         looking for #stage.
642         (BenchmarkRunner.prototype._runTestAndRecordResults): Suite.run
643         simply calls runBenchmark(). Call it directly rather than through
644         the Suite.
645         (BenchmarkRunner.prototype.step): Remove unused parameter in
646         resolve callback.
647         (BenchmarkRunner.prototype.runMultipleIterations): Use this instead
648         of self since it is outside of the closure which needed the self
649         variable.
650         (resolveIfReady): Deleted.
651         (BenchmarkRunner.prototype.waitForElement): Deleted.
652         * Animometer/resources/runner/tests.js: prepare() and run() are
653         no longer needed.
654         (Suite.prototype.prepare): Deleted.
655         (Suite.prototype.run): Deleted.
656         * Animometer/tests/master/canvas-stage.html: Move all scripts to
657         the end of the page.
658
659 2015-12-23  Simon Fraser  <simon.fraser@apple.com>
660
661         Add an Animometer developer test which animates text-rich boxes
662         https://bugs.webkit.org/show_bug.cgi?id=152544
663
664         Reviewed by Zalan Bujtas.
665
666         Add a test that draws lots of international text. This is a particle test,
667         moving the boxes around with absolution positioning.
668
669         * Animometer/resources/debug-runner/tests.js:
670         * Animometer/tests/text/resources/text-boxes.js: Added.
671         (BouncingTextBox):
672         (BouncingTextBox.prototype._move):
673         (BouncingTextBox.prototype.animate):
674         (BouncingTextBoxStage):
675         (BouncingTextBoxStage.prototype.createParticle):
676         (BouncingTextBoxStage.prototype.particleWillBeRemoved):
677         (BouncingTextBoxsBenchmark):
678         (BouncingTextBoxsBenchmark.prototype.createStage):
679         (window.benchmarkClient.create):
680         * Animometer/tests/text/text-boxes.html: Added.
681
682 2015-12-23  Jon Lee  <jonlee@apple.com>
683
684         Split benchmark into two different pages
685         https://bugs.webkit.org/show_bug.cgi?id=152458
686
687         Reviewed by Simon Fraser.
688
689         Add tests to 'animometer' suite.
690
691         * Animometer/resources/runner/tests.js:
692         * Animometer/tests/master/canvas-stage.html: Added.
693         * Animometer/tests/master/resources/canvas-stage.js: Added.
694         * Animometer/tests/master/resources/canvas-tests.js: Added.
695         * Animometer/tests/master/resources/stage.css: Added.
696
697 2015-12-23  Jon Lee  <jonlee@apple.com>
698
699         Split benchmark into two different pages
700         https://bugs.webkit.org/show_bug.cgi?id=152458
701
702         Reviewed by Simon Fraser.
703
704         Address comments.
705
706         * Animometer/resources/debug-runner/benchmark-runner.js:
707         (BenchmarkRunner.prototype._runTestAndRecordResults): When the testing is complete the frame owning the
708         sampler goes away, and a later call to get the JSON data is no longer available. Process the data
709         right here, instead, and just reference it when displaying the results in ResultsDashboard.prototype._processData.
710         * Animometer/resources/extensions.js:
711         (Array.prototype.fill.Array.prototype.fill): Add a null check. Remove braces around single-line clause.
712         (Array.prototype.find.Array.prototype.find): Update the null check.
713         (ResultsDashboard.prototype._processData): Use the already-processed data.
714         * Animometer/resources/runner/animometer.css:
715         (.frame-container > iframe): Remove calc().
716
717         Move Array functions to extensions.js since that is included by the harness.
718         Add ES6 Array polyfills.
719
720         * Animometer/resources/algorithm.js:
721         (Array.prototype.swap): Moved to extensions.js.
722         * Animometer/resources/extensions.js:
723         (Array.prototype.swap):
724         (Array.prototype.fill): Added.
725         (Array.prototype.find): Added.
726
727         Adjust styles for iPad.
728
729         * Animometer/resources/runner/animometer.css:
730         (@media screen and (min-device-width: 768px)): Apply to iPad as well.
731         (@media screen and (max-device-width: 1024px)): Update width for iPads.
732
733         Adjustment styles for iOS.
734
735         * Animometer/developer.html: Different divs contain the iframe, so use a class instead and
736         update the style rules.
737         * Animometer/index.html:
738         * Animometer/resources/debug-runner/animometer.css: Remove extraneous rules.
739         (@media screen and (min-device-width: 1800px)): Move this up.
740         * Animometer/resources/runner/animometer.css: Add rules to accomodate iOS.
741
742         Get rid of prefixed flex properties for now.
743
744         * Animometer/resources/debug-runner/animometer.css:
745         * Animometer/resources/runner/animometer.css:
746
747         Update the structure of the harness. Remove the JSON-per-test but keep
748         the JSON of the whole test run. Use the full page in order to display
749         the graph.
750
751         * Animometer/developer.html: Update several of the JS file includes to UTF-8. Remove header and footer. Test results screen includes score,
752         average, and worst 5% statistics.
753         * Animometer/index.html: Make structure similar to developer.html.
754         * Animometer/resources/debug-runner/animometer.css: Remove most of the
755         button rules since they are superfluous. Move the progress bar to the
756         top, fixed. Update the results page rules.
757         * Animometer/resources/debug-runner/animometer.js: Remove most of the
758         additions to sectionsManager since they are no longer needed.
759         (setSectionHeader): Updates header of the section.
760         (window.suitesManager._updateStartButtonState): Update selector.
761         (showResults): Add keypress event for selecting different data for
762         copy/paste. Update how the results are populated. Include full test
763         JSON in a textarea, rather than requiring a button press.
764         (showTestGraph):
765         * Animometer/resources/debug-runner/tests.js: Update structure of Headers. Define different kinds of headers. Headers can control their
766         title, and the text used as the cell contents, including class name.
767         * Animometer/resources/extensions.js:
768         (ResultsTable): Update to include a flattened version of the headers,
769         used while populating table contents. Remove unneeded helper functions
770         for creating the table. Rename "show" to "add".
771         * Animometer/resources/runner/animometer.css: Update rules to
772         accommodate the new structure.
773         * Animometer/resources/runner/animometer.js:
774         (window.sectionsManager.setSectionScore): Helper function to set the
775         score and mean for a section.
776         (window.sectionsManager.populateTable): Helper function to set the table.
777         (window.benchmarkController.showResults): Refactor.
778         (window.benchmarkController.selectResults): Update selectors.
779         * Animometer/resources/runner/tests.js: Set Headers. Debug harness
780         extends it.
781
782         Update debug runner to have similar names to the basic runner. Include
783         that page's CSS and remove extraneous CSS rules.
784
785         Get rid of the statistics table #record.
786
787         * Animometer/developer.html: Rename #home to #intro. Rename .spacer to hr.
788         * Animometer/resources/debug-runner/animometer.css: Set to flexbox when selected.
789         * Animometer/resources/debug-runner/animometer.js: Remove recordTable.
790         (window.suitesManager._updateStartButtonState): Update selector to #intro.
791         (setupRunningSectionStyle): Deleted.
792
793         * Animometer/resources/runner/animometer.css:
794         (#test-container.selected): Change to flex-box only when visible.
795
796         Remove recordTable.
797         * Animometer/resources/debug-runner/benchmark-runner.js:
798         (BenchmarkRunner.prototype._runTestAndRecordResults):
799         * Animometer/resources/runner/tests.js:
800         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
801         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
802         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
803         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
804         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
805         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
806         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
807         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
808         * Animometer/tests/examples/resources/canvas-electrons.js:
809         * Animometer/tests/examples/resources/canvas-stars.js:
810         * Animometer/tests/misc/resources/compositing-transforms.js:
811         * Animometer/tests/resources/main.js:
812         * Animometer/tests/resources/stage.js:
813         (StageBenchmark): Remove _recordTable.
814         * Animometer/tests/simple/resources/simple-canvas-paths.js:
815         * Animometer/tests/simple/resources/simple-canvas.js:
816         * Animometer/tests/template/resources/template-canvas.js:
817         * Animometer/tests/template/resources/template-css.js:
818         * Animometer/tests/template/resources/template-svg.js:
819         * Animometer/tests/text/resources/layering-text.js:
820
821         * Animometer/resources/debug-runner/animometer.js:
822         (willStartFirstIteration): Fix selector, since results-table is used
823         in multiple places, so it cannot be an id.
824
825         Make it possible to select the scores, or the whole table data,
826         by cycling through different selections through key press of 's'.
827
828         * Animometer/resources/runner/animometer.js:
829         (window.benchmarkController.showResults): Attach a keypress handler
830         if it hasn't been added already.
831         (window.benchmarkController.selectResults):
832         * Animometer/resources/runner/tests.js: Cycle through different
833         ranges.
834
835         Fix a few fly-by errors.
836
837         * Animometer/resources/debug-runner/benchmark-runner.js:
838         (BenchmarkRunnerState.prototype.prepareCurrentTest): Update the frame relative path
839         since the files are now in the top directory instead of inside runner/.
840         (BenchmarkRunner.prototype._runTestAndRecordResults): Incorrect reference to function.
841         (BenchmarkRunner.prototype.step): Member variable is never used.
842
843         A little stylistic cleanup.
844
845         * Animometer/resources/debug-runner/benchmark-runner.js:
846         * Animometer/resources/extensions.js:
847         (window.DocumentExtension.createElement):
848         * Animometer/tests/resources/main.js:
849         (Benchmark.prototype.record):
850         * Animometer/tests/resources/stage.js:
851         (StageBenchmark.prototype.showResults): Reverse progress and message.
852         The message appears less frequently than the progress.
853         * Animometer/tests/simple/resources/simple-canvas.js:
854         (SimpleCanvasBenchmark): Remove unused options.
855
856         Add newer version of harness in a new page. Consolidate differences between the two
857         pages.
858
859         * Animometer/developer.html: Include runner/animometer.js. Rename the JS function
860         to run the benchmark to startBenchmark() instead of startTest(). Rename #running to
861         #test-container.
862         * Animometer/index.html: Added. Similarly calls startBenchmark() and has #test-container.
863         * Animometer/resources/debug-runner/animometer.css: Make the canvas 2:1 (1200px x 800px)
864         instead of 4:3.
865
866         Split out benchmarkRunnerClient and benchmarkController.
867
868         * Animometer/resources/debug-runner/animometer.js: Move needed functions out of
869         benchmarkRunnerClient, and leave the rest here to extend that object. Get rid of _resultsTable
870         and move populating the results table into benchmarkController. Rename _resultsDashboard
871         to results and make it accessible for other objects to use.
872         (willAddTestFrame): This is unnecessary. Remove.
873
874         (window.sectionsManager.showScore): Grab it from the results object instead of
875         benchmarkRunnerClient.
876         (window.sectionsManager.showSection): Deleted. Moved to runner/animometer.js.
877
878         (window.benchmarkController._runBenchmark): Deleted. Mostly moved into _startBenchmark.
879         (window.benchmarkController.startBenchmark): Refactor to call _startBenchmark.
880         (window.benchmarkController.showResults): Include most of benchmarkRunnerClient.didFinishLastIteration()
881         here.
882
883         * Animometer/resources/debug-runner/benchmark-runner.js:
884         (BenchmarkRunner.prototype._appendFrame): Remove unneeded call to willAddTestFrame.
885         * Animometer/resources/extensions.js:
886         (ResultsDashboard): Change the class to process the sampler data on-demand and hold onto that data
887         for later referencing.
888         (ResultsDashboard.prototype.toJSON): Deleted.
889         (ResultsDashboard.prototype._processData): Rename toJSON to _processData since it's not really
890         outputting JSON. Store the processed data into a member variable that can be referenced later.
891         (ResultsDashboard.prototype.get data): Process the data if it hasn't already.
892         (ResultsDashboard.prototype.get score): Process the data if it hasn't already, then return the
893         aggregate score.
894         (ResultsTable.prototype._showHeader): When outputting the results to a table, don't force the
895         need for an empty children array. This was to allow for a header row in the table that spanned
896         multiple columns. In the simpler harness, this is not needed.
897         (ResultsTable.prototype._showEmptyCells):
898         (ResultsTable.prototype._showTest): This hardcoded the columns. At least for the name and score,
899         which is the bare minimum needed for the simpler harness, key off of the header name provided.
900         * Animometer/resources/runner/animometer.css: Added. Use a similar 2:1 ratio. The score tables are
901         split into the data and the headers, and are also displayed RTL so that a later patch allows a
902         user to copy-paste the data easily.
903         * Animometer/resources/runner/animometer.js: Added. Use a simpler version of benchmarkRunnerClient.
904         The debug harness will extend these classes.
905         (window.benchmarkController._startBenchmark): Used by both harnesses.
906         (window.benchmarkController.startBenchmark): Set hard-coded options.
907         (window.benchmarkController.showResults): Includes most of benchmarkRunnerClient.didFinishLastIteration()
908         here.
909
910         Get rid of utilities.js. Move it all into extensions.js.
911
912         * Animometer/resources/extensions.js:
913         * Animometer/tests/resources/utilities.js: Removed.
914
915         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Remove script link.
916         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Ditto.
917         * Animometer/tests/bouncing-particles/bouncing-css-images.html: Ditto.
918         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: Ditto.
919         * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Ditto.
920         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto.
921         * Animometer/tests/examples/canvas-electrons.html: Ditto.
922         * Animometer/tests/examples/canvas-stars.html: Ditto.
923         * Animometer/tests/misc/compositing-transforms.html: Ditto.
924         * Animometer/tests/simple/simple-canvas-paths.html: Ditto.
925         * Animometer/tests/template/template-canvas.html: Ditto.
926         * Animometer/tests/template/template-css.html: Ditto.
927         * Animometer/tests/template/template-svg.html: Ditto.
928         * Animometer/tests/text/layering-text.html: Ditto.
929
930         Split tests.js into two. Add a new suite to runner/tests.js.
931
932         * Animometer/developer.html: Update the script order. Scripts from
933         debug-runner/ will always build on those from runner/, and have the
934         same name.
935         * Animometer/resources/debug-runner/tests.js: Move "complex examples"
936         suite into "miscellaneous tests".
937         (Suite): Deleted.
938         (Suite.prototype.prepare): Deleted.
939         (Suite.prototype.run): Deleted.
940         (suiteFromName): Deleted.
941         * Animometer/resources/runner/tests.js: Added. Take definitions and
942         functions needed by the test harness. Leave the test suites behind.
943         (Suite): Moved from debug script.
944         (Suite.prototype.prepare): Ditto.
945         (Suite.prototype.run): Ditto.
946         (suiteFromName): Ditto.
947         (testFromName): Ditto.
948
949         Move benchmark resources out into resources/debug-runner, and update URLs.
950
951         * Animometer/developer.html: Renamed from PerformanceTests/Animometer/runner/animometer.html.
952         * Animometer/resources/debug-runner/animometer.css: Renamed from PerformanceTests/Animometer/runner/resources/animometer.css.
953         * Animometer/resources/debug-runner/animometer.js: Renamed from PerformanceTests/Animometer/runner/resources/animometer.js.
954         * Animometer/resources/debug-runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/runner/resources/benchmark-runner.js.
955         * Animometer/resources/debug-runner/d3.min.js: Renamed from PerformanceTests/Animometer/runner/resources/d3.min.js.
956         * Animometer/resources/debug-runner/graph.js: Renamed from PerformanceTests/Animometer/runner/resources/graph.js.
957         * Animometer/resources/debug-runner/tests.js: Renamed from PerformanceTests/Animometer/runner/resources/tests.js.
958
959 2015-12-11  Jon Lee  <jonlee@apple.com>
960
961         Improve Animometer on iOS
962         https://bugs.webkit.org/show_bug.cgi?id=152180
963
964         Reviewed by Simon Fraser.
965
966         Improve experience on phones. Make the canvas take
967         up the whole screen.
968
969         * Animometer/runner/animometer.html: Add meta viewport.
970         Remove the container div.
971         * Animometer/runner/resources/animometer.css: Have buttons lay
972         out vertically. Update detail arrow glyph. Make the suites and
973         options section lay out vertically. Remove the top spacers since
974         we want the canvas to take over the whole screen. Minimal display
975         is recommended for use.
976
977 2015-12-07  Jon Lee  <jonlee@apple.com>
978
979         Update suites for benchmark
980         https://bugs.webkit.org/show_bug.cgi?id=151957
981
982         Reviewed by Simon Fraser.
983
984         * Animometer/runner/animometer.html: Use spacers instead of relying on
985         justify-content center to center the content. That allows the opening screen
986         to grow downward when expanding the list of choices, otherwise it expands
987         from the center, and off the top edge of the screen.
988         * Animometer/runner/resources/animometer.css:
989         (.tree): Don't overflow scroll.
990         (.tree > li > label.tree-label:before): Use better glyphs.
991         (.tree > li > :checked ~ label.tree-label:before):
992         (main): Using flex-start for justify-content so that if the section grows too
993         big it gets pinned to the top edge of the document instead of growing past it.
994         (.spacer): Make the spacers have a minimum 20px and grow evenly.
995         (section#home): Add a min-height so that the border will expand if the suite
996         tests shown make the section grow past the height.
997         * Animometer/runner/resources/animometer.js: Update the selectors.
998         (window.suitesManager._treeElement):
999         (window.suitesManager._suitesElements):
1000         (window.suitesManager._editsElements):
1001
1002 2015-12-07  Jon Lee  <jonlee@apple.com>
1003
1004         Update options for benchmark
1005         https://bugs.webkit.org/show_bug.cgi?id=151956
1006
1007         Reviewed by Simon Fraser.
1008
1009         Move "Fix test complexity" and "Adaptive" checkboxes into a radio group.
1010
1011         Move "Show running results" into a radio group, and add options to remove the HUD.
1012
1013         * Animometer/runner/animometer.html: Get rid of the preamble. Wrap the options
1014         in a form for easier referencing in JS.
1015         * Animometer/runner/resources/animometer.css: Show the surrounding border if the
1016         body's display-minimal class name is set.
1017         * Animometer/runner/resources/animometer.js:
1018
1019         Update the way optionsManager gets and sets default values. Include support for
1020         radio groups.
1021         (window.optionsManager.valueForOption):
1022         (window.optionsManager.updateUIFromLocalStorage):
1023         (window.optionsManager.updateLocalStorageFromUI):
1024
1025         (window.benchmarkRunnerClient.willStartFirstIteration):
1026         (window.sectionsManager.setupRunningSectionStyle):
1027         (window.suitesManager._treeElement): Fly-by whitespace fix.
1028         (window.suitesManager._suitesElements): Ditto.
1029         (window.suitesManager.updateEditsElementsState): Update options check.
1030         (window.suitesManager.updateDisplay): Add a new update function for the HUD.
1031         Attach a class to the body depending on the user's choice.
1032         (window.benchmarkController.initialize): Add an event listener when the form
1033         radio buttons update.
1034         (window.benchmarkController.onFormChanged):
1035         (window.optionsManager._optionsElements): Deleted.
1036         (window.optionsManager._adaptiveTestElement): Deleted.
1037         (window.benchmarkController.onChangeAdaptiveTestCheckbox): Deleted.
1038         * Animometer/tests/resources/main.js:
1039         (Benchmark.prototype.update): Update options checks.
1040         * Animometer/tests/resources/stage.js: Update option check.
1041         (StageBenchmark.prototype.showResults):
1042
1043 2015-12-01  Simon Fraser  <simon.fraser@apple.com>
1044
1045         Add a basic compositing Animometer test
1046         https://bugs.webkit.org/show_bug.cgi?id=151724
1047
1048         Reviewed by Dean Jackson.
1049
1050         Add a "bouncing particles" test that moves composited layers around, optionally with a filter.
1051
1052         This is added under a new "Miscellaneous" category.
1053
1054         Remove the test templates category from the UI.
1055
1056         * Animometer/runner/resources/tests.js:
1057         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1058         (BouncingCssShape.prototype.animate):
1059         * Animometer/tests/misc/compositing-transforms.html: Added.
1060         * Animometer/tests/misc/resources/compositing-transforms.js: Added.
1061         (BouncingCompositedImage):
1062         (BouncingCompositedImage.prototype._move):
1063         (BouncingCompositedImage.prototype.animate):
1064         (CompositingTransformsStage):
1065         (CompositingTransformsStage.prototype.createParticle):
1066         (CompositingTransformsStage.prototype.particleWillBeRemoved):
1067         (CompositedTransformsBenchmark):
1068         (CompositedTransformsBenchmark.prototype.createStage):
1069         (window.benchmarkClient.create):
1070
1071 2015-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
1072
1073         Fix the graphics benchmark complexity bounds adjustment
1074         https://bugs.webkit.org/show_bug.cgi?id=151670
1075
1076         Reviewed by Simon Fraser.
1077
1078         Make sure the graphics benchmark complexity bounds adjustment is applied
1079         to the absolute lower bound.
1080
1081         * Animometer/tests/resources/math.js:
1082         (PIDController.prototype._saturate):
1083
1084 2015-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
1085
1086         Add an option to select the results form the graphics benchmark
1087         https://bugs.webkit.org/show_bug.cgi?id=151666
1088
1089         Reviewed by Ryosuke Niwa.
1090
1091         We need an easy way to select the graphics benchmark results table such
1092         that when it is copied to the clipboard, rich text format is set to the
1093         clipboard.
1094
1095         * Animometer/runner/animometer.html: Add a new button to select the results table or JSON.
1096
1097         * Animometer/runner/resources/animometer.js:
1098         (window.sectionsManager._sectionDataElement): Selects the container <data> element.
1099         (window.sectionsManager._sectionDataDivElement): Replace a literal string with a string table entry.
1100         (window.sectionsManager.showTestName): Replace a literal string with a string table entry.
1101         (window.sectionsManager.selectData): Selects the container <data> element in a selection.
1102         (window.sectionsManager.selectDataContents): Select the contents of container <data> element in a selection.
1103         (window.benchmarkController.selectResults): Selects the results table.
1104         (window.benchmarkController.showJSON): Function rename.
1105         (window.benchmarkController.selectJSON): Selects the contents of the results JSON.
1106         (window.benchmarkController.showJson): Deleted.
1107
1108 2015-11-20  Simon Fraser  <simon.fraser@apple.com>
1109
1110         Animometer: graphs should not do interpolation
1111         https://bugs.webkit.org/show_bug.cgi?id=151526
1112
1113         Reviewed by Simon Fraser.
1114
1115         Having the graphs do interpolation is misleading, because you can't see the actual data.
1116
1117         Also remove "shape-rendering: crispEdges;" so the lines get antialiased.
1118
1119         * Animometer/runner/resources/animometer.css:
1120         (section#test-graph > data > svg): Deleted.
1121         * Animometer/runner/resources/graph.js:
1122         (graph): Deleted.
1123
1124 2015-11-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
1125
1126         Calculate the graphics benchmark test gain adaptively
1127         https://bugs.webkit.org/show_bug.cgi?id=151208
1128
1129         Reviewed by Darin Adler.
1130
1131         We need to calculate the gain of the graphics benchmark tests adaptively
1132         and get rid of the gain and limits parameters we have to choose manually
1133         for every test. We are going to use the classic Ziegler–Nichols method for
1134         calculating the gain and integral and derivative times. We are going to
1135         try moving on a cubic curve during the manual stage from y0 to reach ysp.
1136         We also going to use a saturation actuator to ensure the system does not
1137         fluctuate.
1138
1139         * Animometer/resources/extensions.js:
1140         (ResultsTable.prototype._isNoisyMeasurement): Fix a parameter name.
1141         (ResultsTable.prototype._isNoisyTest): Since score is a member of testResults, we need to limit our search to frame rate and complexity.
1142         (ResultsTable.prototype._showTest): Pass the correct parameter to _isNoisyMeasurement().
1143
1144         * Animometer/resources/strings.js: Fix the indentation and name and value of a string.
1145
1146         * Animometer/runner/resources/tests.js: Remove all the manual gains and limits parameters which had to be passed to every test.
1147
1148         * Animometer/tests/resources/main.js:
1149         (BenchmarkState.prototype.currentStage): Fix an enum name.
1150         (Benchmark): Get rid of manual gain and limits.
1151         (Benchmark.prototype.update): Simplify the calculation by having all the times in ms.
1152
1153         * Animometer/tests/resources/math.js:
1154         (PIDController): Get rid of the manual gain and limits and the magic numbers for Ti and Td.
1155         (PIDController.prototype._yPosition): Tells whether the test current output is moving towards the set-point or away from it.
1156         (PIDController.prototype._distanceUltimate): Calculates the ultimate distance from y0 after time t using a cubic formula.
1157         (PIDController.prototype._distance): Calculates the distance of y relative to y0.
1158         (PIDController.prototype._gainIncrement): Decides how much the proportional gain should be increased during the manual gain stage.
1159         (PIDController.prototype._updateStage): Updates the stage of the controller based on its current stage and the system output.
1160         (PIDController.prototype._tuneP): Tunes the system before calculating the PID controller gains.
1161         (PIDController.prototype._tunePID): PID tuning function.
1162         (PIDController.prototype._tune):
1163         (PIDController.prototype._saturate):
1164         (PIDController.prototype.tune): Manages calculating the controller parameters. It then returns a PID tuning value.
1165         (PIDController.prototype._sat): Deleted. We may need to return it back but the limits have to be calculated adaptively not manually.
1166
1167 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
1168
1169         Reorganize the graphics benchmark string table
1170         https://bugs.webkit.org/show_bug.cgi?id=151334
1171
1172         Reviewed by Simon Fraser.
1173
1174         Make the graphics benchmark string table be an object of sub-objects. Each
1175         sub-object represents an associative array, the key is the string name and
1176         the value is the string data.
1177
1178         * Animometer/resources/extensions.js:
1179         (ResultsDashboard.prototype.toJSON):
1180         (ResultsTable.prototype._showGraph):
1181         (ResultsTable.prototype._showJSON):
1182         (ResultsTable.prototype._isNoisyMeasurement):
1183         (ResultsTable.prototype._isNoisyTest):
1184         (ResultsTable.prototype._showTest):
1185         (ResultsTable.prototype._showSuite):
1186         (ResultsTable.prototype._showIteration):
1187         * Animometer/resources/sampler.js:
1188         (Sampler.prototype.toJSON):
1189         * Animometer/resources/strings.js:
1190         * Animometer/runner/resources/animometer.js:
1191         (window.benchmarkRunnerClient.didFinishLastIteration):
1192         (window.suitesManager.updateLocalStorageFromJSON):
1193         (window.benchmarkController.showResults):
1194         (window.benchmarkController.showJson):
1195         (window.benchmarkController.showTestGraph):
1196         (window.benchmarkController.showTestJSON):
1197         * Animometer/runner/resources/tests.js:
1198         * Animometer/tests/resources/main.js:
1199
1200 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
1201
1202         Disable flattening the stage iframe of the graphics benchmark when running on iOS
1203         https://bugs.webkit.org/show_bug.cgi?id=151361
1204
1205         Reviewed by Simon Fraser.
1206
1207         Use fixed size for stage iframe of the graphics benchmark to disable
1208         flattening the iframe while animating the particles. Also ensure the
1209         bouncing particles do not go outside the iframe's boundaries.
1210
1211         * Animometer/runner/resources/animometer.css:
1212         (section#running > #running-test > iframe):
1213         (@media screen and (min-device-width: 1800px)):
1214         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1215         (BouncingParticle.prototype.animate):
1216
1217 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
1218
1219         Use the media queries to dynamically set the stage for the graphics benchmark
1220         https://bugs.webkit.org/show_bug.cgi?id=151327
1221
1222         Reviewed by Simon Fraser.
1223
1224         Clean setting the benchmark css rules by using the media queries. Accessing
1225         document.stylesheets.cssRules seems to be unreliable. Fix the test harness
1226         load event listener invocation. And also remove the options for normalizing
1227         the stage resolution for retina display.
1228
1229         * Animometer/resources/extensions.js:
1230         (window.DocumentExtension.insertCssRuleAfter): Deleted.
1231         * Animometer/runner/animometer.html:
1232         * Animometer/runner/resources/animometer.css:
1233         (@media screen and (min-device-width: 1800px)):
1234         * Animometer/runner/resources/animometer.js:
1235         (window.sectionsManager.setupRunningSectionStyle):
1236         (window.benchmarkController.initialize):
1237         (window.sectionsManager.setupSectionStyle): Deleted.
1238         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1239         (BouncingParticlesStage):
1240         * Animometer/tests/text/layering-text.html:
1241         * Animometer/tests/text/resources/layering-text.js:
1242         (LayeringTextStage):
1243         (LayeringTextStage.prototype._setFontSize): Deleted.
1244
1245 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
1246
1247         Remove the option for animating using setInterval from the graphics benchmark
1248         https://bugs.webkit.org/show_bug.cgi?id=151283
1249
1250         Reviewed by Darin Adler.
1251
1252         Get rid of the option to run animation using setInterval().
1253
1254         * Animometer/tests/resources/main.js:
1255         (Animator.prototype.animate):
1256         (Benchmark):
1257         (Benchmark.prototype.start):
1258         (Animator.prototype.start): Deleted.
1259
1260 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
1261
1262         Highlight the alarming test results in the graphics benchmark results page
1263         https://bugs.webkit.org/show_bug.cgi?id=151286
1264
1265         Reviewed by Simon Fraser.
1266
1267         When showing the results of a test in the graphics benchmark the following
1268         criteria is going to be applied:
1269
1270         1. If the standard deviation of the test complexity or the frame rate is
1271            equal to or more than 10%, the standard deviation and the test name
1272            will be displayed in red.
1273         2. If the average frame rate is not in the range = [(desired_frame_rate - 2)
1274            .. (desired_frame_rate + 2)], the average frame rate and the test name will
1275            be displayed in red.
1276
1277         * Animometer/resources/extensions.js:
1278         (ResultsTable.prototype._showHeaderRow):
1279         (ResultsTable.prototype._showHeader):
1280         (ResultsTable.prototype._showEmptyCell):
1281         (ResultsTable.prototype._showText):
1282         (ResultsTable.prototype._showFixedNumber):
1283         (ResultsTable.prototype.):
1284         (ResultsTable.prototype._showGraph):
1285         (ResultsTable.prototype._showJSON):
1286         (ResultsTable.prototype._isAlarmingMeasurement):
1287         (ResultsTable.prototype._isAlarmingTestResults):
1288         (ResultsTable.prototype._showEmptyCells):
1289         (ResultsTable.prototype._showEmptyRow):
1290         (ResultsTable.prototype._showTest):
1291         (ResultsTable.prototype._showSuite):
1292         (ResultsTable.prototype._showIteration):
1293         (ResultsTable.prototype.showRecord):
1294         (ResultsTable.prototype.showIterations):
1295         (ResultsTable.prototype._showEmpty): Deleted.
1296         * Animometer/runner/resources/animometer.js:
1297         (window.benchmarkRunnerClient.didFinishLastIteration):
1298         * Animometer/tests/resources/stage.js:
1299         (StageBenchmark.prototype.showResults):
1300
1301 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
1302
1303         Clean referencing the options object in the graphics benchmark
1304         https://bugs.webkit.org/show_bug.cgi?id=151284
1305
1306         Reviewed by Simon Fraser.
1307
1308         Get rid of the Benchmark.options member and rely only on the private member
1309         Benchmark._options. The animator need to have its own options member instead
1310         of accessing it from its reference to Benchmark object.
1311
1312         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
1313         (BouncingCanvasParticlesAnimator):
1314         (BouncingCanvasParticlesBenchmark.prototype.createAnimator):
1315         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1316         (BouncingParticle.prototype.animate):
1317         (BouncingParticlesAnimator):
1318         (BouncingParticlesBenchmark.prototype.createAnimator):
1319         * Animometer/tests/examples/resources/canvas-electrons.js:
1320         (CanvasElectronsStage.prototype.animate):
1321         (CanvasElectronsAnimator):
1322         (CanvasElectronsBenchmark.prototype.createAnimator):
1323         (window.benchmarkClient.create):
1324         * Animometer/tests/examples/resources/canvas-stars.js:
1325         (CanvasStarsStage.prototype.animate):
1326         (CanvasStarsAnimator):
1327         (CanvasStarsBenchmark.prototype.createAnimator):
1328         (window.benchmarkClient.create):
1329         * Animometer/tests/resources/main.js:
1330         (BenchmarkState.prototype.currentProgress):
1331         (Animator):
1332         (Animator.prototype.animate):
1333         (Benchmark):
1334         (Benchmark.prototype.update):
1335         * Animometer/tests/resources/stage.js:
1336         (Stage.prototype.clear):
1337         (StageAnimator):
1338         (StageBenchmark.prototype.createAnimator):
1339         (StageBenchmark.prototype.tune):
1340         (StageBenchmark.prototype.showResults):
1341         * Animometer/tests/simple/resources/simple-canvas.js:
1342         (SimpleCanvasStage.prototype.animate):
1343         (SimpleCanvasAnimator):
1344         (SimpleCanvasAnimator.prototype.animate):
1345         (SimpleCanvasBenchmark.prototype.createAnimator):
1346         * Animometer/tests/template/resources/template-canvas.js:
1347         (TemplateCanvasStage.prototype.animate):
1348         (TemplateCanvasBenchmark.prototype.createAnimator):
1349         (window.benchmarkClient.create):
1350
1351 2015-11-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
1352
1353         Eliminate a request for layout every time an item is added to the stage of the graphics benchmark
1354         https://bugs.webkit.org/show_bug.cgi?id=151289
1355
1356         Reviewed by Simon Fraser.
1357
1358         Cache the stage size when it is created instead of requesting every time
1359         an object is added via clientWidth and clientHeight.
1360
1361         * Animometer/resources/extensions.js:
1362         (Insets.elementPadding):
1363         * Animometer/tests/resources/stage.js:
1364         (Stage):
1365         (Stage.prototype.get size):
1366
1367 2015-11-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
1368
1369         Initialize the graphics benchmark's Kalman filter with estimated 60 FPS
1370         https://bugs.webkit.org/show_bug.cgi?id=150965
1371
1372         Reviewed by Darin Adler.
1373
1374         This should give the benchmark more accurate reading at warmup time. And
1375         hence we can safely reduce the test running time to be 10 seconds.
1376
1377         * Animometer/runner/animometer.html:
1378         Add "defer" back when loading resources/animometer.js since this script
1379         depends on many other scripts and we need to wait till the page is parsed.
1380         Also change the default test interval to be 10 seconds.
1381
1382         * Animometer/runner/resources/graph.js:
1383         (graph): Make the test results curves smoother.
1384
1385         * Animometer/tests/resources/main.js:
1386         (Animator): Initialize the Kalman filter with 60 FPS which should be true
1387         if the test page is empty.
1388
1389         (Animator.prototype.animate):
1390         * Animometer/tests/resources/math.js:
1391         (KalmanEstimator): Fix the initial value of _vecX_est.
1392             _vecX_est[0] = current FPS (= 60FPS when the test page is empty)
1393             _vecX_est[1] = first time derivative of FPS (=0; FPS has been constant).
1394             _vecX_est[2] = second time derivative of FPS (=0; since _vecX_est[1]=0).
1395         (KalmanEstimator.prototype.estimate): Add some comments.
1396
1397 2015-11-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
1398
1399         Remove "defer" from the scripts' references in the graphics benchmark home page
1400         https://bugs.webkit.org/show_bug.cgi?id=150915
1401
1402         Reviewed by Simon Fraser.
1403
1404         It causes the benchmark to be very flakey.
1405
1406         * Animometer/runner/animometer.html:
1407
1408 2015-11-01  Said Abou-Hallawa  <sabouhallawa@apple,com>
1409
1410         Add an option to make the graphics benchmark runs a specific test with fixed complexity
1411         https://bugs.webkit.org/show_bug.cgi?id=150529
1412
1413         Reviewed by Darin Adler.
1414
1415         Beside each test in the suites tree, we are going to show the complexity
1416         arithmetic mean of the of the last run in an edit control. Based on a
1417         new option these edit controls will all be visible or hidden. If they are
1418         visible their values can be changed. The benchmark runner if it run in
1419         the non-adaptive mode will set the complexity of the test to the passed
1420         value and will not change it ever. The animator will animate the test and
1421         frame rate will also be measured.
1422
1423         * Animometer/runner/animometer.html: Add a new option for the non-adaptive mode.
1424
1425         * Animometer/runner/resources/animometer.css:
1426         (section#home input[type="number"]): Define the width of all the edit control in the <home> section.
1427         (section#home > suites input[type="number"]): The edit controls in the <suites> box will be right aligned and hidden by default.
1428         (section#home > suites input[type="number"].selected): When the class "selected" is added, the edit controls will be visible.
1429         (section#home > options > label > input[type="number"]): Deleted.
1430
1431         * Animometer/runner/resources/animometer.js:
1432         (window.benchmarkRunnerClient.didFinishLastIteration): Update the local storage with the results of each test.
1433         (window.optionsManager._adaptiveTestElement): Returns the checkbox for setting the adaptive test option.
1434         (window.suitesManager._editElement):  Returns the edit element associated with each test element in the suites tree.
1435         (window.suitesManager._editsElements): Returns a list of all the elements in the <suites> box.
1436         (window.suitesManager._localStorageNameForTest): Change this function to take strings.
1437         (window.suitesManager._createTestElement): Adds an edit control beside each test.
1438         (window.suitesManager.updateEditsElementsState): Adds/Removes the 'selected' class to/from all the tests edit elements.
1439         (window.suitesManager.updateUIFromLocalStorage): Reads the edit control value from the local storage.
1440         (window.suitesManager.updateLocalStorageFromUI): Saves the edit control value to the local storage.
1441         (window.suitesManager.updateLocalStorageFromJSON): Saves the last run results to the local storage.
1442         (window.benchmarkController.initialize): Shows/Hides the test edit controls based on the adaptive test option.
1443         (window.benchmarkController.onChangeAdaptiveTestCheckbox): An onchange event handler for the adaptive test checkbox.
1444
1445         * Animometer/tests/resources/main.js:
1446         (Benchmark.prototype.update): Fix the complexity of the test if the running mode is non-adaptive test and desired complexity is not zero.
1447         (window.runBenchmark): Add the test complexity as a new benchmark option.
1448
1449 2015-11-01  Said Abou-Hallawa  <sabouhallawa@apple,com>
1450
1451         Make the size of the benchmark canvas adaptive to the screen size and screen resolution
1452         https://bugs.webkit.org/show_bug.cgi?id=150530
1453
1454         Reviewed by Darin Adler.
1455
1456         We want to set the size of the benchmark stage dynamically such that it
1457         depends on the screen resolution and the device scale factor. This patch
1458         does more than that because the home page css was not done properly. To
1459         use the flex box layout, the animometer.css has to be rewritten almost from
1460         scratch. The suites tree has to be rewritten also because it was not collapsing
1461         and with the flex box layout it was going outside of the window area. The
1462         options handling and the local storage handling had to be rewritten to
1463         allow more flexibility with this patch and the future patches. The code
1464         in animometer.js was reorganized into objects to allow distributing the code
1465         nicely among separate entities.
1466
1467         * Animometer/resources/extensions.js:
1468         (Point.elementClientSize): Returns the client size of an HTMLElement as a Point object.
1469         (Insets.prototype.get width): Follow the function opening brace style guidelines.
1470         (Insets.prototype.get height):
1471         (Insets.prototype.get size): Returns the size of an Insets as a Point object.
1472
1473         (window.DocumentExtension): Provides document helper functions. It should be assailable from the runner and the tests.
1474         (window.DocumentExtension.createElement): Creates an HTMLElement given its name, attributes and parentElement.
1475         (window.DocumentExtension.createSvgElement): Creates an SVGElement given its name, attributes and parentElement (moved from utilities.js).
1476         (window.DocumentExtension.insertCssRuleAfter): Inserts a CSS rule after an exiting rule given its text.
1477
1478         (ResultsTable.prototype._showHeader): Use DocumentExtension functions.
1479         (ResultsTable.prototype._showGraph): Use DocumentExtension functions and create a real button for "Graph..." option.
1480         (ResultsTable.prototype._showJSON): Use DocumentExtension functions and create a real button for "JSON..." option.
1481         (Options): Deleted.
1482
1483         * Animometer/runner/animometer.html: Restructure the page to use the flex box layout.
1484
1485         * Animometer/runner/resources/animometer.css:
1486         (html,body):
1487         (button):
1488
1489         (button.large-button):The large button appears in the animometer.html.
1490         (button.large-button:active):
1491         (button.large-button:disabled):
1492
1493         (button.small-button): The small button appears in the results table.
1494         (button.small-button:active):
1495
1496         (.tree): The tree class is used to list the suites and their tests.
1497         (.tree .expand-button): This button expands a tree element.
1498         (.tree .expand-button ~ ul): Hide the children (<ul>...</ul>) of a parent node by default.
1499         (.tree .expand-button:checked ~ ul): Show the children of a parent node only when checked.
1500         (.tree ul): Hide the list bullets.
1501         (.tree li): Indent every node in the tree relative to its parent.
1502         (.tree ul li): Indent all the non top level nodes only (the tests nodes in our case).
1503         (.tree > li:last-child): Do not indent the bottom of the last child node.
1504         (.tree-label): Style for all the labels in the tree.
1505         (label.tree-label): Style for the labels in the top level only (the suites nodes in our case).
1506         (label.tree-label:before): Style the unchecked case of the expand-button.
1507         (:checked ~ label.tree-label:before): Style the checked case of the expand-button.
1508
1509         (table.results-table): The results table appears while running the test and at the end.
1510         (.results-table td):
1511         (.results-table th):
1512
1513         (div.results-json): The JSON div appears per test or for the whole run.
1514
1515         (main): This is the flex box container.
1516
1517         (section): A section is displayed exclusively inside the <main>. It is hidden by default.
1518         (section.selected): When it is selected, its layout is flex layout.
1519         (section > footer): The header or the footer of a section should not take more than 15% of the container.
1520
1521         (section#home): The home section has <suites> and <options> parts to be laid out in the middle.
1522         (section#home > options):
1523         (section#home > suites): The <suites> should not take more than 40% of the width.
1524         (section#home > options > label): The benchmark title.
1525         (section#home > header > h2): The benchmark title.
1526         (section#home > options > label > input[type="number"]): Sets the width of the option edit control.
1527
1528         (section#running): The running section contain the runner <iframe> which takes the whole area of the <main>.
1529         (section#running > #running-test): This is the <iframe> container.
1530         (section#running > #running-test > iframe): The <iframe> is created by the runner for each test.
1531         (section#running > #progress): This is the progress bar.
1532         (section#running > #progress > #progress-completed): This is another element which grows while the runner is progressing.
1533         (section#running > #record): This the container of the record results table which is shown while running a test.
1534
1535         (section#results):
1536         (section#json):
1537         (section#test-json):
1538         (section#test-graph): All these sections have the same layout. A <data> element is laid out between <header> and <footer>.
1539
1540         (section#results > data):
1541         (section#json > data):
1542         (section#test-json > data):
1543         (section#test-graph > data): The <data> element should take 70% of the <section>.
1544
1545         (section#test-graph > data > svg):
1546         (.axis line):
1547         (.left-samples): These styles are for the d3 graph.
1548
1549         (section#test-json > data): This is the style of the JSON <data> element.
1550
1551         (iframe): Deleted.
1552         (label, p): Deleted.
1553         (section > p): Deleted.
1554         (section#home > p): Deleted.
1555         (section#home > p:first-child): Deleted.
1556         (#testContainer): Deleted.
1557         (section#running #progress-completed): Deleted.
1558         (section#results > table): Deleted.
1559         (section#results > table td, th): Deleted.
1560         (section#results > table tr.alt, td): Deleted.
1561         (section#results > table th): Deleted.
1562         (section#json > textarea): Deleted.
1563         (.options): Deleted.
1564         (.options p): Deleted.
1565         (#suites ul): Deleted.
1566         (#suites ul ul): Deleted.
1567         (#suites ul ul input, #suites ul ul label): Deleted.
1568         (#suites.showTests ul ul): Deleted.
1569         (.column): Deleted.
1570         (input[type="number"]): Deleted.
1571         (.buttons): Deleted.
1572         (.small-button): Deleted.
1573         (#graphContainer): Deleted.
1574         (.right-samples): Deleted.
1575         (.sample-time): Deleted.
1576         (.left-mean): Deleted.
1577         (.right-mean): Deleted.
1578
1579         * Animometer/runner/resources/animometer.js:
1580         (window.benchmarkRunnerClient.initialize): Initialize the client object with the options and the suites.
1581         (window.benchmarkRunnerClient.willStartFirstIteration): Use new css selectors for results and the record table.
1582         (window.benchmarkRunnerClient.didFinishLastIteration): Move the code which sets the JSON text to sectionsManager.showJSON().
1583
1584         (window.sectionsManager): Responsible of managing the <section>s elements inside animometer.html.
1585         (window.sectionsManager._sectionHeaderH1Element): Return the <h1> inside the <header> of a given section.
1586         (window.sectionsManager._sectionDataDivElement): Return the <div> inside the <data> of a given section.
1587         (window.sectionsManager.showScore): Show the score of the last benchmark run.
1588         (window.sectionsManager.showTestName): Show the test name for detailed results <section>.
1589         (window.sectionsManager.showJSON): Shows the JSON text of the last benchmark or for a specific test.
1590         (window.sectionsManager.showSection): Shows a specific <section> in the <main> container.
1591         (window.sectionsManager.setupSectionStyle): Sets css attributes for all the <section>s.
1592         (window.sectionsManager.setupRunningSectionStyle): Sets the css attributes for the running <section> only.
1593
1594         (window.optionsManager): Responsible of managing the user options and streaming them to/form the localStorage.
1595         (window.optionsManager._optionsElements): Returns the children <input> elements of the <options>.
1596         (window.optionsManager.updateUIFromLocalStorage): Restore the values of the <options> UI elements from the local storage.
1597         (window.optionsManager.updateLocalStorageFromUI): Saves the values of the <options> UI elements to the local storage.
1598
1599         (window.suitesManager): Responsible of managing the user suites and streaming them to/form the localStorage.
1600         (window.suitesManager._treeElement): Returns the suites tree container element.
1601         (window.suitesManager._suitesElements): Returns a list of the suites elements.
1602         (window.suitesManager._checkboxElement): Returns the checkbox element of a given suite.
1603         (window.suitesManager._localStorageNameForTest): Generates a string for the tuple <suite, test> to be saved in the localStorage.
1604         (window.suitesManager._updateSuiteCheckboxState): Updates the state of a suite checkbox from the state of its tests' checkboxes.
1605         (window.suitesManager._updateStartButtonState): Updates the state of the start button from the state of the suites' checkboxes.
1606         (window.suitesManager._onChangeSuiteCheckbox): Called when a suite checkbox is clicked.
1607         (window.suitesManager._onChangeTestCheckbox): Called when a test checkbox is clicked.
1608         (window.suitesManager._createSuiteElement): Creates suite node in the suites tree.
1609         (window.suitesManager._createTestElement): Creates test node in the suites tree.
1610         (window.suitesManager.createElements): Creates the suites tree dynamically from the array Suites.
1611         (window.suitesManager.updateUIFromLocalStorage): Restore the values of the <suites> UI elements from the local storage.
1612         (window.suitesManager.updateLocalStorageFromUI): aves the values of the <suites> UI elements to the local storage.
1613
1614         (window.benchmarkController): This is the UI controller of the animometer.html page.
1615         (window.benchmarkController.initialize): Called when the animometer.html page is loaded.
1616         (window.benchmarkController._runBenchmark): Starts a benchmark run.
1617         (window.benchmarkController.startTest): Called when the "Start Test" button is clicked.
1618         (window.benchmarkController.showResults): Called at the end of the test to show the final results.
1619         (window.benchmarkController.showJson): Called from the results page to show the JSON of the last benchmark run.
1620         (window.benchmarkController.showTestGraph): Called from the results the table to show a graph for the samples of a specific test.
1621         (window.benchmarkController.showTestJSON): Called from the results the table to show a JSON for the samples of a specific test.
1622
1623         (showSection): Deleted.
1624         (startTest): Deleted.
1625         (showResults): Deleted.
1626         (showJson): Deleted.
1627         (showTestGraph): Deleted.
1628         (showTestJSON): Deleted.
1629         (initialize.toggleTestsCheckbox.onchange): Deleted.
1630         (initialize): Deleted.
1631         (updateSuiteSelection): Deleted.
1632         (updateTestSelection): Deleted.
1633         (updateSuiteCheckbox): Deleted.
1634         (localStorageNameForTest): Deleted.
1635         (populateSettings.): Deleted.
1636         (populateSettings): Deleted.
1637
1638         * Animometer/runner/resources/benchmark-runner.js:
1639         (BenchmarkRunner): Pass the frameContainer element to the BenchmarkRunner.
1640         (BenchmarkRunner.prototype._appendFrame): Remove unused parameter unwanted styling code.
1641         (BenchmarkRunner.prototype.runMultipleIterations):  Use the this._client.iterationCount instead of passing it as a parameter also.
1642
1643         * Animometer/runner/resources/graph.js:
1644         (graph): Calculate the size of the chart from the container element.
1645
1646         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
1647         (BouncingSvgImage):
1648         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
1649         (BouncingSvgParticlesStage.prototype._createDefs):
1650         (BouncingSvgParticlesStage.prototype._createClipStar):
1651         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1652         (BouncingSvgShape.prototype._createShape):
1653         (BouncingSvgShapesStage.prototype.createGradient):
1654         Call DocumentExtension.createSvgElement() instead of calling Utilities.createSvgElement().
1655
1656         * Animometer/tests/resources/main.js:
1657         (Animator.prototype.animate):
1658         (Benchmark):
1659         (Benchmark.prototype.update):
1660         * Animometer/tests/resources/stage.js:
1661         (StageBenchmark.prototype.showResults):
1662         Rename the options to match the <input> ids in animometer.html.
1663
1664         * Animometer/tests/resources/utilities.js:
1665         (window.Utilities.createSvgElement): Deleted.
1666
1667         * Animometer/tests/text/layering-text.html:
1668         * Animometer/tests/text/resources/layering-text.js:
1669         (LayeringTextStage):
1670         (LayeringTextStage.prototype._setFontSize): Sets the size of the text dynamically such that they all fit in one stage.
1671
1672 2015-10-29  Simon Fraser  <simon.fraser@apple.com>
1673
1674         Animometer computes frame rate incorrectly
1675         https://bugs.webkit.org/show_bug.cgi?id=150698
1676
1677         Reviewed by Tim Horton.
1678
1679         The existing code incremented this._frameCount after checking against this._dropFrameCount.
1680         This has the effect of setting this._measureTimeOffset one frame too late, so
1681         we were measuring only two frames, not three, and thus computing an incorrect fps.
1682
1683         * Animometer/tests/resources/main.js:
1684         (Animator.prototype.animate):
1685
1686 2015-10-27  Jon Lee  <jonlee@apple.com>
1687
1688         Add an option to make the graphics benchmark runs a specific test
1689         https://bugs.webkit.org/show_bug.cgi?id=150528
1690         rdar://problem/23246614
1691
1692         Reviewed by Zalan Bujtas.
1693
1694         Add a checkbox that lets the user list all of the available tests, and select
1695         the ones to run repeatedly. The test checkboxes will update the state of the suite
1696         checkbox. The selected tests are stored in localStorage to make it easy to do
1697         repeated runs.
1698
1699         * Animometer/runner/animometer.html: Add a checkbox to show individual tests.
1700         Update other markup.
1701         * Animometer/runner/resources/animometer.css: Make the settings area a little wider
1702         to accommodate the longer names of the tests
1703         * Animometer/runner/resources/animometer.js:
1704         (startBenchmark): Change the way that the suites are fed into the benchmark
1705         runner. Go through each of the suites and their tests, and create a new Suite
1706         with just the enabled tests. While enumerating store the enabled tests into
1707         localStorage.
1708         (initialize): Initialization routine (taking over populateSettings). When the
1709         checkbox for showing tests is toggled, add or remove a class on #suites to show
1710         the individual tests.
1711         (updateSuiteSelection): Called whenever the user toggles the checkbox for a suite.
1712         Either select all or none of the tests.
1713         (updateTestSelection): Called whenever the user toggles the checkbox for a test.
1714         (updateSuiteCheckbox): Update the state of the test's suite's checkbox to
1715         indeterminate if there is at least one enabled test, unchecked if none are selected,
1716         and checked if all are selected.
1717         (localStorageNameForTest): Helper function to get the name of the test to use as
1718         a key to localStorage.
1719         (populateSettings): Add the tests for each suite into an inner list.
1720
1721 2015-10-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
1722
1723         Add an option to output the results of the graphics benchmark in JSON format
1724         https://bugs.webkit.org/show_bug.cgi?id=150484
1725         <rdar://problem/23243721>
1726
1727         Reviewed by Darin Adler.
1728
1729         * Animometer/resources/extensions.js:
1730         (ResultsDashboard): A new class to hold the iterations results.
1731         (ResultsDashboard.prototype.push): Appends an iteration results;
1732         (ResultsDashboard.prototype.toJSON): Converts the iterations results to JSON format.
1733
1734         (RecordTable.prototype.clear): Clears the results table.
1735         (RecordTable.prototype._showTitles): Shows the header titles and appends the sub-titles to a queue.
1736         (RecordTable.prototype._showHeader): Shows the table header titles.
1737         (RecordTable.prototype._showEmpty): Shows an empty table cell.
1738         (RecordTable.prototype._showValue): Shows a number value in the results table.
1739         (RecordTable.prototype._showSamples): Shows a button for the sampled data graph.
1740         (RecordTable.prototype._showTest): Shows the results of a single test.
1741         (RecordTable.prototype._showSuite): Shows the results of a single suite.
1742         (RecordTable.prototype.showRecord): Shows a single iteration for a single test.
1743         (RecordTable.prototype.showIterations): Shows the results of all the suites of the iterations.
1744
1745         (ResultsTable): RecordTable was renamed to ResultsTable.
1746         (ResultsTable.prototype.clear): Clears the table element.
1747         (ResultsTable.prototype._showHeaderRow): Shows a row in the results table header.
1748         (ResultsTable.prototype._showHeader): Shows the results table header.
1749         (ResultsTable.prototype._showEmpty): Shows an empty table cell.
1750         (ResultsTable.prototype._showText): Shows a string in a new table cell.
1751         (ResultsTable.prototype._showFixedNumber): Shows a number in a new table cell.
1752         (ResultsTable.prototype._showGraph): Shows a button for the sampled data graph.
1753         (ResultsTable.prototype._showJSON): Shows a button for the sampled data JSON.
1754         (ResultsTable.prototype._showTest): Shows the results of a single test.
1755         (ResultsTable.prototype._showSuite): Shows the results of a single suite.
1756         (ResultsTable.prototype._showIteration): Shows the results of a single iteration.
1757         (ResultsTable.prototype.showRecord): Shows a single iteration for a single test.
1758         (ResultsTable.prototype.showIterations): Shows all the results.
1759         (RecordTable): Deleted.
1760         (RecordTable.prototype.clear): Deleted.
1761         (RecordTable.prototype._showTitles): Deleted.
1762         (RecordTable.prototype._showHeader): Deleted.
1763         (RecordTable.prototype._showEmpty): Deleted.
1764         (RecordTable.prototype._showValue): Deleted.
1765         (RecordTable.prototype._showSamples): Deleted.
1766         (RecordTable.prototype._showTest): Deleted.
1767         (RecordTable.prototype._showSuite): Deleted.
1768         (RecordTable.prototype.showRecord): Deleted.
1769         (RecordTable.prototype.showIterations): Deleted.
1770
1771         * Animometer/resources/sampler.js:
1772         (Sampler.prototype.startSampling): Use forEach.
1773         (Sampler.prototype.sample): Use forEach.
1774         (Sampler.prototype.toJSON): Converts the sampler data to JSON format.
1775
1776         * Animometer/resources/strings.js: Added.
1777         This new file will be used to associate the strings used by the benchmark
1778         with IDs. A string can be changed in one place without having to change
1779         all the instances of this string in multiple files. There two groups of
1780         strings in this file. The first one is used by the UI elements and the second
1781         group is used when constructing the results JSON.
1782
1783         * Animometer/runner/animometer.html:
1784         * Animometer/runner/resources/animometer.css:
1785
1786         * Animometer/runner/resources/animometer.js:
1787         (window.benchmarkRunnerClient.willAddTestFrame):
1788         (window.benchmarkRunnerClient.willStartFirstIteration):
1789         (window.benchmarkRunnerClient.didRunSuites):
1790         (window.benchmarkRunnerClient.didFinishLastIteration):
1791         Make benchmarkRunnerClient uses ResultsDashboard instead of _iterationsSamplers
1792         Get the JSON from ResultsDashboard.toJSON() and pass it to ResultsTable.showIterations().
1793         Also set the textContent of the "#json" textarea with the results JSON.
1794
1795         (showResults): Delete unneeded code.
1796         (showJson): Shows the "json" section.
1797         (showTestGraph): Rename showGraph() to be showTestGraph().
1798         (showTestJSON): Shows the JSON of a single testResults.
1799         (showGraph): Deleted.
1800
1801         * Animometer/runner/resources/tests.js:
1802         Use the string table instead of putting literal strings.
1803
1804         * Animometer/tests/resources/stage.js:
1805         (StageBenchmark.prototype.showResults):
1806         Fix the parameters which are passed to RecordTable.showRecord().
1807
1808         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
1809         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
1810         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
1811         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
1812         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
1813         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
1814         * Animometer/tests/examples/canvas-electrons.html:
1815         * Animometer/tests/examples/canvas-stars.html:
1816         * Animometer/tests/simple/simple-canvas-paths.html:
1817         * Animometer/tests/template/template-canvas.html:
1818         * Animometer/tests/template/template-css.html:
1819         * Animometer/tests/template/template-svg.html:
1820         * Animometer/tests/text/layering-text.html:
1821         Include the new strings.js file in all the test files.
1822
1823 2015-10-12  Jon Lee  <jonlee@apple.com>
1824
1825         Add canvas line dash test
1826         https://bugs.webkit.org/show_bug.cgi?id=150078
1827         <rdar://problem/23082347>
1828
1829         Reviewed by Dean Jackson.
1830
1831         * Animometer/runner/resources/tests.js: Add line dash test.
1832         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1833         (CanvasLineDashStage): Create a new stage with a default dash pattern and stroke style.
1834         Maintain a step which will animate the dash.
1835         (CanvasLineDashStage.prototype.animate): Render the line path with the dash. Increment
1836         the dash offset to animate.
1837         (CanvasPathBenchmark.prototype.createStage): Add the test.
1838
1839 2015-10-12  Jon Lee  <jonlee@apple.com>
1840
1841         Add canvas line path tests
1842         https://bugs.webkit.org/show_bug.cgi?id=150076
1843         <rdar://problem/23082285>
1844
1845         Reviewed by Dean Jackson.
1846
1847         * Animometer/runner/resources/tests.js: Add new line path tests, with different
1848         line joins.
1849         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1850         (CanvasLinePathStage): The stage is the same as the SimpleCanvasPathStrokeStage
1851         but sets the lineJoin on the context.
1852         (CanvasPathBenchmark.prototype.createStage): Add the tests.
1853
1854 2015-10-12  Jon Lee  <jonlee@apple.com>
1855
1856         Add missing paint objects for arc and arcTo fills
1857         https://bugs.webkit.org/show_bug.cgi?id=150075
1858         <rdar://problem/23082233>
1859
1860         Reviewed by Dean Jackson.
1861
1862         * Animometer/tests/simple/resources/simple-canvas-paths.js: Add missing paint objects
1863         for arcTo and arc segment fills.
1864         (CanvasArcToSegmentFill):
1865         (CanvasArcToSegmentFill.prototype.draw):
1866         (CanvasArcSegmentFill):
1867         (CanvasArcSegmentFill.prototype.draw):
1868
1869 2015-10-12  Jon Lee  <jonlee@apple.com>
1870
1871         Add canvas line segment tests
1872         https://bugs.webkit.org/show_bug.cgi?id=150073
1873         <rdar://problem/23082138>
1874
1875         Reviewed by Dean Jackson.
1876
1877         * Animometer/runner/resources/tests.js: Add new line segment tests, with different
1878         line caps.
1879         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1880         (CanvasLineSegment): Add new line segment paint object.
1881         (CanvasLineSegmentStage): Create a new stage that sets the lineCap.
1882
1883 2015-10-12  Jon Lee  <jonlee@apple.com>
1884
1885         Add canvas path fill tests
1886         https://bugs.webkit.org/show_bug.cgi?id=150071
1887         <rdar://problem/23082001>
1888
1889         Reviewed by Dean Jackson.
1890
1891         * Animometer/runner/resources/tests.js: Add new pathTypes for path fills.
1892         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1893         (CanvasLinePoint): Add basic point for a line, and call lineTo.
1894         (SimpleCanvasPathFillStage): Add a new stage similar to SimpleCanvasPathStrokeStage.
1895         (CanvasPathBenchmark.prototype.createStage): Add the tests.
1896
1897 2015-10-12  Jon Lee  <jonlee@apple.com>
1898
1899         Add canvas path tests
1900         https://bugs.webkit.org/show_bug.cgi?id=150067
1901         rdar://problem/23081463
1902
1903         Reviewed by Dean Jackson.
1904
1905         * Animometer/runner/resources/tests.js: Add a quadratic and bezier path test.
1906
1907         * Animometer/tests/simple/resources/simple-canvas.js:
1908         (SimpleCanvasStage.prototype.tune): This kind of test joins all of the segments
1909         into one long path, and tries to render that one path. Random points make it
1910         difficult to tell what is going on, so add a parameter to the constructor to
1911         confine the area where the random coordinates can land. The more complicated the
1912         case is, the larger an area the path will cover. Add an artificial minimum so
1913         that the first 200 points aren't confined to a space that is too small.
1914
1915         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1916         (SimpleCanvasPathStrokeStage): Add a new kind of stage that inherits from
1917         SimpleCanvasStage. Each time the frame animates a random line width and stroke
1918         color are chosen. The path setup is done outside of each paint object.
1919         (CanvasQuadraticPoint): This point just calls quadraticCurveTo.
1920         (CanvasPathBenchmark.prototype.createStage): Add the tests.
1921
1922 2015-10-12  Jon Lee  <jonlee@apple.com>
1923
1924         Add basic canvas tests
1925         https://bugs.webkit.org/show_bug.cgi?id=150066
1926         rdar://problem/23081143
1927
1928         Reviewed by Dean Jackson.
1929
1930         This adds a new test suite that will cover all of the path-based canvas calls.
1931         The patch will be divided up to cover tests with similar techniques.
1932
1933         The simplest version uses a SimpleCanvasStage.
1934
1935         * Animometer/runner/resources/tests.js: Add tests for quadratic, bezier, arcTo,
1936         arc, and rect segments. Also include arcTo, arc, and rect fills.
1937         * Animometer/tests/resources/stage.js:
1938         (Stage.prototype.randomBool): Added for counterclockwise property for arc segments.
1939         (Stage.prototype.randomInt): Fix how values are rounded, used by randomBool. It should
1940         round instead of flooring everything.
1941         * Animometer/tests/simple/resources/simple-canvas.js: Added. Defines common classes
1942         used by all simple canvas tests. The page reads best bottom to top.
1943         (SimpleCanvasStage): Basic stage. Pass a canvasObject which will be used to create new
1944         objects as needed in tune().
1945         (SimpleCanvasStage.prototype.tune): Modeled on other tests. Adds and removed objects
1946         as specified by the provided |count|.
1947         (SimpleCanvasStage.prototype.animate): Iterate over all the objects and ask them to draw.
1948         There is no "animating" of the objects; they will just paint statically on the canvas.
1949         (SimpleCanvasAnimator): Basic animator clears the canvas prior to painting.
1950         (SimpleCanvasBenchmark): Hard-code the feedback loop parameters instead of including
1951         them in the query parameters to the test URLs.
1952         (SimpleCanvasBenchmark.prototype.createAnimator):
1953         * Animometer/tests/simple/simple-canvas-paths.html: Added.
1954
1955         * Animometer/tests/simple/resources/simple-canvas-paths.js: Added. There is no "animating"
1956         of these objects--they just paint statically on the canvas.
1957         (CanvasQuadraticSegment): Paint a quadratic segment stroke.
1958         (CanvasBezierSegment): Paint a bezier segment stroke.
1959         (CanvasArcToSegment): Paint an arcTo stroke.
1960         (CanvasArcSegment): Paint an arc stroke.
1961         (CanvasRect): Paint a rect.
1962         (CanvasRectFill): Paint a filled rect.
1963
1964         (CanvasPathBenchmark):
1965         (CanvasPathBenchmark.prototype.createStage): Look for the pathType and create the
1966         stage using the right paint object.
1967         (window.benchmarkClient.create):
1968
1969 2015-10-12  Jon Lee  <jonlee@apple.com>
1970
1971         Refactor tune() to pass in an integer-based count
1972         https://bugs.webkit.org/show_bug.cgi?id=150060
1973         <rdar://problem/23079425>
1974
1975         Reviewed by Dean Jackson.
1976
1977         All of the tune functions do an initial step of flooring the
1978         # of painting objects to add or remove. Factor that out since
1979         the complexity of all of these tests is always expressed in terms
1980         of countable items.
1981
1982         * Animometer/tests/resources/main.js:
1983         (Benchmark.prototype.update): Update the tuneValue.
1984
1985         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1986         (BouncingParticlesStage.prototype.tune): Remove the count adjustment.
1987         * Animometer/tests/examples/resources/canvas-electrons.js:
1988         (CanvasElectronsStage.prototype.tune): Ditto.
1989         * Animometer/tests/examples/resources/canvas-stars.js:
1990         (CanvasStarsStage.prototype.tune): Ditto.
1991         * Animometer/tests/text/resources/layering-text.js:
1992         (LayeringTextStage.prototype.tune): Ditto.
1993
1994 2015-10-12  Jon Lee  <jonlee@apple.com>
1995
1996         Store test-interval in localStorage
1997         https://bugs.webkit.org/show_bug.cgi?id=150055
1998         <rdar://problem/23078879>
1999
2000         Reviewed by Dean Jackson.
2001
2002         * Animometer/runner/resources/animometer.js:
2003         (populateSettings): Keep track of the specified test interval in localStorage
2004         to make it easy to repeat a test suite.
2005
2006 2015-10-12  Jon Lee  <jonlee@apple.com>
2007
2008         Remove "../tests/" from the URLs of all tests
2009         https://bugs.webkit.org/show_bug.cgi?id=150054
2010         <rdar://problem/23078784>
2011
2012         Reviewed by Dean Jackson.
2013
2014         Presumably all tests will be running from the tests/ directory,
2015         so we don't have to specify it in all of the test URLs.
2016
2017         * Animometer/runner/resources/benchmark-runner.js:
2018         (BenchmarkRunnerState.prototype.prepareCurrentTest): Prepend
2019         "../tests/" to all tests.
2020         * Animometer/runner/resources/tests.js: Remove "../tests/" from
2021         all URLs.
2022
2023 2015-10-12  Jon Lee  <jonlee@apple.com>
2024
2025         Refactor test suites to a separate class.
2026         https://bugs.webkit.org/show_bug.cgi?id=150053
2027         <rdar://problem/23078645>
2028
2029         Reviewed by Dean Jackson.
2030
2031         Create a Suite class to refactor out prepare() and run().
2032         Generate the checkboxes representing the suites using Suites
2033         instead of maintaining a separate list. Also, save the
2034         selections out to localStorage.
2035
2036         * Animometer/runner/animometer.html: Remove the explicitly listed
2037         suites. These will be generated from Suites instead.
2038         * Animometer/runner/resources/animometer.js:
2039         (populateSettings): Iterate through Suites, and create the
2040         label and checkbox. Attach the Suite object to the checkbox so
2041         when the benchmark is started, we get direct access. Initialize
2042         the checkmark based on its value in localStorage. Set this to
2043         run when DOMContentLoaded is dispatched.
2044         (startBenchmark): Grab all of the checkboxes, inspect their
2045         values, add it to enabledSuites if selected. Remember whether
2046         the suite was enabled in localStorage, so that it's easy to do
2047         repeated runs.
2048         * Animometer/runner/resources/tests.js:
2049         (Suite): Create a new Suite class. Refactor out prepare() and
2050         run(), since all of them have the same implementation. Populate
2051         Suites with Suite instances instead of generic objects.
2052
2053 2015-10-12  Jon Lee  <jonlee@apple.com>
2054
2055         Update graph styles for legibility.
2056         https://bugs.webkit.org/show_bug.cgi?id=150052
2057         <rdar://problem/23078503>
2058
2059         Reviewed by Dean Jackson.
2060
2061         * Animometer/runner/resources/animometer.css: Update colors and
2062         stroke thicknesses to make the graphs easier to read.
2063         (.smaple-time): Correct to .sample-time
2064         * Animometer/runner/resources/graph.js:
2065         (graph): Ditto.
2066
2067 2015-10-12  Jon Lee  <jonlee@apple.com>
2068
2069         Update graph styles for legibility.
2070         https://bugs.webkit.org/show_bug.cgi?id=150052
2071         <rdar://problem/23078503>
2072
2073         Reviewed by Dean Jackson.
2074
2075         * Animometer/runner/resources/animometer.css: Update colors and
2076         stroke thicknesses to make the graphs easier to read.
2077         (.smaple-time): Correct to .sample-time
2078         * Animometer/runner/resources/graph.js:
2079         (graph): Ditto.
2080
2081 2015-10-12  Filip Pizlo  <fpizlo@apple.com>
2082
2083         Unreviewed, revert an unintended commit.
2084
2085         * JetStream/Octane2/crypto.js:
2086         (montRevert):
2087         (montReduce):
2088
2089 2015-10-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
2090
2091         Add a graphics benchmark
2092         https://bugs.webkit.org/show_bug.cgi?id=149053
2093         <rdar://problem/18984169>
2094
2095         Reviewed by Dean Jackson.
2096
2097         Instead of measuring the FPS of the animation, this benchmark measures the
2098         test complexity when rendering at a set-point FPS which should be lower
2099         than 60 FPS. This benchmark tries to stay at the set-point FPS by using
2100         a closed loop control system PID function. The gain of the system is passed
2101         as a parameter when running the test. Measuring the FPS faithfully results
2102         very fluctuating values. A Kalman filter is used to give a better estimate
2103         for the current FPS.
2104
2105         The animation of the tests is done manually. requestAnimationFrame() is
2106         called with a callback. Inside this callback, the test is animating by
2107         changing the positions of the elements inside the page. The test complexity
2108         may change also if the current FPS is not equal to the desired FPS.
2109
2110         In this patch, the benchmark and the tests are included. The shared code
2111         and the tests runner are included in separate patches.
2112
2113         * Animometer/runner/animometer.html:
2114         * Animometer/runner/resources/animometer.js:
2115         Add two new examples for more complex animation techniques.
2116         Add an option to show/hide the test running results which is off by default.
2117
2118         * Animometer/runner/resources/tests.js: Added.
2119         (suiteFromName): Returns a suite given its name.
2120         (testFromName): Returns a test given its suite and name.
2121
2122         * Animometer/tests: Added.
2123         This directory includes all the test suites to be run by the benchmark.
2124         runner. All the tests should try to run on three stages: CSS, canvas and
2125         SVG.
2126
2127         * Animometer/tests/bouncing-particles: Added.
2128         * Animometer/tests/bouncing-particles/resources: Added.
2129         The bouncing particles test is an example of a simple animation technique.
2130
2131         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Added.
2132         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Added.
2133         * Animometer/tests/bouncing-particles/bouncing-css-images.html: Added.
2134         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: Added.
2135         * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Added.
2136         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Added.
2137         Bouncing particles test pages.
2138
2139         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Added.
2140         (BouncingParticle): Base class for a bouncing particle.
2141         (BouncingParticle.prototype.center): Returns the center point or the particle.
2142         (BouncingParticle.prototype.animate): Moves the particle based on its current position, angle and velocity.
2143
2144         (BouncingParticlesAnimator): A sub class of Animator.
2145
2146         (BouncingParticlesStage): Represents the container of all the bouncing particles.
2147         (BouncingParticlesStage.prototype.parseShapeParamters): Gets the shape parameters for shape animating tests.
2148         (BouncingParticlesStage.prototype.randomRotater): Creates a rotater for the particles.
2149         (BouncingParticlesStage.prototype.animate): Animates all the particles.
2150         (BouncingParticlesStage.prototype.tune): Changes the test by adding or removing particles.
2151
2152         (BouncingParticlesBenchmark): Runs the benchmark for bouncing particles test.
2153         (BouncingParticlesBenchmark.prototype.createAnimator): Creates an animator of type BouncingParticlesAnimator.
2154
2155         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: Added.
2156         (BouncingCssShape): A sub class of BouncingParticle for animating CSS shapes.
2157         (BouncingCssShape.prototype._createSpan): Creates a <span> element and takes the shape and clipping classes into consideration.
2158         (BouncingCssShape.prototype._move): Moves the particle to a new location. Apply transform since it does not require layout.
2159         (BouncingCssShape.prototype.animate): Rotates and moves the shape to a new location.
2160
2161         (BouncingCssShapesStage): A sub class of BouncingParticlesStage for animating CSS shapes.
2162         (BouncingCssShapesStage.prototype.createParticle): Creates a particle of type BouncingCssShape.
2163         (BouncingCssShapesStage.prototype.particleWillBeRemoved): Removes the corresponding element form the parent children list.
2164
2165         (BouncingCssShapesBenchmark): A sub class of BouncingParticlesBenchmark for animating CSS shapes.
2166         (BouncingCssShapesBenchmark.prototype.createStage): Creates a stage of type BouncingCssShapesStage.
2167         (window.benchmarkClient.create): Creates a benchmark of type BouncingCssShapesBenchmark.
2168
2169         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js: Added.
2170         (BouncingCssImage): A sub class of BouncingParticle for animating CSS images.
2171         (BouncingCssImage.prototype._move): Move the particle to a new location. Apply transform since it does not require layout.
2172         (BouncingCssImage.prototype.animate): Rotates and moves the shape to a new location.
2173
2174         (BouncingCssImagesStage): A sub class of BouncingParticlesStage for animating CSS images.
2175         (BouncingCssImagesStage.prototype.createParticle): Creates a particle of type BouncingCssImage.
2176         (BouncingCssImagesStage.prototype.particleWillBeRemoved): Removes the corresponding element form the parent children list.
2177
2178         (BouncingCssImagesBenchmark): A sub class of BouncingParticlesBenchmark for animating CSS images.
2179         (BouncingCssImagesBenchmark.prototype.createStage): Creates a stage of type BouncingCssImagesStage.
2180         (window.benchmarkClient.create): Creates a benchmark of type BouncingCssImagesBenchmark.
2181
2182         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Added.
2183         (BouncingCanvasParticle): A base sub-class of BouncingParticle for animating canvas particles.
2184         (BouncingCanvasParticle.prototype._applyRotation): Apply the particle rotation-around-center transform to the canvas context.
2185         (BouncingCanvasParticle.prototype._applyClipping): Apply the particle clipping to the canvas context.
2186         (BouncingCanvasParticle.prototype._draw): A non-implemented version of the drawing function.
2187         (BouncingCanvasParticle.prototype.animate): Carries out all the steps to redraw the canvas particle.
2188
2189         (BouncingCanvasParticlesStage): A base sub-class of BouncingParticlesStage for animating canvas particles.
2190
2191         (BouncingCanvasParticlesAnimator): A concrete sub-class of BouncingParticlesAnimator for animating canvas particles.
2192         (BouncingCanvasParticlesAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.
2193
2194         (BouncingCanvasParticlesBenchmark): A base sub-class of StageBenchmark for animating canvas particles.
2195         (BouncingCanvasParticlesBenchmark.prototype.createAnimator): Creates the canvas particles animator.
2196
2197         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Added.
2198         (BouncingCanvasShape): A concrete sub-class of BouncingCanvasParticle for animating canvas shapes.
2199         (BouncingCanvasShape.prototype._applyFill): Sets the fillStyle in the canvas context.
2200         (BouncingCanvasShape.prototype._drawShape): Carries out the actual drawing.
2201         (BouncingCanvasShape.prototype._draw): Carries out all the steps to draw the shape.
2202
2203         (BouncingCanvasShapesStage): A concrete sub-class of BouncingCanvasParticle for animating canvas shapes.
2204         (BouncingCanvasShapesStage.prototype.createParticle): Creates a particle of type BouncingCanvasShape.
2205
2206         (BouncingCanvasShapesBenchmark): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas shapes.
2207         (BouncingCanvasShapesBenchmark.prototype.createStage): Creates a stage of type BouncingCanvasShapesStage.
2208         (window.benchmarkClient.create): Creates a benchmark of type BouncingCanvasShapesBenchmark.
2209
2210         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Added.
2211         (BouncingCanvasImage): A concrete sub-class of BouncingCanvasParticle for animating canvas images.
2212         (BouncingCanvasImage.prototype._draw): Draws an image on the context of a canvas.
2213
2214         (BouncingCanvasImagesStage): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas images.
2215         (BouncingCanvasImagesStage.prototype.createParticle): Creates a particle of type BouncingCanvasImage.
2216
2217         (BouncingCanvasImagesBenchmark): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas images.
2218         (BouncingCanvasImagesBenchmark.prototype.createStage): Creates a stage of type BouncingCanvasImagesStage.
2219         (window.benchmarkClient.create): Creates a benchmark of type BouncingCanvasImagesBenchmark.
2220
2221         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: Added.
2222         (BouncingSvgParticle): A base sub-class of BouncingParticle for animating SVG particles.
2223         (BouncingSvgParticle.prototype._applyClipping): Apply the particle clipping by setting the 'clip-path' attribute of the SVGElement.
2224         (BouncingSvgParticle.prototype._move): Moves the particle to a new location. Apply transform since it does not require layout.
2225         (BouncingSvgParticle.prototype.animate): Rotates and moves the shape to a new location.
2226         (BouncingSvgParticlesStage): A sub class of BouncingParticlesStage for animating SVGElements.
2227         (BouncingSvgParticlesStage.prototype._createDefs): Creates an SVGDefsElement.
2228         (BouncingSvgParticlesStage.prototype._ensureDefsIsCreated): Ensures there is only one SVGDefsElement is created.
2229         (BouncingSvgParticlesStage.prototype._createClipStar): Creates an SVGClipPathElement and sets its 'd' attribute to a star like shape.
2230         (BouncingSvgParticlesStage.prototype.ensureClipStarIsCreated): Ensure there is only one star SVGClipPathElement is created.
2231         (BouncingSvgParticlesStage.prototype.particleWillBeRemoved): Remove the corresponding element form the parent children list.
2232
2233         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js: Added.
2234         (BouncingSvgShape): A concrete sub-class of BouncingSVGParticle for animating SVG shapes.
2235         (BouncingSvgShape.prototype._createShape): Creates an SVG shape.
2236         (BouncingSvgShape.prototype._applyFill): Applies the selected fill style to the SVG shape.
2237
2238         (BouncingSvgShapesStage): A concrete sub-class of BouncingSvgParticlesStage for animating SVG shapes.
2239         (BouncingSvgShapesStage.prototype.createGradient): Creates an SVGLinearGradientElement.
2240         (BouncingSvgShapesStage.prototype.createParticle): Creates a particle of type BouncingSvgShape.
2241         (BouncingSvgShapesStage.prototype.particleWillBeRemoved): Ensures the attached SVGLinearGradientElement is removed from the SVGDefsElement.
2242
2243         (BouncingSvgShapesBenchmark): A concrete sub-class of BouncingParticlesBenchmark for animating SVG images.
2244         (BouncingSvgShapesBenchmark.prototype.createStage): Creates a stage of type BouncingSvgShapesStage.
2245         (window.benchmarkClient.create): Creates a benchmark of type BouncingSvgShapesBenchmark.
2246
2247         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: Added.
2248         (BouncingSvgImage): A concrete sub-class of BouncingSVGParticle for animating SVG images.
2249
2250         (BouncingSvgImagesStage): A concrete sub-class of BouncingSVGParticlesBenchmark for animating SVG images.
2251         (BouncingSvgImagesStage.prototype.createParticle): Creates a particle of type BouncingSvgImage.
2252
2253         (BouncingSvgImagesBenchmark): A concrete sub-class of BouncingParticlesBenchmark for animating SVG images.
2254         (BouncingSvgImagesBenchmark.prototype.createStage): Creates a stage of type BouncingSvgImagesStage.
2255         (window.benchmarkClient.create): Creates a benchmark of type BouncingSvgImagesBenchmark.
2256
2257         * Animometer/tests/examples: Added.
2258         * Animometer/tests/examples/canvas-electrons.html: Added.
2259         * Animometer/tests/examples/canvas-stars.html: Added.
2260         Examples test pages.
2261
2262         * Animometer/tests/examples/resources: Added.
2263         * Animometer/tests/examples/resources/canvas-electrons.js: Added.
2264         (CanvasElectron): An object which draws and animate a electron object on a canvas stage.
2265         (CanvasElectron.prototype._draw): Draws the electron object.
2266         (CanvasElectron.prototype.animate): Animates the electron object.
2267
2268         (CanvasElectronsStage): A concrete sub-class of Stage for animating electrons.
2269         (CanvasElectronsStage.prototype.tune): Changes the test by adding or removing elements.
2270         (CanvasElectronsStage.prototype.animate): Animates the test elements.
2271
2272         (CanvasElectronsAnimator): A concrete sub-class of StageAnimator for animating canvas electrons.
2273         (CanvasElectronsAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.
2274
2275         (CanvasElectronsBenchmark): A concrete sub-class of StageBenchmark for animating electrons.
2276         (CanvasElectronsBenchmark.prototype.createStage): Creates a stage of CanvasElectronsStage.
2277         (CanvasElectronsBenchmark.prototype.createAnimator): Creates an animator of type CanvasElectronsAnimator.
2278         (window.benchmarkClient.create): Creates a benchmark of type CanvasElectronsBenchmark.
2279
2280         * Animometer/tests/examples/resources/canvas-stars.js: Added.
2281         (CanvasStar): An object which draws and animate a star object on a canvas stage.
2282         (CanvasStar.prototype._draw): Draws the star object.
2283         (CanvasStar.prototype.animate): Animates the star object.
2284
2285         (CanvasStarsStage): A concrete sub-class of Stage for animating stars.
2286         (CanvasStarsStage.prototype.tune): Changes the test by adding or removing elements.
2287         (CanvasStarsStage.prototype.animate): Animates the test elements.
2288
2289         (CanvasStarsAnimator): A concrete sub-class of StageAnimator for animating canvas stars.
2290         (CanvasStarsAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.
2291
2292         (CanvasStarsBenchmark): A concrete sub-class of Benchmark for animating stars.
2293         (CanvasStarsBenchmark.prototype.createStage): Creates a stage of CanvasStarsStage.
2294         (CanvasStarsBenchmark.prototype.createAnimator): Creates an animator of type CanvasStarsAnimator.
2295         (window.benchmarkClient.create): Creates a benchmark of type CanvasStarsBenchmark.
2296
2297         * Animometer/tests/resources: Added.
2298         This directory includes the script which is required to run an adaptive
2299         graphics benchmark. From an empty test page, the set of classes in this
2300         directory are responsible for measuring the current frame rate and
2301         changing the test to reach a desired FPS. It keeps asking the test page
2302         to tune itself by a certain value to increase or decrease the frame rate.
2303         It's also responsible for sampling the test state and the corresponding
2304         frame rate.
2305
2306         * Animometer/tests/resources/main.js: Added.
2307         (BenchmarkState): Tracks the state of the benchmark test.
2308         (BenchmarkState.prototype._timeOffset): Returns the timeOffset of a stage.
2309         (BenchmarkState.prototype._message): Returns the message of a stage.
2310         (BenchmarkState.prototype.update): Sets the currentTimeOffset to a new value.
2311         (BenchmarkState.prototype.samplingTimeOffset): Returns the timeOffset of the sampling stage.
2312         (BenchmarkState.prototype.currentStage): Returns the current stage of the benchmark.
2313         (BenchmarkState.prototype.currentMessage): Returns the message of the current stage and timeOffset.
2314         (BenchmarkState.prototype.currentProgress): Returns a percentage of how much the benchmark is running.
2315
2316         (Animator): Manages animating the test.
2317         (Animator.prototype.start): Called if animating using setInterval is requested.
2318         (Animator.prototype.timeDelta): Returns the current timeDelta
2319         (Animator.prototype.animate): Manages the test animation.
2320         (Animator.prototype.animateLoop): Called if animating using requestAnimationFrame is requested.
2321
2322         (Benchmark): Manages running the test benchmark and recording the sampled data.
2323         (Benchmark.prototype.start): Starts the benchmark.
2324         (Benchmark.prototype.update): Called from the animator.animate() to change the complexity of the test.
2325         (Benchmark.prototype.record): Shows the current (not final) results of the benchmark.
2326         (Benchmark.prototype.resolveWhenFinished): Spins until the benchmark is finished and returns its results.
2327         (Benchmark.prototype.run): Starts the test, runs it, waits until it is finished and return its results.
2328         (window.runBenchmark): Called from the benchmark runner through the suite controller run-callback.
2329
2330         * Animometer/tests/resources/math.js: Added.
2331         (Matrix): A matrix object.
2332         (Vector3): A vector of size 3 object.
2333         (Matrix3): A matrix of size 3x3 object.
2334
2335         (PIDController): Closed-loop controller for a set-point y.
2336         (PIDController.prototype._sat): Limits the output to a certain range.
2337         (PIDController.prototype.tune): Given the current output of a system, it produces a new pid value for tuning it.
2338
2339         (KalmanEstimator): Implement Kalman filter to get an estimate for a sampled data point.
2340         (KalmanEstimator.prototype.estimate): Returns an estimate for for a sampled data point.
2341
2342         * Animometer/tests/resources/utilities.js: Added.
2343         (window.Utilities._parse): Given a separator character, it pareses a string to a set of <key, value> pairs.
2344         (window.Utilities.parseParameters): Parses a test parameters.
2345         (window.Utilities.parseArguments): Parses a tag arguments.
2346         (window.Utilities.extendObject): Adds the attributes and their values of an object to another object.
2347         (window.Utilities.copyObject): Copies the attributes and their values of an object to a new object.
2348         (window.Utilities.mergeObjects): Copies the attributes and their values of two objects to a new object.
2349         (window.Utilities.createSvgElement): Creates an SVGElement given its name and its attributes.
2350
2351         * Animometer/tests/resources/stage.css: Added.
2352         * Animometer/tests/resources/stage.js: Added.
2353         (Rotater): Manages rotating an angle within a fixed time interval.
2354         (Rotater.prototype.get interval): Returns the time interval which is required to rotate 360 degrees.
2355         (Rotater.prototype.next): Moves the current time by a delta.
2356         (Rotater.prototype.degree): Returns the current rotating degree.
2357         (Rotater.prototype.rotateZ): Returns CSS formatted transform rotateZ() string for the current degree.
2358         (Rotater.prototype.rotate): Returns SVG formatted transform rotate() string for the current degree.
2359
2360         (Stage): A base class for managing the test complexity and test animation.
2361         (Stage.prototype.get size): Returns the size of the stage excluding the CSS padding.
2362         (Stage.prototype.random): Returns a random float.
2363         (Stage.prototype.randomInt): Returns a random integer.
2364         (Stage.prototype.randomPosition): Returns a random position.
2365         (Stage.prototype.randomSquareSize): Returns a square size.
2366         (Stage.prototype.randomVelocity): Returns a random velocity.
2367         (Stage.prototype.randomAngle): Returns a random angle.
2368         (Stage.prototype.randomColor): Returns a random color not too dark and not too light.
2369         (Stage.prototype.randomRotater): Creates a random rotater. Its velocity depends on choosing a random rotation time interval.
2370         (Stage.prototype.tune): A not-implemented version of this function.
2371         (Stage.prototype.animate): A not-implemented version of this function.
2372         (Stage.prototype.clear): Clears the stage from all its animation elements.
2373
2374         (StageAnimator): A base class for the stage-based animators.
2375         (StageAnimator.prototype.animate): Calls Animator.animate() which updates the test page and then calls Stage.animate() to force redraw.
2376
2377         (StageBenchmark): A base class for the stage-based benchmarks.
2378         (StageBenchmark.prototype.createStage): Creates the default stage.
2379         (StageBenchmark.prototype.createAnimator): Creates the default animator.
2380         (StageBenchmark.prototype.tune): Delegates the call to stage.
2381         (StageBenchmark.prototype.clear): Delegates the call to stage.
2382         (StageBenchmark.prototype.showResults): Shows the results/progress through its recordTable and progressBar.
2383
2384         * Animometer/tests/resources/yin-yang.png: Added.
2385         * Animometer/tests/resources/yin-yang.svg: Added.
2386         These images are shared among all the tests.
2387
2388         * Animometer/tests/template: Added.
2389         * Animometer/tests/template/resources: Added.
2390         This directory includes template tests which do nothing. They can be used
2391         to author new tests. Animated items can be created, moved and redrawn by
2392         removing the TODO comments in the script files and writing actual code.
2393
2394         * Animometer/tests/template/template-css.html: Added.
2395         * Animometer/tests/template/template-canvas.html: Added.
2396         * Animometer/tests/template/template-svg.html: Added.
2397         Template test pages. They can be used as they are. CSS attributes or hidden
2398         elements can be added to these derived test pages if needed.
2399
2400         * Animometer/tests/template/resources/template-css.js: Added.
2401
2402         (TemplateCssStage): A stage to create and animate HTMLElements.
2403         (TemplateCssStage.prototype.tune): Changes the test by adding or removing elements.
2404         (TemplateCssStage.prototype.animate): Animates the test elements.
2405         (TemplateCssBenchmark):
2406         (TemplateCssBenchmark.prototype.createStage): Creates the test stage.
2407         (window.benchmarkClient.create): Creates a benchmark of type TemplateCssBenchmark.
2408
2409         * Animometer/tests/template/resources/template-canvas.js: Added.
2410         (TemplateCanvasObject):
2411         (TemplateCanvasObject.prototype._draw): Draws the objects on the canvas context.
2412         (TemplateCanvasObject.prototype.animate): Moves and redraws the object.
2413         (TemplateCanvasStage): A stage to create and animate drawing elements.
2414         (TemplateCanvasStage.prototype.tune): hanges the test by adding or removing elements.
2415         (TemplateCanvasStage.prototype.animate):  Animates the test elements.
2416         (TemplateCanvasAnimator.prototype.animate): Starts the animation every frame.
2417         (TemplateCanvasBenchmark):
2418         (TemplateCanvasBenchmark.prototype.createStage): Creates a stage of type TemplateCanvasStage.
2419         (TemplateCanvasBenchmark.prototype.createAnimator): Creates a animator of type TemplateCanvasAnimator.
2420         (window.benchmarkClient.create): Creates a benchmark of type TemplateCanvasBenchmark.
2421
2422         * Animometer/tests/template/resources/template-svg.js: Added.
2423         (TemplateSvgStage): A stage to create and animate SVGElements.
2424         (TemplateSvgStage.prototype.tune): Changes the test by adding or removing elements.
2425         (TemplateSvgStage.prototype.animate): Animates the test elements.
2426         (TemplateSvgBenchmark.prototype.createStage): Creates a stage of type TemplateSvgStage.
2427         (window.benchmarkClient.create): Creates a benchmark of type TemplateSvgBenchmark.
2428
2429         * Animometer/tests/text: Added.
2430         * Animometer/tests/text/resources: Added.
2431         This directory includes the text animating tests which currently runs
2432         on CSS stage only.
2433
2434         * Animometer/tests/text/layering-text.html: Added.
2435         Text test page.
2436
2437         * Animometer/tests/text/resources/layering-text.js: Added.
2438         (LayeringTextStage): Represents the container of all the stacked text layers.
2439         (LayeringTextStage.parseTextItem): Parses a textItem which may be an opening tag, a closing tag or a self-closing tag.
2440         (LayeringTextStage.isOpeningTextItem): Returns true if the textItem is an opening tag e.g. '<ol>'.
2441         (LayeringTextStage.isClosingTextItem): Returns true if  the textItem is an closing tag e.g. '</ol>.
2442         (LayeringTextStage.textItemsFlags.LayeringTextStage.textItems.map): Calculates and stores isOpening and isClosing flags for each textItem.
2443         (LayeringTextStage.isColorableTextItem): Returns true if the textItem is self-closing tag e.g. '<p>...</p>'.
2444         (LayeringTextStage.isInsertableTextItem): Returns true if the textItems causes a new element to be added to the text layers.
2445         (LayeringTextStage.colorableTextItems.LayeringTextStage.textItemsFlags.filter): Number of colorable textItems.
2446         (LayeringTextStage.insertableTextItems.LayeringTextStage.textItemsFlags.filter): Number of insertable textItems.
2447         (LayeringTextStage.colorIndexToTextElementIndex): Maps from colorIndex [0..colorableTextItems-1] to textElementIndex [0..insertableTextItems-1].
2448         (LayeringTextStage.prototype._nextTextItem): Moves the _textItemIndex one step forward in a loop [0..LayeringTextStage.textItems.length-1].
2449         (LayeringTextStage.prototype._previousTextItem): Moves the _textItemIndex one step backward in a loop.
2450         (LayeringTextStage.prototype._pushTextElement): Creates a new textItemElement and adds it to the topmost container <div>.
2451         (LayeringTextStage.prototype._popTextElement): Removes the last textItemElement from the topmost container <div>.
2452         (LayeringTextStage.prototype._colorTextItem): Changes the background color of a single colorable textElement. The index advances in a circle [0..colorableTextItems-1].
2453         (LayeringTextStage.prototype.animate): Changes the background color and the text color of the textElements such that a redraw is enforced.
2454         (LayeringTextStage.prototype.tune): Adds or removes textElements to the stage.
2455
2456         (LayeringTextBenchmark): Runs the benchmark for the layering text test.
2457         (LayeringTextBenchmark.prototype.createStage): Creates a stage of type LayeringTextStage.
2458         (window.benchmarkClient.create): Creates a benchmark of type LayeringTextBenchmark.
2459
2460 2015-10-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
2461
2462         Add shared code for a new a graphics benchmark
2463         https://bugs.webkit.org/show_bug.cgi?id=149691
2464
2465         Reviewed by Ryosuke Niwa.
2466
2467         This set of classes will be shared and used by the tests and the runner
2468         of a new graphics benchmark.
2469
2470         * Animometer/resources: Added.
2471         * Animometer/resources/algorithm.js: Added.
2472         (Array.prototype.swap): Swaps two elements in an array.
2473         (Heap): Binary Min/Max Heap object
2474         (Heap.prototype._parentIndex): Given the child node index, it returns the parent index.
2475         (Heap.prototype._leftIndex): Given the parent node index, it returns the left node index.
2476         (Heap.prototype._rightIndex): Given the parent node index, it returns the right node index.
2477         (Heap.prototype._childIndex): Given the parent node index, it returns the child index that may violate the heap property.
2478         (Heap.prototype.init): Initializes the heap state.
2479         (Heap.prototype.top): Returns the value stored at the top of the heap.
2480         (Heap.prototype.push): Pushes a new node at the top of the heap.
2481         (Heap.prototype.pop): Extracts the top node of the heap.
2482         (Heap.prototype._bubble): Fixes the heap property by moving upward.
2483         (Heap.prototype._sink): Fixes the heap property by moving downward.
2484         (Heap.prototype.str): Prints the nodes of the heap to a string.
2485         (Heap.prototype.values): Returns the last "size" heap elements values.
2486
2487         (Algorithm.createMinHeap): Creates a size-bounded min-heap object.
2488         (Algorithm.createMaxHeap): Creates a size-bounded max-heap object.
2489
2490         * Animometer/resources/extensions.js: Added.
2491         (Point): Point object but can be used as size also.
2492         (Point.pointOnCircle): Given, the radius of the circle and the angle of the point, it returns a point object.
2493         (Point.pointOnEllipse): Given, the radiuses of the ellipse and the angle of the point, it returns a point object.
2494         (Point.prototype.get width): Should be called when the point is used as size.
2495         (Point.prototype.get height): Should be called when the point is used as size.
2496         (Point.prototype.get center): Should be called when the point is used as size.
2497         (Point.prototype.add): Returns a new point = this + other.
2498         (Point.prototype.subtract): Returns a new point = this - other.
2499         (Point.prototype.multiply): Returns a new point = this * other.
2500         (Point.prototype.move): Moves the point in a given direction, velocity, time period.
2501
2502         (Insets): Represents borders of a container.
2503         (Insets.prototype.get width): Returns left + right.
2504         (Insets.prototype.get height): Returns top + bottom.
2505
2506         (SimplePromise):
2507         (SimplePromise.prototype.then):
2508         (SimplePromise.prototype.resolve):
2509         Moved from Animometer/runner/resources/benchmark-runner.js since tests also need it.
2510
2511         (Options): Benchmark running options as they are set by the user.
2512
2513         (ProgressBar): Manages a progress bar element. The progress bar is divided into equal length ranges.
2514         (ProgressBar.prototype._progressToPercent): Converts the progress into a percentage.
2515         (ProgressBar.prototype.incRange): Moves to the next range (a range is the running time of a single test).
2516         (ProgressBar.prototype.setPos): Draws the current progress in the current range.
2517
2518         (RecordTable): Shows the results of running a benchmark in a tabular form.
2519         (RecordTable.prototype.clear): Clears the results table.
2520         (RecordTable.prototype._showTitles): Shows the header titles and appends the sub-titles to a queue.
2521         (RecordTable.prototype._showHeader): Shows the table header titles.
2522         (RecordTable.prototype._showEmpty): Shows an empty table cell.
2523         (RecordTable.prototype._showValue): Shows a number value in the results table.
2524         (RecordTable.prototype._showSamples): Shows a button for the sampled data graph.
2525         (RecordTable.prototype._showTest): Shows the results of a single test.
2526         (RecordTable.prototype._showSuite): Shows the results of a single suite.
2527         (RecordTable.prototype.showRecord): Shows a single iteration for a single test.
2528         (RecordTable.prototype.showIterations): Shows the results of all the suites of the iterations.
2529
2530         * Animometer/resources/sampler.js: Added.
2531         (Statistics.sampleMean): Returns the sample mean.
2532         (Statistics.unbiasedSampleStandardDeviation): Returns the unbiased sample variance (i.e. with Bessel's correction)
2533         (Statistics.geometricMean): Returns the geometric mean.
2534
2535         (Experiment): Represents a sampling experiment.
2536         (Experiment.prototype._init): Called when the object is created and when startSampling() is called.
2537         (Experiment.prototype.startSampling): Called after warmup period. Restarts collecting sampled data points.
2538         (Experiment.prototype.sample): Add a new data point.
2539         (Experiment.prototype.mean): Returns the sample mean for the current sampled data points.
2540         (Experiment.prototype.standardDeviation): Returns the sample standard deviation for the current sampled data points.
2541         (Experiment.prototype.percentage): Returns the percentage of the standard deviation divided to the mean.
2542         (Experiment.prototype.confidenceIntervalDelta): Calculates the confidence delta for the current sampled data given a confidence level.
2543         (Experiment.prototype.concern): Returns the average of the worst given percentage from the sampled data.
2544         (Experiment.prototype.score): Returns a score for the sampled data. It is the geometric mean of sampleMean and concern.
2545
2546         (Sampler): Represents a compound experiment. It manages sampling multiple data points at the same time offset.
2547         (Sampler.prototype.startSampling): Called after warming up period. Restarts collecting sampled data points.
2548         (Sampler.prototype.sample): Add a new data vector at a given time offset.
2549
2550 2015-10-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
2551
2552         Add the test runner for a new a graphics benchmark
2553         https://bugs.webkit.org/show_bug.cgi?id=149683
2554
2555         Reviewed by Ryosuke Niwa.
2556
2557         The test runner collects the selected test suites and the running options
2558         from its home page. It loops through all the tests, runs them and collects
2559         their running results. At the end, it shows summary results and a final
2560         score. It can also show a chart for a test sampled data.
2561
2562         * Animometer: Added.
2563         * Animometer/runner: Added.
2564         * Animometer/runner/resources: Added.
2565
2566         * Animometer/runner/animometer.html: Added.
2567         * Animometer/runner/resources/animometer.css: Added.
2568         The benchmark runner page and css.
2569
2570         * Animometer/runner/resources/animometer.js: Added.
2571         (window.benchmarkRunnerClient.willAddTestFrame): Called after the test <iframe> is created.
2572         (window.benchmarkRunnerClient.didRunTest): Called after running a test is finished.
2573         (window.benchmarkRunnerClient.willStartFirstIteration): Called at the beginning before running any test.
2574         (window.benchmarkRunnerClient.didRunSuites): Called after running all tests of a suite.
2575         (window.benchmarkRunnerClient.didFinishLastIteration): Called after running the last test.
2576
2577         (showSection): Shows a section in the animometer.html page.
2578         (startTest): Called when the "Start Test" button is clicked.
2579         (showResults): Called after finishing all the tests.
2580         (showGraph): Called when "Click..." button in the "Samples" column of the results table is clicked
2581
2582         * Animometer/runner/resources/benchmark-runner.js: Copied from PerformanceTests/Speedometer/resources/benchmark-runner.js.
2583         (BenchmarkRunnerState): Tracks the current running <suite, test>
2584         (BenchmarkRunnerState.prototype.currentSuite): Returns the current running suite.
2585         (BenchmarkRunnerState.prototype.currentTest): Returns the current running test.
2586         (BenchmarkRunnerState.prototype.isFirstTest): Returns true if we are running the first test in the current suite.
2587         (BenchmarkRunnerState.prototype.next): Advances to the next test.
2588         (BenchmarkRunnerState.prototype.prepareCurrentTest): Creates a new <iframe> and waits for it to load a test.
2589
2590         (BenchmarkRunner): Manages running the tests and communicating with the benchmarkRunnerClient.
2591         (BenchmarkRunner.prototype.waitForElement): Waits for an element to be created.
2592         (BenchmarkRunner.prototype._appendFrame): Creates a new <iframe> element.
2593         (BenchmarkRunner.prototype._removeFrame): Removed the current <iframe> element.
2594         (BenchmarkRunner.prototype._runTestAndRecordResults): Runs the current test and saves its results.
2595         (BenchmarkRunner.prototype.step): Either runs the current test if there is or start a new iteration.
2596         (BenchmarkRunner.prototype.runAllSteps): Loops to run all the tests and move to the next iteration.
2597         (this._runNextIteration): Starts a new iteration or show the results.
2598         (BenchmarkRunner.prototype.runMultipleIterations): Loops to run all the iterations and show the results
2599         (BenchmarkRunner.prototype._finalize): Finalizes the current iteration and starts a new one.
2600
2601         (SimplePromise): Deleted.
2602         (SimplePromise.prototype.then): Deleted.
2603         (SimplePromise.prototype.resolve): Deleted.
2604         (BenchmarkTestStep): Deleted.
2605         (Fibonacci): Deleted.
2606         SimplePromise was moved t Animometer/resources/extensions.js because it is used by the runner and the tests.
2607
2608         (BenchmarkRunner.prototype._waitAndWarmUp): Deleted.
2609         (BenchmarkRunner.prototype._runTest): Deleted.
2610         (BenchmarkState.prototype.currentSuite): Deleted.
2611         (BenchmarkState.prototype.currentTest): Deleted.
2612         (BenchmarkState.prototype.next): Deleted.
2613         (BenchmarkState.prototype.isFirstTest): Deleted.
2614         (BenchmarkState.prototype.prepareCurrentSuite): Deleted.
2615         BenchmarkState was renamed to BenchmarkRunnerState to not be confused with the tests BenchmarkState.
2616
2617         * Animometer/runner/resources/d3.min.js: Copied from Websites/perf.webkit.org/public/v2/js/d3/d3.min.js.
2618         Needed for drawing charts for the sampled scores and frame rates.
2619
2620         * Animometer/runner/resources/graph.js: Added.
2621         (graph): Draws a chart for a test sampled data. It shows two y-axes: one for the animated items and the second for FPS.
2622
2623         * Skipped: Skip the Animometer benchmark for now.
2624
2625 2015-08-27  Csaba Osztrogonác  <ossy@webkit.org>
2626
2627         [EFL] REGRESSION(r188793): It made 200 layout tests and Bindings/event-target-wrapper.html performance test fail
2628         https://bugs.webkit.org/show_bug.cgi?id=148470
2629
2630         Unreviewed gardening, skip the hanging test to make the performance bot work.
2631
2632         * Skipped:
2633
2634 2015-08-17  Chris Dumez  <cdumez@apple.com>
2635
2636         Add performance tests for traversal of collections returned by getElementsByClassName() / getElementsByTagName()
2637         https://bugs.webkit.org/show_bug.cgi?id=148080
2638
2639         Reviewed by Antti Koivisto.
2640
2641         Add performance tests for traversal of *uncached* collections returned
2642         by getElementsByClassName() / getElementsByTagName(). These methods
2643         will soon be updated to return an HTMLCollection instead of a
2644         NodeList and we need to make sure we don't regress performance in the
2645         process.
2646
2647         * DOM/get-elements-by-class-name-traversal-uncached.html: Added.
2648         * DOM/get-elements-by-tag-name-traversal-uncached.html: Added.
2649
2650 2015-08-14  Chris Dumez  <cdumez@apple.com>
2651
2652         Add performance tests for NodeList and HTMLCollection traversal
2653         https://bugs.webkit.org/show_bug.cgi?id=148043
2654
2655         Reviewed by Gavin Barraclough.
2656
2657         Add performance tests for NodeList and HTMLCollection traversal.
2658         Ideally, those 2 tests should be as fast. However, due to inefficiencies
2659         in our HTMLCollection bindings code, the HTMLCollection tests is ~30%
2660         slower. This will be addressed in the near future.
2661
2662         * Bindings/childNodes-traversal.html: Added.
2663         * Bindings/children-traversal.html: Added.
2664
2665 2015-08-05  Myles C. Maxfield  <mmaxfield@apple.com>
2666
2667         Add a second font-fallback performance test
2668         https://bugs.webkit.org/show_bug.cgi?id=147692
2669
2670         Reviewed by Ryosuke Niwa.
2671
2672         This test is smaller, but has more realistic content. Also, it uses the "lang" attribute.
2673
2674         * Layout/font-fallback-2.html: Added.
2675         * Layout/resources/font-fallback-2.html: Added.
2676
2677 2015-07-13  Filip Pizlo  <fpizlo@apple.com>
2678
2679         Update JetStream version number to 1.1.
2680
2681         Rubber stamped by Ryosuke Niwa.
2682
2683         * JetStream/create.rb:
2684
2685 2015-06-30  Filip Pizlo  <fpizlo@apple.com>
2686
2687         Update the JetStream documentation to reflect the recent changes
2688         https://bugs.webkit.org/show_bug.cgi?id=146474
2689
2690         Reviewed by Geoffrey Garen.
2691
2692         * JetStream/create.rb: Bump the version.
2693         * JetStream/in-depth-TEMPLATE.html: Add cdjs documentation. Remove cordic documentation. Change documentation for splay and mandreel.
2694
2695 2015-06-26  Filip Pizlo  <fpizlo@apple.com>
2696
2697         [JetStream] Raise the percentile of mandreel-latency and splay-latency
2698         https://bugs.webkit.org/show_bug.cgi?id=146378
2699
2700         Reviewed by Mark Lam.
2701
2702         The current percentile is 95%.  When I looked at the sample lists in our GC, it was
2703         clear that the worst 5% samples completely amortize our GC pauses.  Our GC pauses can
2704         be quite bad.  Clearly, splay-latency is meant to test whether we have an incremental
2705         GC that ensures that you don't have bad worst-case pauses.  But 95% is too small,
2706         because it doesn't really capture those pauses.  Raising the percentile to above 99%
2707         appears to do the trick.  99.5% or more seems like a good bet.  The trade-off there is
2708         just that if we set it too high, then we won't have enough statistics.  Doing this very
2709         clearly rewards GCs that are incremental, and punishes GCs that aren't (like ours).
2710         That's what we want, since in the future we want to use this test to guide any
2711         improvements to the worst-case performance of our GC.
2712
2713         The way that the percentile is selected will also affect mandreel-latency.  That's a
2714         good thing, because 95% is probably too low for that test as well.  That test ends up
2715         with >10k samples.  The goal of using 95% in the first place was to get enough samples
2716         to have a stable average.  But if we have >10k samples, we can push that percentile up
2717         much higher and still get good statistics while achieving the effect we want - i.e.
2718         getting the worst case.
2719
2720         I don't think that we need to do the same thing for cdjs.  That test only takes 200
2721         samples, so 95% means we report the average of the worst 10 samples.  That's probably
2722         good enough.
2723
2724         * JetStream/Octane2/base.js: Raise the percentile as described above.
2725         (BenchmarkSuite.prototype.RunSingleBenchmark):
2726         * JetStream/Reference.js: Tweak the reference times to bring the latency tests closer to 100ish on my machine.
2727         * JetStream/create.rb: Bump the version.
2728
2729 2015-06-19  Filip Pizlo  <fpizlo@apple.com>
2730
2731         Run CDjs as part of JSC stress testing
2732         https://bugs.webkit.org/show_bug.cgi?id=146174
2733
2734         Reviewed by Geoffrey Garen.
2735
2736         * JetStream/cdjs/cdjs-tests.yaml: Added. This tells JSC stress tests what tests to run. It uses new syntax ("tests" being a list) that I add in this change.
2737         * JetStream/cdjs/main.js: Mark this as a slow test.
2738         * JetStream/create.rb: Don't copy the JSC stress tests artifacts into the JetStream bundle.
2739
2740 2015-06-19  Filip Pizlo  <fpizlo@apple.com>
2741
2742         Unreviewed, fix a small indentation goof.
2743
2744         * JetStream/cdjs/motion.js:
2745         (Motion.prototype.findIntersection):
2746
2747 2015-06-19  Filip Pizlo  <fpizlo@apple.com>
2748
2749         JetStream should include a JavaScript version of the CDx real-time benchmark
2750         https://bugs.webkit.org/show_bug.cgi?id=146156
2751
2752         Reviewed by Geoffrey Garen.
2753
2754         This adds a JavaScript port of the CDx real-time benchmark to JetStream, and retires
2755         the cordic test because it was previously the smallest and probably least interesting.
2756
2757         The new test, "cdjs", is mostly a faithful rewrite of the Java code into JavaScript.
2758         I got the Java code from https://www.cs.purdue.edu/sss/projects/cdx/.
2759
2760         There are some differences:
2761
2762         - It uses RedBlackTree's for all sets and maps rather than hashtables. This is clearly
2763           more in the spirit of real-time than the CDx benchmark. FWIW, CDx used to use trees
2764           and I don't know why that changed in the latest version.
2765
2766         - CDjs doesn't attempt to avoid memory allocations, unlike the real-time Java version.
2767           I wrote the code that I wanted to write for aesthetics, rather than the code that I
2768           would have written if I tried to write the fastest code possible. Again, I believe
2769           that this is in the spirit of CDj - it's meant to test what would happen if you wrote
2770           real-timey stuff in a high level language and actually took advantage of that
2771           language to be more productive.
2772
2773         The test score reflects the average latency of the worst 10 samples out of 200 samples.
2774         The simulation uses 1000 aircraft, flying along paths that result in some detected
2775         collisions every once in a while. The benchmark validates its results by checking the
2776         total number of collisions detected.
2777
2778         Apart from the integration into the JetStream harness, the CDjs directory contains a
2779         fully self-contained benchmark that could be run either in the jsc shell or in browser.
2780
2781         This new code uses the same 3-clause BSD license as the Purdue code, and gives
2782         attribution to Purdue in almost all files. I believe that is appropriate since I wrote
2783         most of the JS files by looking at the Purdue Java code and trascribing to JavaScript.
2784         In some cases, I even copy-pasted the Java code, like the complicated math for
2785         four-dimensional intersections and voxel hashing.
2786
2787         * JetStream/CDjsSetup.js: Added.
2788         * JetStream/Octane2Setup.js:
2789         * JetStream/Reference.js:
2790         * JetStream/cdjs: Added.
2791         * JetStream/cdjs/benchmark.js: Added.
2792         (benchmark):
2793         * JetStream/cdjs/call_sign.js: Added.
2794         (CallSign):
2795         (CallSign.prototype.compareTo):
2796         (CallSign.prototype.toString):
2797         * JetStream/cdjs/collision.js: Added.
2798         (Collision):
2799         (Collision.prototype.toString):
2800         * JetStream/cdjs/collision_detector.js: Added.
2801         (CollisionDetector):
2802         (CollisionDetector.prototype.handleNewFrame.get for):
2803         (CollisionDetector.prototype.handleNewFrame):
2804         * JetStream/cdjs/constants.js: Added.
2805         * JetStream/cdjs/main.html: Added.
2806         * JetStream/cdjs/main.js: Added.
2807         * JetStream/cdjs/motion.js: Added.
2808         (Motion):
2809         (Motion.prototype.toString):
2810         (Motion.prototype.delta):
2811         (Motion.prototype.findIntersection):
2812         * JetStream/cdjs/motion_test.js: Added.
2813         (checkDoesIntersect):
2814         (checkDoesNotIntersect):
2815         (makeMotion):
2816         * JetStream/cdjs/red_black_tree.js: Added.
2817         (RedBlackTree):
2818         (RedBlackTree.):
2819         * JetStream/cdjs/red_black_tree_test.js: Added.
2820         (test):
2821         (test.):
2822         * JetStream/cdjs/reduce_collision_set.js: Added.
2823         (drawMotionOnVoxelMap):
2824         (drawMotionOnVoxelMap.):
2825         (.get reduceCollisionSet):
2826         * JetStream/cdjs/reduce_collision_set_test.js: Added.
2827         (makeMotion):
2828         (keys):
2829         (test):
2830         * JetStream/cdjs/simulator.js: Added.
2831         (Simulator):
2832         (Simulator.prototype.simulate):
2833         * JetStream/cdjs/util.js: Added.
2834         (compareNumbers):
2835         (averageAbovePercentile):
2836         (currentTime):
2837         (else.currentTime):
2838         * JetStream/cdjs/vector_2d.js: Added.
2839         (Vector2D):
2840         (Vector2D.prototype.plus):
2841         (Vector2D.prototype.minus):
2842         (Vector2D.prototype.toString):
2843         (Vector2D.prototype.compareTo):
2844         * JetStream/cdjs/vector_3d.js: Added.
2845         (Vector3D):
2846         (Vector3D.prototype.plus):
2847         (Vector3D.prototype.minus):
2848         (Vector3D.prototype.dot):
2849         (Vector3D.prototype.squaredMagnitude):
2850         (Vector3D.prototype.magnitude):
2851         (Vector3D.prototype.times):
2852         (Vector3D.prototype.as2D):
2853         (Vector3D.prototype.toString):
2854         * JetStream/create.rb:
2855         * JetStream/index-TEMPLATE.html:
2856         * JetStream/sunspider/cordic.js: Removed.
2857
2858 2015-06-17  Javier Fernandez  <jfernandez@igalia.com>
2859
2860         [CSS Grid Layout] We should add performance tests for stretching logic
2861         https://bugs.webkit.org/show_bug.cgi?id=146063
2862
2863         Reviewed by Sergio Villar Senin.
2864
2865         Added a new performance test for Grid Layout to ensure there are no
2866         regressions in the stretching alignment logic.
2867
2868         * Layout/fixed-grid-lots-of-stretched-data.html: Added.
2869
2870 2015-06-17  Javier Fernandez  <jfernandez@igalia.com>
2871
2872         [CSS Grid Layout] Performance tests are using the old syntax
2873         https://bugs.webkit.org/show_bug.cgi?id=146061
2874
2875         Reviewed by Sergio Villar Senin.
2876
2877         Adapted tests to the new grid tracks definition syntax.
2878
2879         * Layout/auto-grid-lots-of-data.html:
2880         * Layout/fixed-grid-lots-of-data.html:
2881
2882 2015-06-08  Filip Pizlo  <fpizlo@apple.com>
2883
2884         JetStream should have a more rational story for jitter-oriented latency tests
2885         https://bugs.webkit.org/show_bug.cgi?id=145762
2886
2887         Reviewed by Geoffrey Garen.
2888
2889         JetStream has some latency tests that are meant to measure jitter.  Prior to this change, they
2890         did this by computing the RMS.  But the RMS is a pretty bad metric.  The thing that it rewards
2891         isn't really the thing that you'd want your browser to do.  These RMS-based tests involve taking
2892         the geomean of the RMS of some samples and the sample average.  The lower the geomean, the better
2893         (in the JetStream harness we then invert the scores so that higher is better, but let's ignore
2894         that for this discussion and assume that lower is better).  Here's an example of how this can go
2895         bad.  A browser that always computes a task in some horribly long time (say, 1000ms) but never
2896         varies that time will perform better than a browser that usually computes the task super quickly
2897         (say, 10ms) and sometimes just a little bit less quickly (say, 15ms).  The former browser will
2898         have an RMS of 0 and an average of 1000.  The latter will have a RMS somewhere around 3.5 and an
2899         average of 12.5 (assuming equal probability of 10ms and 15ms).  The geomean of (0, 1000) is 0.
2900         The geomean of (3.5, 12.5) is 6.6.  Lower is better, so the former browser scores higher - even
2901         though it's obviously never better to have a browser always complete a task in 1000ms when a
2902         different browser can do it in 15ms in the worst case.
2903
2904         JetStream should not have this pathology.  The right way of avoiding it is to replace RMS with
2905         some other metric of how bad things get.  A good metric is the average of the worst percentile.
2906         The worst 1% or the worst 5% would be good things to average.  This will catch cases where the VM
2907         jittered due to JIT or GC, but it never have the pathology that we end up giving the better score
2908         to a VM whose best case is worst than another VM's worst case.
2909
2910         For now, this change uses the highest samples above the 95% percentile. I'm not yet sure if that
2911         is the best thing - it might include too many scores that are around the best-case performance -
2912         but it's certainly better than RMS and it might be good enough to keep. But because of that
2913         uncertainty, I'm setting the version to be "1.1-alpha1" to indicate that we aren't ready to
2914         release this yet.
2915
2916         * JetStream/Octane2/base.js:
2917         (.this.Setup.setup.setup):
2918         (.this.TearDown.tearDown.tearDown):
2919         (BenchmarkSuite.GeometricMeanTime):
2920         (BenchmarkSuite.AverageAbovePercentile):
2921         (BenchmarkSuite.GeometricMeanLatency):
2922         (BenchmarkSuite.prototype.NotifyStep):
2923         (BenchmarkSuite.prototype.RunSingleBenchmark):
2924         * JetStream/Octane2/mandreel.js:
2925         (setupMandreel):
2926         (updateMandreelStats):
2927         (startMandreelTimer):
2928         (latencyMandreel):
2929         (tearDownMandreel):
2930         (RMSMandreel): Deleted.
2931         * JetStream/Octane2/splay.js:
2932         (GenerateKey):
2933         (SplayUpdateStats):
2934         (InsertNewNode):
2935         (SplayTearDown):
2936         (SplayRMS): Deleted.
2937         * JetStream/create.rb:
2938
2939 2015-06-03  Zalan Bujtas  <zalan@apple.com>
2940
2941         Skip Dromaeo/jslib-modify-prototype.html for now.
2942
2943         Unreviewed gardening.
2944
2945         * Skipped:
2946
2947 2015-05-04  Filip Pizlo  <fpizlo@apple.com>
2948
2949         Large array shouldn't be slow
2950         https://bugs.webkit.org/show_bug.cgi?id=144617
2951
2952         Reviewed by Geoffrey Garen.
2953
2954         Add the hash-map benchmark to LongSpider. LongSpider was already not a perfect match of
2955         SunSpider. It's not an official benchmark. It contains benchmarks that are relatively
2956         long-running. So, hash-map sort of belongs here.
2957
2958         * LongSpider/hash-map.js: Added.
2959         (HashMap):
2960         (HashMap.):
2961         (.get var):
2962
2963 2015-05-01  Dewei Zhu  <dewei_zhu@apple.com>
2964
2965         Fix typo bug in Speedometer/resources/main.js
2966         https://bugs.webkit.org/show_bug.cgi?id=144504
2967
2968         Reviewed by Ryosuke Niwa.
2969
2970         * Speedometer/resources/main.js: Fix typo.
2971         (window.benchmarkClient.totalTimeInDisplayUnit):
2972
2973 2015-04-21  Ryosuke Niwa  <rniwa@webkit.org>
2974
2975         Add JetStream to PerformanceTests
2976         https://bugs.webkit.org/show_bug.cgi?id=144024
2977
2978         Rubber-stamped by Filip Pizlo.
2979
2980         * JetStream: Added.
2981         * JetStream/JetStream-Logo.png: Added.
2982         * JetStream/JetStream-Logo@2x.png: Added.
2983         * JetStream/JetStream.css: Added.
2984         * JetStream/JetStreamDriver.js: Added.
2985         * JetStream/LICENSE.txt: Added.
2986         * JetStream/LLVM-test-suite-LICENSE.txt: Added.
2987         * JetStream/Octane: Added.
2988         * JetStream/Octane/base.js: Added.
2989         * JetStream/Octane/code-load.js: Added.
2990         * JetStream/Octane2: Added.
2991         * JetStream/Octane2/base.js: Added.
2992         * JetStream/Octane2/box2d.js: Added.
2993         * JetStream/Octane2/code-load.js: Added.
2994         * JetStream/Octane2/crypto.js: Added.
2995         * JetStream/Octane2/deltablue.js: Added.
2996         * JetStream/Octane2/earley-boyer.js: Added.
2997         * JetStream/Octane2/gbemu-part1.js: Added.
2998         * JetStream/Octane2/gbemu-part2.js: Added.
2999         * JetStream/Octane2/mandreel.js: Added.
3000         * JetStream/Octane2/navier-stokes.js: Added.
3001         * JetStream/Octane2/pdfjs.js: Added.
3002         * JetStream/Octane2/raytrace.js: Added.
3003         * JetStream/Octane2/regexp.js: Added.
3004         * JetStream/Octane2/richards.js: Added.
3005         * JetStream/Octane2/run.js: Added.
3006         * JetStream/Octane2/splay.js: Added.
3007         * JetStream/Octane2/typescript-compiler.js: Added.
3008         * JetStream/Octane2/typescript-input.js: Added.
3009         * JetStream/Octane2/typescript.js: Added.
3010         * JetStream/Octane2/zlib-data.js: Added.
3011         * JetStream/Octane2/zlib.js: Added.
3012         * JetStream/Octane2Setup.js: Added.
3013         * JetStream/OctaneSetup.js: Added.
3014         * JetStream/README: Added.
3015         * JetStream/Reference.js: Added.
3016         * JetStream/SimpleSetup.js: Added.
3017         * JetStream/SunSpiderSetup.js: Added.
3018         * JetStream/Swoosh.png: Added.
3019         * JetStream/Swoosh@2x.png: Added.
3020         * JetStream/TestingSetup.js: Added.
3021         * JetStream/create.rb: Added.
3022         * JetStream/docs: Added.
3023         * JetStream/docs/JetStreamBlogPost.html: Added.
3024         * JetStream/in-depth-TEMPLATE.html: Added.
3025         * JetStream/index-TEMPLATE.html: Added.
3026         * JetStream/simple: Added.
3027         * JetStream/simple/bigfib.cpp: Added.
3028         * JetStream/simple/bigfib.cpp.js: Added.
3029         * JetStream/simple/container.cpp: Added.
3030         * JetStream/simple/container.cpp.js: Added.
3031         * JetStream/simple/dry.c: Added.
3032         * JetStream/simple/dry.c.js: Added.
3033         * JetStream/simple/float-mm.c: Added.
3034         * JetStream/simple/float-mm.c.js: Added.
3035         * JetStream/simple/gcc-loops.cpp: Added.
3036         * JetStream/simple/gcc-loops.cpp.js: Added.
3037         * JetStream/simple/hash-map.js: Added.
3038         * JetStream/simple/n-body.c: Added.
3039         * JetStream/simple/n-body.c.js: Added.
3040         * JetStream/simple/quicksort.c: Added.
3041         * JetStream/simple/quicksort.c.js: Added.
3042         * JetStream/simple/towers.c: Added.
3043         * JetStream/simple/towers.c.js: Added.
3044         * JetStream/sunspider: Added.
3045         * JetStream/sunspider/3d-cube.js: Added.
3046         * JetStream/sunspider/3d-raytrace.js: Added.
3047         * JetStream/sunspider/base64.js: Added.
3048         * JetStream/sunspider/cordic.js: Added.
3049         * JetStream/sunspider/crypto-aes.js: Added.
3050         * JetStream/sunspider/crypto-md5.js: Added.
3051         * JetStream/sunspider/crypto-sha1.js: Added.
3052         * JetStream/sunspider/date-format-tofte.js: Added.
3053         * JetStream/sunspider/date-format-xparb.js: Added.
3054         * JetStream/sunspider/n-body.js: Added.
3055         * JetStream/sunspider/regex-dna.js: Added.
3056         * JetStream/sunspider/tagcloud.js: Added.
3057
3058 2015-04-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
3059
3060         textPath layout performance improvement.
3061         https://bugs.webkit.org/show_bug.cgi?id=141570.
3062
3063         Reviewed by Darin Adler.
3064
3065         Cut down the time spent in traversing the path for text by 50%. Instead
3066         of traversing the path twice at a certain length: one time for the position
3067         and the second time for the angle, we can merge these two passes into one.
3068
3069         * SVG/TextOnPathSimple.html: Added.
3070         * SVG/resources/TextOnPathSimple.svg: Added.
3071
3072 2015-04-13  Zalan Bujtas  <zalan@apple.com>
3073
3074         Clear up the test content when test is done.
3075
3076         Unreviewed fix.
3077
3078         * Layout/simple-line-layout-innertext.html:
3079
3080 2015-04-09  Zalan Bujtas  <zalan@apple.com>
3081
3082         Simple line layout(regression): Calling innerText on RenderFlow with multiple children is slow.
3083         https://bugs.webkit.org/show_bug.cgi?id=143554
3084
3085         Reviewed by Antti Koivisto.
3086
3087         Initialize render flow's segments only when the render flow changes in TextIterator.
3088         The included performance test shows 6x speedup. (from ~10 runs/sec to ~60 runs/sec)
3089
3090         * Layout/simple-line-layout-innertext.html: Added.
3091
3092 2015-03-09  Chris Dumez  <cdumez@apple.com>
3093
3094         [CG] Have Canvas use the IOSurfacePool
3095         https://bugs.webkit.org/show_bug.cgi?id=142417
3096         <rdar://problem/20044440>
3097
3098         Reviewed by Darin Adler.
3099
3100         Lower the number of different canvas sizes from 1000 to 100 so that
3101         the test does not require such a huge cache size. With 100, we now
3102         get over 90% cache hit rate with the default IOSurfacePool size.
3103
3104         * Canvas/reuse.html:
3105
3106 2015-01-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
3107
3108         Poor performance on IE's Chalkboard benchmark.
3109         https://bugs.webkit.org/show_bug.cgi?id=140753.
3110
3111         Reviewed by Zalan Bujtas.
3112
3113         * SVG/UnderTheSeeBenchmark.html: Added
3114         * SVG/WorldcupBenchmark.html: Added.
3115         * SVG/resources/RenderAnimator.css: Added.
3116         * SVG/resources/RenderAnimator.js: Added.
3117         These are benchmarks for the SVG rendering. Mainly we want to measure how fast
3118         the SVG rendering will be when only a small part of it is drawn.
3119
3120 2015-01-21  Geoffrey Garen  <ggaren@apple.com>
3121
3122         bmalloc: support aligned allocation
3123         https://bugs.webkit.org/show_bug.cgi?id=140732
3124
3125         Reviewed by Andreas Kling.
3126
3127         * MallocBench/MallocBench.xcodeproj/project.pbxproj:
3128         * MallocBench/MallocBench/Benchmark.cpp:
3129         * MallocBench/MallocBench/memalign.cpp:
3130         (test):
3131         (benchmark_memalign): Added a test for specific interesting memalign values.
3132
3133         * MallocBench/MallocBench/stress_aligned.cpp: Added.
3134         (benchmark_stress_aligned):
3135         * MallocBench/MallocBench/stress_aligned.h: Added. Added a stress test
3136         for arbitrary memalign values.
3137
3138 2015-01-16  Geoffrey Garen  <ggaren@apple.com>
3139
3140         bmalloc: added the tiniest bit of testing for aligned allocation
3141         https://bugs.webkit.org/show_bug.cgi?id=140573
3142
3143         Reviewed by Andreas Kling.
3144
3145         Just good enoug to catch two bugs in a preliminary implementation.
3146
3147         * MallocBench/MallocBench.xcodeproj/project.pbxproj:
3148         * MallocBench/MallocBench/Benchmark.cpp:
3149         * MallocBench/MallocBench/mbmalloc.cpp:
3150         * MallocBench/MallocBench/mbmalloc.h:
3151         * MallocBench/MallocBench/memalign.cpp: Added.
3152         (benchmark_memalign):
3153         * MallocBench/MallocBench/memalign.h: Added.
3154
3155 2014-12-09  Myles C. Maxfield  <mmaxfield@apple.com>
3156
3157         Add performance test related to font fallback
3158         https://bugs.webkit.org/show_bug.cgi?id=139332
3159
3160         Reviewed by Simon Fraser.
3161
3162         * Layout/font-fallback.html: Added.
3163         * Layout/resources/font-fallback.html: Added.
3164
3165 2014-12-08  Dean Jackson  <dino@apple.com>
3166
3167         [Apple] Use Accelerate framework to speed-up FEGaussianBlur
3168         https://bugs.webkit.org/show_bug.cgi?id=139310
3169
3170         Reviewed by Simon Fraser.
3171
3172         Add an interactive performance test that measures the speed of a set
3173         of blur operations on a generated images.
3174
3175         * Interactive/blur-filter-timing.html: Added.
3176
3177 2014-11-13  Zalan Bujtas  <zalan@apple.com>
3178
3179         Simple line layout: Add performance test case to measure line layout speed of monolithic text content.
3180         https://bugs.webkit.org/show_bug.cgi?id=138699
3181
3182         Reviewed by Antti Koivisto.
3183
3184         * Layout/line-layout-long-long-text.html: Added.
3185
3186 2014-10-22  Zalan Bujtas  <zalan@apple.com>
3187
3188         Speed up line parsing for simple line layout (part I)
3189         https://bugs.webkit.org/show_bug.cgi?id=137275
3190
3191         Reviewed by Antti Koivisto.
3192
3193         Extend simple line layout performance test with a few more cases.
3194         Now we've got:
3195         <div center
3196         <div right
3197         <div justify
3198         <div white-space: pre (new)
3199         <div overflow-wrap: break-word (new)
3200         <pre
3201         <pre white-space: pre-wrap
3202         <pre white-space: pre-line (new)
3203         <pre white-space: nowrap (new)
3204         <pre white-space: pre-wrap overflow-wrap: break-word
3205         <div + embedded <span etc.
3206         <div + br
3207
3208         * Layout/line-layout-simple.html:
3209
3210 2014-10-15  Andrei Bucur  <abucur@adobe.com>
3211
3212         [Multicol] Start adding performance tests for the multi-column implementation
3213         https://bugs.webkit.org/show_bug.cgi?id=137687
3214
3215         Reviewed by Mihnea Ovidenie.
3216
3217         This patch creates a Multicol folder inside the Layout performance tests suite. It adds only two tests
3218         as described below.
3219
3220         The tests are skipped until the implementation stabilizes.
3221
3222         * Layout/Multicol/MulticolManyColumns.html: Added.
3223         This test verifies the performance of the multi-column implementation with two nested multi-column
3224         containers, the first having 20 columns and the second 10 columns.
3225
3226         * Layout/Multicol/MulticolNested.html: Added.
3227         This test verifies the performance of nesting multi-column containers in the presence
3228         of floats.
3229
3230         * Layout/Multicol/resources/multicol-content-many-columns.html: Added.
3231         * Layout/Multicol/resources/multicol-content-nested.html: Added.
3232         * Skipped: Skip the Multicol folder for now.
3233
3234 2014-09-29  Filip Pizlo  <fpizlo@apple.com>
3235
3236         It should be fun and easy to run every possible JavaScript benchmark from the command line