diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css
index c60774ae42a0..180ec49cb338 100644
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -639,14 +639,6 @@ html|input.urlbar-input[textoverflow]:not([focused]) {
-moz-binding: url("chrome://browser/content/search/search.xml#browser-search-autocomplete-result-popup");
}
-/* Overlay a badge on top of the icon of additional open search providers
- in the search panel. */
-.addengine-item > .button-box > .button-icon,
-.addengine-item[type="menu"] > .button-box > .box-inherit > .button-icon {
- -moz-binding: url("chrome://browser/content/search/search.xml#addengine-icon");
- display: -moz-stack;
-}
-
#PopupAutoCompleteRichResult {
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#urlbar-rich-result-popup");
}
diff --git a/browser/base/content/test/pageinfo/browser_pageinfo_firstPartyIsolation.js b/browser/base/content/test/pageinfo/browser_pageinfo_firstPartyIsolation.js
index 99f3f256d4e0..ab94124887d7 100644
--- a/browser/base/content/test/pageinfo/browser_pageinfo_firstPartyIsolation.js
+++ b/browser/base/content/test/pageinfo/browser_pageinfo_firstPartyIsolation.js
@@ -71,16 +71,15 @@ async function test() {
Services.prefs.clearUserPref("privacy.firstparty.isolate");
});
+ let url = "https://example.com/browser/browser/base/content/test/pageinfo/image.html";
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
- gBrowser.selectedBrowser.loadURI("https://example.com/browser/browser/base/content/test/pageinfo/image.html");
- await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
-
- let spec = gBrowser.selectedBrowser.currentURI.spec;
+ gBrowser.selectedBrowser.loadURI(url);
+ await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, url);
// Pass a dummy imageElement, if there isn't an imageElement, pageInfo.js
// will do a preview, however this sometimes will cause intermittent failures,
// see bug 1403365.
- let pageInfo = BrowserPageInfo(spec, "mediaTab", {});
+ let pageInfo = BrowserPageInfo(url, "mediaTab", {});
info("waitForEvent pageInfo");
await waitForEvent(pageInfo, "load");
diff --git a/browser/components/search/content/search.xml b/browser/components/search/content/search.xml
index 3bc2d4a3d41a..c98e4db09568 100644
--- a/browser/components/search/content/search.xml
+++ b/browser/components/search/content/search.xml
@@ -1153,14 +1153,6 @@
-
-
-
-
-
-
-
-
.button-box {
- -moz-box-pack: start;
-}
-
.addengine-item:first-of-type {
border-top: 1px solid var(--panel-separator-color);
}
@@ -176,20 +172,25 @@ menuitem[cmd="cmd_clearhistory"][disabled] {
background-color: var(--arrowpanel-dimmed-further);
}
-.addengine-icon {
- width: 16px;
-}
-
-.addengine-badge {
+.addengine-item > .toolbarbutton-badge-stack > .toolbarbutton-icon {
width: 16px;
height: 16px;
- margin: -7px -9px 7px 9px;
- list-style-image: url("chrome://browser/skin/badge-add-engine.png");
}
-.addengine-item > .button-box > .button-text,
-.addengine-item[type=menu] > .button-box > .box-inherit > .button-text {
- -moz-box-flex: 1;
+.addengine-item > .toolbarbutton-badge-stack > .toolbarbutton-badge {
+ display: -moz-box;
+ background: url(chrome://browser/skin/search-indicator-badge-add.svg) no-repeat center;
+ box-shadow: none;
+ /* "!important" is necessary to override the rule in toolbarbutton.css */
+ margin: -4px 0 0 !important;
+ margin-inline-end: -4px !important;
+ width: 11px;
+ height: 11px;
+ min-width: 11px;
+ min-height: 11px;
+}
+
+.addengine-item > .toolbarbutton-text {
text-align: start;
padding-inline-start: 10px;
}
@@ -199,16 +200,12 @@ menuitem[cmd="cmd_clearhistory"][disabled] {
}
@media (min-resolution: 1.1dppx) {
- .addengine-badge {
- list-style-image: url("chrome://browser/skin/badge-add-engine@2x.png");
- }
-
.addengine-item:not([image]) {
list-style-image: url("chrome://browser/skin/search-engine-placeholder@2x.png");
}
}
-.addengine-item[type=menu] > .button-box > .button-menu-dropmarker {
+.addengine-item[type=menu] > .toolbarbutton-menu-dropmarker {
display: -moz-box;
-moz-appearance: menuarrow !important;
list-style-image: none;
diff --git a/browser/themes/osx/searchbar.css b/browser/themes/osx/searchbar.css
index a8fe3dd068ef..8285138c13d6 100644
--- a/browser/themes/osx/searchbar.css
+++ b/browser/themes/osx/searchbar.css
@@ -151,10 +151,6 @@
padding: 0 10px;
}
-.addengine-item > .button-box {
- -moz-box-pack: start;
-}
-
.addengine-item:first-of-type {
border-top: 1px solid var(--panel-separator-color);
}
@@ -169,20 +165,25 @@
background-color: var(--arrowpanel-dimmed-further);
}
-.addengine-icon {
- width: 16px;
-}
-
-.addengine-badge {
+.addengine-item > .toolbarbutton-badge-stack > .toolbarbutton-icon {
width: 16px;
height: 16px;
- margin: -7px -9px 7px 9px;
- list-style-image: url("chrome://browser/skin/badge-add-engine.png");
}
-.addengine-item > .button-box > .button-text,
-.addengine-item[type=menu] > .button-box > .box-inherit > .button-text {
- -moz-box-flex: 1;
+.addengine-item > .toolbarbutton-badge-stack > .toolbarbutton-badge {
+ display: -moz-box;
+ background: url(chrome://browser/skin/search-indicator-badge-add.svg) no-repeat center;
+ box-shadow: none;
+ /* "!important" is necessary to override the rule in toolbarbutton.css */
+ margin: -4px 0 0 !important;
+ margin-inline-end: -4px !important;
+ width: 11px;
+ height: 11px;
+ min-width: 11px;
+ min-height: 11px;
+}
+
+.addengine-item > .toolbarbutton-text {
text-align: start;
padding-inline-start: 10px;
}
@@ -192,16 +193,12 @@
}
@media (min-resolution: 2dppx) {
- .addengine-badge {
- list-style-image: url("chrome://browser/skin/badge-add-engine@2x.png");
- }
-
.addengine-item:not([image]) {
list-style-image: url("chrome://browser/skin/search-engine-placeholder@2x.png");
}
}
-.addengine-item[type=menu] > .button-box > .button-menu-dropmarker {
+.addengine-item[type=menu] > .toolbarbutton-menu-dropmarker {
display: -moz-box;
-moz-appearance: menuarrow !important;
list-style-image: none;
diff --git a/browser/themes/shared/jar.inc.mn b/browser/themes/shared/jar.inc.mn
index 9dbd44ea52f5..e2d0691f39a9 100644
--- a/browser/themes/shared/jar.inc.mn
+++ b/browser/themes/shared/jar.inc.mn
@@ -176,8 +176,6 @@
skin/classic/browser/zoom-out.svg (../shared/icons/zoom-out.svg)
- skin/classic/browser/badge-add-engine.png (../shared/search/badge-add-engine.png)
- skin/classic/browser/badge-add-engine@2x.png (../shared/search/badge-add-engine@2x.png)
skin/classic/browser/search-engine-placeholder.png (../shared/search/search-engine-placeholder.png)
skin/classic/browser/search-engine-placeholder@2x.png (../shared/search/search-engine-placeholder@2x.png)
skin/classic/browser/search-indicator-badge-add.svg (../shared/search/search-indicator-badge-add.svg)
diff --git a/browser/themes/shared/search/badge-add-engine.png b/browser/themes/shared/search/badge-add-engine.png
deleted file mode 100644
index 226b7bf2b4c1..000000000000
Binary files a/browser/themes/shared/search/badge-add-engine.png and /dev/null differ
diff --git a/browser/themes/shared/search/badge-add-engine@2x.png b/browser/themes/shared/search/badge-add-engine@2x.png
deleted file mode 100644
index abf084aade08..000000000000
Binary files a/browser/themes/shared/search/badge-add-engine@2x.png and /dev/null differ
diff --git a/browser/themes/windows/searchbar.css b/browser/themes/windows/searchbar.css
index 13801ab10fed..5556eccb8c9c 100644
--- a/browser/themes/windows/searchbar.css
+++ b/browser/themes/windows/searchbar.css
@@ -152,10 +152,6 @@
padding: 0 10px;
}
-.addengine-item > .button-box {
- -moz-box-pack: start;
-}
-
.addengine-item:first-of-type {
border-top: 1px solid var(--panel-separator-color);
}
@@ -170,20 +166,25 @@
background-color: var(--arrowpanel-dimmed-further);
}
-.addengine-icon {
- width: 16px;
-}
-
-.addengine-badge {
+.addengine-item > .toolbarbutton-badge-stack > .toolbarbutton-icon {
width: 16px;
height: 16px;
- margin: -7px -9px 7px 9px;
- list-style-image: url("chrome://browser/skin/badge-add-engine.png");
}
-.addengine-item > .button-box > .button-text,
-.addengine-item[type=menu] > .button-box > .box-inherit > .button-text {
- -moz-box-flex: 1;
+.addengine-item > .toolbarbutton-badge-stack > .toolbarbutton-badge {
+ display: -moz-box;
+ background: url(chrome://browser/skin/search-indicator-badge-add.svg) no-repeat center;
+ box-shadow: none;
+ /* "!important" is necessary to override the rule in toolbarbutton.css */
+ margin: -4px 0 0 !important;
+ margin-inline-end: -4px !important;
+ width: 11px;
+ height: 11px;
+ min-width: 11px;
+ min-height: 11px;
+}
+
+.addengine-item > .toolbarbutton-text {
text-align: start;
padding-inline-start: 10px;
}
@@ -193,16 +194,12 @@
}
@media (min-resolution: 1.1dppx) {
- .addengine-badge {
- list-style-image: url("chrome://browser/skin/badge-add-engine@2x.png");
- }
-
.addengine-item:not([image]) {
list-style-image: url("chrome://browser/skin/search-engine-placeholder@2x.png");
}
}
-.addengine-item[type=menu] > .button-box > .button-menu-dropmarker {
+.addengine-item[type=menu] > .toolbarbutton-menu-dropmarker {
display: -moz-box;
-moz-appearance: menuarrow !important;
list-style-image: none;
diff --git a/devtools/client/debugger/new/README.mozilla b/devtools/client/debugger/new/README.mozilla
index e7423fe7604f..080797a0bf7a 100644
--- a/devtools/client/debugger/new/README.mozilla
+++ b/devtools/client/debugger/new/README.mozilla
@@ -1,7 +1,9 @@
This is the debugger.html project output.
See https://github.com/devtools-html/debugger.html
-Taken from upstream commit: 0bcf3e687305960077e1255510e424d0437a3b69
+Version 5.0
+Comparison - https://github.com/devtools-html/debugger.html/compare/release-4...release-5
+Commit: https://github.com/devtools-html/debugger.html/commit/5ecfc84198524399ae75748bd1a28d2df2b45733
Packages:
- babel-plugin-transform-es2015-modules-commonjs @6.26.0
diff --git a/devtools/client/debugger/new/debugger.css b/devtools/client/debugger/new/debugger.css
index 273e9f1b2e63..77414546007a 100644
--- a/devtools/client/debugger/new/debugger.css
+++ b/devtools/client/debugger/new/debugger.css
@@ -3167,6 +3167,7 @@ html .breakpoints-list .breakpoint.paused {
line-height: 1em;
position: relative;
transition: all 0.25s ease;
+ cursor: pointer;
}
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -3602,20 +3603,16 @@ img.ignore-exceptions {
display: inline-block;
}
-.welcomebox .toggle-button-end {
- position: absolute;
- top: auto;
- bottom: 0;
- offset-inline-end: 0;
- offset-inline-start: auto;
-}
-
-.welcomebox .small-size-layout {
+.welcomebox .normal-layout {
display: none;
}
-.welcomebox .normal-layout {
- display: inline-block;
+.welcomebox .command-bar-button {
+ position: absolute;
+ top: auto;
+ offset-inline-end: 0;
+ offset-inline-start: auto;
+ bottom: 0;
}
.shortcutKeys {
diff --git a/devtools/client/debugger/new/debugger.js b/devtools/client/debugger/new/debugger.js
index afcffda7e0a9..30d1304aa74a 100644
--- a/devtools/client/debugger/new/debugger.js
+++ b/devtools/client/debugger/new/debugger.js
@@ -10218,7 +10218,8 @@ if (isDevelopment()) {
pref("devtools.source-map.client-service.enabled", true);
pref("devtools.debugger.pause-on-exceptions", false);
pref("devtools.debugger.ignore-caught-exceptions", false);
- pref("devtools.debugger.call-stack-visible", false);
+ pref("devtools.debugger.call-stack-visible", true);
+ pref("devtools.debugger.scopes-visible", true);
pref("devtools.debugger.start-panel-collapsed", false);
pref("devtools.debugger.end-panel-collapsed", false);
pref("devtools.debugger.tabs", "[]");
@@ -10232,6 +10233,7 @@ if (isDevelopment()) {
pref("devtools.debugger.project-directory-root", "");
pref("devtools.debugger.prefs-schema-version", "1.0.1");
pref("devtools.debugger.features.project-text-search", true);
+ pref("devtools.debugger.features.workers", true);
pref("devtools.debugger.features.async-stepping", true);
pref("devtools.debugger.features.wasm", true);
pref("devtools.debugger.features.shortcuts", true);
@@ -10248,6 +10250,7 @@ const prefs = new PrefsHelper("devtools", {
pauseOnExceptions: ["Bool", "debugger.pause-on-exceptions"],
ignoreCaughtExceptions: ["Bool", "debugger.ignore-caught-exceptions"],
callStackVisible: ["Bool", "debugger.call-stack-visible"],
+ scopesVisible: ["Bool", "debugger.scopes-visible"],
startPanelCollapsed: ["Bool", "debugger.start-panel-collapsed"],
endPanelCollapsed: ["Bool", "debugger.end-panel-collapsed"],
frameworkGroupingOn: ["Bool", "debugger.ui.framework-grouping-on"],
@@ -10273,7 +10276,8 @@ const features = new PrefsHelper("devtools.debugger.features", {
columnBreakpoints: ["Bool", "column-breakpoints", false],
mapScopes: ["Bool", "map-scopes", true],
breakpointsDropdown: ["Bool", "breakpoints-dropdown", true],
- removeCommandBarOptions: ["Bool", "remove-command-bar-options", true]
+ removeCommandBarOptions: ["Bool", "remove-command-bar-options", true],
+ workers: ["Bool", "workers", true]
});
/* harmony export (immutable) */ __webpack_exports__["features"] = features;
@@ -14118,7 +14122,7 @@ module.exports = "
+
diff --git a/third_party/webkit/PerformanceTests/MotionMark/resources/runner/lines.svg b/third_party/webkit/PerformanceTests/MotionMark/resources/runner/lines.svg
new file mode 100644
index 000000000000..83458b8095a2
--- /dev/null
+++ b/third_party/webkit/PerformanceTests/MotionMark/resources/runner/lines.svg
@@ -0,0 +1,26 @@
+
+
+
diff --git a/third_party/webkit/PerformanceTests/MotionMark/resources/runner/logo.svg b/third_party/webkit/PerformanceTests/MotionMark/resources/runner/logo.svg
new file mode 100644
index 000000000000..a7d0eaf37570
--- /dev/null
+++ b/third_party/webkit/PerformanceTests/MotionMark/resources/runner/logo.svg
@@ -0,0 +1,26 @@
+
+
+
diff --git a/third_party/webkit/PerformanceTests/MotionMark/resources/runner/tests.js b/third_party/webkit/PerformanceTests/MotionMark/resources/runner/tests.js
new file mode 100644
index 000000000000..aa938c5189e0
--- /dev/null
+++ b/third_party/webkit/PerformanceTests/MotionMark/resources/runner/tests.js
@@ -0,0 +1,81 @@
+var Headers = {
+ testName: [
+ {
+ title: "" + Strings.text.testName + "",
+ text: Strings.text.testName
+ }
+ ],
+ score: [
+ {
+ title: Strings.text.score,
+ text: Strings.json.score
+ }
+ ],
+ details: [
+ {
+ title: " ",
+ text: function(data) {
+ var bootstrap = data[Strings.json.complexity][Strings.json.bootstrap];
+ return "±" + (Statistics.largestDeviationPercentage(bootstrap.confidenceLow, bootstrap.median, bootstrap.confidenceHigh) * 100).toFixed(2) + "%";
+ }
+ }
+ ]
+};
+
+var Suite = function(name, tests) {
+ this.name = name;
+ this.tests = tests;
+};
+
+var Suites = [];
+
+Suites.push(new Suite("Animometer",
+ [
+ {
+ url: "master/multiply.html",
+ name: "Multiply"
+ },
+ {
+ url: "master/canvas-stage.html?pathType=arcs",
+ name: "Canvas Arcs"
+ },
+ {
+ url: "master/leaves.html",
+ name: "Leaves"
+ },
+ {
+ url: "master/canvas-stage.html?pathType=linePath",
+ name: "Paths"
+ },
+ {
+ url: "master/canvas-stage.html?pathType=line&lineCap=square",
+ name: "Canvas Lines"
+ },
+ {
+ url: "master/focus.html",
+ name: "Focus"
+ },
+ {
+ url: "master/image-data.html",
+ name: "Images"
+ },
+ {
+ url: "master/text.html",
+ name: "Design"
+ },
+ {
+ url: "master/svg-particles.html",
+ name: "Suits"
+ },
+ ]
+));
+
+function suiteFromName(name)
+{
+ return Suites.find(function(suite) { return suite.name == name; });
+}
+
+function testFromName(suite, name)
+{
+ return suite.tests.find(function(test) { return test.name == name; });
+}
diff --git a/third_party/webkit/PerformanceTests/MotionMark/resources/statistics.js b/third_party/webkit/PerformanceTests/MotionMark/resources/statistics.js
new file mode 100644
index 000000000000..9322a797b677
--- /dev/null
+++ b/third_party/webkit/PerformanceTests/MotionMark/resources/statistics.js
@@ -0,0 +1,397 @@
+Pseudo =
+{
+ initialRandomSeed: 49734321,
+ randomSeed: 49734321,
+
+ resetRandomSeed: function()
+ {
+ Pseudo.randomSeed = Pseudo.initialRandomSeed;
+ },
+
+ random: function()
+ {
+ var randomSeed = Pseudo.randomSeed;
+ randomSeed = ((randomSeed + 0x7ed55d16) + (randomSeed << 12)) & 0xffffffff;
+ randomSeed = ((randomSeed ^ 0xc761c23c) ^ (randomSeed >>> 19)) & 0xffffffff;
+ randomSeed = ((randomSeed + 0x165667b1) + (randomSeed << 5)) & 0xffffffff;
+ randomSeed = ((randomSeed + 0xd3a2646c) ^ (randomSeed << 9)) & 0xffffffff;
+ randomSeed = ((randomSeed + 0xfd7046c5) + (randomSeed << 3)) & 0xffffffff;
+ randomSeed = ((randomSeed ^ 0xb55a4f09) ^ (randomSeed >>> 16)) & 0xffffffff;
+ Pseudo.randomSeed = randomSeed;
+ return (randomSeed & 0xfffffff) / 0x10000000;
+ }
+};
+
+Statistics =
+{
+ sampleMean: function(numberOfSamples, sum)
+ {
+ if (numberOfSamples < 1)
+ return 0;
+ return sum / numberOfSamples;
+ },
+
+ // With sum and sum of squares, we can compute the sample standard deviation in O(1).
+ // See https://rniwa.com/2012-11-10/sample-standard-deviation-in-terms-of-sum-and-square-sum-of-samples/
+ unbiasedSampleStandardDeviation: function(numberOfSamples, sum, squareSum)
+ {
+ if (numberOfSamples < 2)
+ return 0;
+ return Math.sqrt((squareSum - sum * sum / numberOfSamples) / (numberOfSamples - 1));
+ },
+
+ geometricMean: function(values)
+ {
+ if (!values.length)
+ return 0;
+ var roots = values.map(function(value) { return Math.pow(value, 1 / values.length); })
+ return roots.reduce(function(a, b) { return a * b; });
+ },
+
+ // Cumulative distribution function
+ cdf: function(value, mean, standardDeviation)
+ {
+ return 0.5 * (1 + Statistics.erf((value - mean) / (Math.sqrt(2 * standardDeviation * standardDeviation))));
+ },
+
+ // Approximation of Gauss error function, Abramowitz and Stegun 7.1.26
+ erf: function(value)
+ {
+ var sign = (value >= 0) ? 1 : -1;
+ value = Math.abs(value);
+
+ var a1 = 0.254829592;
+ var a2 = -0.284496736;
+ var a3 = 1.421413741;
+ var a4 = -1.453152027;
+ var a5 = 1.061405429;
+ var p = 0.3275911;
+
+ var t = 1.0 / (1.0 + p * value);
+ var y = 1.0 - (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * Math.exp(-value * value);
+ return sign * y;
+ },
+
+ largestDeviationPercentage: function(low, mean, high)
+ {
+ return Math.max(Math.abs(low / mean - 1), (high / mean - 1));
+ }
+};
+
+Experiment = Utilities.createClass(
+ function(includeConcern)
+ {
+ if (includeConcern)
+ this._maxHeap = Heap.createMaxHeap(Experiment.defaults.CONCERN_SIZE);
+ this.reset();
+ }, {
+
+ reset: function()
+ {
+ this._sum = 0;
+ this._squareSum = 0;
+ this._numberOfSamples = 0;
+ if (this._maxHeap)
+ this._maxHeap.init();
+ },
+
+ get sampleCount()
+ {
+ return this._numberOfSamples;
+ },
+
+ sample: function(value)
+ {
+ this._sum += value;
+ this._squareSum += value * value;
+ if (this._maxHeap)
+ this._maxHeap.push(value);
+ ++this._numberOfSamples;
+ },
+
+ mean: function()
+ {
+ return Statistics.sampleMean(this._numberOfSamples, this._sum);
+ },
+
+ standardDeviation: function()
+ {
+ return Statistics.unbiasedSampleStandardDeviation(this._numberOfSamples, this._sum, this._squareSum);
+ },
+
+ cdf: function(value)
+ {
+ return Statistics.cdf(value, this.mean(), this.standardDeviation());
+ },
+
+ percentage: function()
+ {
+ var mean = this.mean();
+ return mean ? this.standardDeviation() * 100 / mean : 0;
+ },
+
+ concern: function(percentage)
+ {
+ if (!this._maxHeap)
+ return this.mean();
+
+ var size = Math.ceil(this._numberOfSamples * percentage / 100);
+ var values = this._maxHeap.values(size);
+ return values.length ? values.reduce(function(a, b) { return a + b; }) / values.length : 0;
+ },
+
+ score: function(percentage)
+ {
+ return Statistics.geometricMean([this.mean(), Math.max(this.concern(percentage), 1)]);
+ }
+});
+
+Experiment.defaults =
+{
+ CONCERN: 5,
+ CONCERN_SIZE: 100,
+};
+
+Regression = Utilities.createClass(
+ function(samples, getComplexity, getFrameLength, startIndex, endIndex, options)
+ {
+ var desiredFrameLength = options.desiredFrameLength || 1000/60;
+ var bestProfile;
+
+ if (!options.preferredProfile || options.preferredProfile == Strings.json.profiles.slope) {
+ var slope = this._calculateRegression(samples, getComplexity, getFrameLength, startIndex, endIndex, {
+ shouldClip: true,
+ s1: desiredFrameLength,
+ t1: 0
+ });
+ if (!bestProfile || slope.error < bestProfile.error) {
+ bestProfile = slope;
+ this.profile = Strings.json.profiles.slope;
+ }
+ }
+ if (!options.preferredProfile || options.preferredProfile == Strings.json.profiles.flat) {
+ var flat = this._calculateRegression(samples, getComplexity, getFrameLength, startIndex, endIndex, {
+ shouldClip: true,
+ s1: desiredFrameLength,
+ t1: 0,
+ t2: 0
+ });
+
+ if (!bestProfile || flat.error < bestProfile.error) {
+ bestProfile = flat;
+ this.profile = Strings.json.profiles.flat;
+ }
+ }
+
+ this.startIndex = Math.min(startIndex, endIndex);
+ this.endIndex = Math.max(startIndex, endIndex);
+
+ this.complexity = bestProfile.complexity;
+ this.s1 = bestProfile.s1;
+ this.t1 = bestProfile.t1;
+ this.s2 = bestProfile.s2;
+ this.t2 = bestProfile.t2;
+ this.stdev1 = bestProfile.stdev1;
+ this.stdev2 = bestProfile.stdev2;
+ this.n1 = bestProfile.n1;
+ this.n2 = bestProfile.n2;
+ this.error = bestProfile.error;
+ }, {
+
+ valueAt: function(complexity)
+ {
+ if (this.n1 == 1 || complexity > this.complexity)
+ return this.s2 + this.t2 * complexity;
+ return this.s1 + this.t1 * complexity;
+ },
+
+ // A generic two-segment piecewise regression calculator. Based on Kundu/Ubhaya
+ //
+ // Minimize sum of (y - y')^2
+ // where y = s1 + t1*x
+ // y = s2 + t2*x
+ // y' = s1 + t1*x' = s2 + t2*x' if x_0 <= x' <= x_n
+ //
+ // Allows for fixing s1, t1, s2, t2
+ //
+ // x is assumed to be complexity, y is frame length. Can be used for pure complexity-FPS
+ // analysis or for ramp controllers since complexity monotonically decreases with time.
+ _calculateRegression: function(samples, getComplexity, getFrameLength, startIndex, endIndex, options)
+ {
+ if (startIndex == endIndex) {
+ // Only one sample point; we can't calculate any regression.
+ var x = getComplexity(samples, startIndex);
+ return {
+ complexity: x,
+ s1: x,
+ t1: 0,
+ s2: x,
+ t2: 0,
+ error1: 0,
+ error2: 0
+ };
+ }
+
+ // x is expected to increase in complexity
+ var iterationDirection = endIndex > startIndex ? 1 : -1;
+ var lowComplexity = getComplexity(samples, startIndex);
+ var highComplexity = getComplexity(samples, endIndex);
+ var a1 = 0, b1 = 0, c1 = 0, d1 = 0, h1 = 0, k1 = 0;
+ var a2 = 0, b2 = 0, c2 = 0, d2 = 0, h2 = 0, k2 = 0;
+
+ // Iterate from low to high complexity
+ for (var i = startIndex; iterationDirection * (endIndex - i) > -1; i += iterationDirection) {
+ var x = getComplexity(samples, i);
+ var y = getFrameLength(samples, i);
+ a2 += 1;
+ b2 += x;
+ c2 += x * x;
+ d2 += y;
+ h2 += y * x;
+ k2 += y * y;
+ }
+
+ var s1_best, t1_best, s2_best, t2_best, n1_best, n2_best, error1_best, error2_best, x_best, x_prime;
+
+ function setBest(s1, t1, error1, s2, t2, error2, splitIndex, x_prime, x)
+ {
+ s1_best = s1;
+ t1_best = t1;
+ error1_best = error1;
+ s2_best = s2;
+ t2_best = t2;
+ error2_best = error2;
+ // Number of samples included in the first segment, inclusive of splitIndex
+ n1_best = iterationDirection * (splitIndex - startIndex) + 1;
+ // Number of samples included in the second segment
+ n2_best = iterationDirection * (endIndex - splitIndex);
+ if (!options.shouldClip || (x_prime >= lowComplexity && x_prime <= highComplexity))
+ x_best = x_prime;
+ else {
+ // Discontinuous piecewise regression
+ x_best = x;
+ }
+ }
+
+ // Iterate from startIndex to endIndex - 1, inclusive
+ for (var i = startIndex; iterationDirection * (endIndex - i) > 0; i += iterationDirection) {
+ var x = getComplexity(samples, i);
+ var y = getFrameLength(samples, i);
+ var xx = x * x;
+ var yx = y * x;
+ var yy = y * y;
+ // a1, b1, etc. is sum from startIndex to i, inclusive
+ a1 += 1;
+ b1 += x;
+ c1 += xx;
+ d1 += y;
+ h1 += yx;
+ k1 += yy;
+ // a2, b2, etc. is sum from i+1 to endIndex, inclusive
+ a2 -= 1;
+ b2 -= x;
+ c2 -= xx;
+ d2 -= y;
+ h2 -= yx;
+ k2 -= yy;
+
+ var A = c1*d1 - b1*h1;
+ var B = a1*h1 - b1*d1;
+ var C = a1*c1 - b1*b1;
+ var D = c2*d2 - b2*h2;
+ var E = a2*h2 - b2*d2;
+ var F = a2*c2 - b2*b2;
+ var s1 = options.s1 !== undefined ? options.s1 : (A / C);
+ var t1 = options.t1 !== undefined ? options.t1 : (B / C);
+ var s2 = options.s2 !== undefined ? options.s2 : (D / F);
+ var t2 = options.t2 !== undefined ? options.t2 : (E / F);
+ // Assumes that the two segments meet
+ var x_prime = (s1 - s2) / (t2 - t1);
+
+ var error1 = (k1 + a1*s1*s1 + c1*t1*t1 - 2*d1*s1 - 2*h1*t1 + 2*b1*s1*t1) || Number.MAX_VALUE;
+ var error2 = (k2 + a2*s2*s2 + c2*t2*t2 - 2*d2*s2 - 2*h2*t2 + 2*b2*s2*t2) || Number.MAX_VALUE;
+
+ if (i == startIndex) {
+ setBest(s1, t1, error1, s2, t2, error2, i, x_prime, x);
+ continue;
+ }
+
+ if (C == 0 || F == 0)
+ continue;
+
+ // Projected point is not between this and the next sample
+ if (x_prime > getComplexity(samples, i + iterationDirection) || x_prime < x) {
+ // Calculate lambda, which divides the weight of this sample between the two lines
+
+ // These values remove the influence of this sample
+ var I = c1 - 2*b1*x + a1*xx;
+ var H = C - I;
+ var G = A + B*x - C*y;
+
+ var J = D + E*x - F*y;
+ var K = c2 - 2*b2*x + a2*xx;
+
+ var lambda = (G*F + G*K - H*J) / (I*J + G*K);
+ if (lambda > 0 && lambda < 1) {
+ var lambda1 = 1 - lambda;
+ s1 = options.s1 !== undefined ? options.s1 : ((A - lambda1*(-h1*x + d1*xx + c1*y - b1*yx)) / (C - lambda1*I));
+ t1 = options.t1 !== undefined ? options.t1 : ((B - lambda1*(h1 - d1*x - b1*y + a1*yx)) / (C - lambda1*I));
+ s2 = options.s2 !== undefined ? options.s2 : ((D + lambda1*(-h2*x + d2*xx + c2*y - b2*yx)) / (F + lambda1*K));
+ t2 = options.t2 !== undefined ? options.t2 : ((E + lambda1*(h2 - d2*x - b2*y + a2*yx)) / (F + lambda1*K));
+ x_prime = (s1 - s2) / (t2 - t1);
+
+ error1 = ((k1 + a1*s1*s1 + c1*t1*t1 - 2*d1*s1 - 2*h1*t1 + 2*b1*s1*t1) - lambda1 * Math.pow(y - (s1 + t1*x), 2)) || Number.MAX_VALUE;
+ error2 = ((k2 + a2*s2*s2 + c2*t2*t2 - 2*d2*s2 - 2*h2*t2 + 2*b2*s2*t2) + lambda1 * Math.pow(y - (s2 + t2*x), 2)) || Number.MAX_VALUE;
+ } else if (t1 != t2)
+ continue;
+ }
+
+ if (error1 + error2 < error1_best + error2_best)
+ setBest(s1, t1, error1, s2, t2, error2, i, x_prime, x);
+ }
+
+ return {
+ complexity: x_best,
+ s1: s1_best,
+ t1: t1_best,
+ stdev1: Math.sqrt(error1_best / n1_best),
+ s2: s2_best,
+ t2: t2_best,
+ stdev2: Math.sqrt(error2_best / n2_best),
+ error: error1_best + error2_best,
+ n1: n1_best,
+ n2: n2_best
+ };
+ }
+});
+
+Utilities.extendObject(Regression, {
+ bootstrap: function(samples, iterationCount, processResample, confidencePercentage)
+ {
+ var sampleLength = samples.length;
+ var resample = new Array(sampleLength);
+
+ var bootstrapEstimator = new Experiment;
+ var bootstrapData = new Array(iterationCount);
+
+ Pseudo.resetRandomSeed();
+ for (var i = 0; i < iterationCount; ++i) {
+ for (var j = 0; j < sampleLength; ++j)
+ resample[j] = samples[Math.floor(Pseudo.random() * sampleLength)];
+
+ var resampleResult = processResample(resample);
+ bootstrapEstimator.sample(resampleResult);
+ bootstrapData[i] = resampleResult;
+ }
+
+ bootstrapData.sort(function(a, b) { return a - b; });
+ return {
+ confidenceLow: bootstrapData[Math.round((iterationCount - 1) * (1 - confidencePercentage) / 2)],
+ confidenceHigh: bootstrapData[Math.round((iterationCount - 1) * (1 + confidencePercentage) / 2)],
+ median: bootstrapData[Math.round(iterationCount / 2)],
+ mean: bootstrapEstimator.mean(),
+ data: bootstrapData,
+ confidencePercentage: confidencePercentage
+ };
+ }
+});
diff --git a/third_party/webkit/PerformanceTests/MotionMark/resources/strings.js b/third_party/webkit/PerformanceTests/MotionMark/resources/strings.js
new file mode 100644
index 000000000000..b58f67e9912d
--- /dev/null
+++ b/third_party/webkit/PerformanceTests/MotionMark/resources/strings.js
@@ -0,0 +1,51 @@
+var Strings = {
+ text: {
+ testName: "Test Name",
+ score: "Score"
+ },
+ json: {
+ marks: "marks",
+ samplingStartTimeOffset: "Start sampling",
+ samplingEndTimeOffset: "End sampling",
+
+ samples: "samples",
+ dataFieldMap: "dataFieldMap",
+ controller: "controller",
+ time: "time",
+ complexity: "complexity",
+ complexityAverage: "complexityAverage",
+ frameLength: "frameLength",
+ smoothedFrameLength: "smoothedFrameLength",
+
+ result: "result",
+ configuration: "configuration",
+ score: "score",
+ scoreLowerBound: "scoreLowerBound",
+ scoreUpperBound: "scoreUpperBound",
+ bootstrap: "bootstrap",
+ measurements: {
+ average: "average",
+ concern: "concern",
+ stdev: "stdev",
+ percent: "percent"
+ },
+
+ regressions: {
+ startIndex: "startIndex",
+ endIndex: "endIndex",
+ segment1: "segment1",
+ segment2: "segment2",
+ profile: "profile"
+ },
+
+ profiles: {
+ slope: "slope",
+ flat: "flat"
+ },
+
+ results: {
+ iterations: "iterationsResults",
+ tests: "testsResults"
+ }
+ }
+};
diff --git a/third_party/webkit/PerformanceTests/MotionMark/tests/3d/resources/webgl.js b/third_party/webkit/PerformanceTests/MotionMark/tests/3d/resources/webgl.js
new file mode 100644
index 000000000000..58f5df385ed4
--- /dev/null
+++ b/third_party/webkit/PerformanceTests/MotionMark/tests/3d/resources/webgl.js
@@ -0,0 +1,184 @@
+(function() {
+
+WebGLStage = Utilities.createSubclass(Stage,
+ function(element, options)
+ {
+ Stage.call(this);
+ },
+ {
+
+ initialize: function(benchmark, options)
+ {
+ Stage.prototype.initialize.call(this, benchmark, options);
+
+ this._numTriangles = 0;
+ this._bufferSize = 0;
+
+ this._gl = this.element.getContext("webgl");
+ var gl = this._gl;
+
+ gl.clearColor(0.5, 0.5, 0.5, 1);
+
+ // Create the vertex shader object.
+ var vertexShader = gl.createShader(gl.VERTEX_SHADER);
+
+ // The source code for the shader is extracted from the
+
+
+
+
+
+
+
+