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