Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/common/vendor-prefix.js

Issue 2010163003: Fix paths of testharness*, WebIDLParser.js, idlharness.js, vendor-prefix.js for remaining files … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/imported/wpt/common/vendor-prefix.js
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/common/vendor-prefix.js b/third_party/WebKit/LayoutTests/imported/wpt/common/vendor-prefix.js
index 1a91632cec2860f120c806ef0516e5ddcd01077c..0365f2ea9fde5efb8c16e3be8355fae41ad1720e 100644
--- a/third_party/WebKit/LayoutTests/imported/wpt/common/vendor-prefix.js
+++ b/third_party/WebKit/LayoutTests/imported/wpt/common/vendor-prefix.js
@@ -1,3 +1,17 @@
+/*
+ * Distributed under both the W3C Test Suite License [1] and the W3C
+ * 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
+ * policies and contribution forms [3].
+ *
+ * [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
+ * [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
+ * [3] http://www.w3.org/2004/10/27-testcases
+ * */
+
+/* Source: https://github.com/w3c/web-platform-tests/blob/master/common/vendor-prefix.js
+ * The file has been modified to always be on (i.e. does not require usePrefixes=1 to
+ * start replacing prefixes). */
+
/* Use this script when you want to test APIs that use vendor prefixes
and define which objects need to be checked for prefixed versions, à la
<script src="vendor-prefix.js"
@@ -64,52 +78,23 @@
}
}
- if (location.search.indexOf('usePrefixes=1') !== -1) {
- if (document.querySelector("script[data-prefixed-objects]")) {
- var prefixObjectsData = document.querySelector("script[data-prefixed-objects]").dataset["prefixedObjects"];
- try {
- var prefixedObjects = JSON.parse(prefixObjectsData);
- } catch (e) {
- throw "couldn't parse data-prefixed-objects as JSON:" + e;
- }
- prefixedObjects.forEach(setAlias);
- }
- if (document.querySelector("script[data-prefixed-prototypes]")) {
- var prefixProtoData = document.querySelector("script[data-prefixed-prototypes]").dataset["prefixedPrototypes"];
- try {
- var prefixedPrototypes = JSON.parse(prefixProtoData);
- } catch (e) {
- throw "couldn't parse data-prefixed-prototypes as JSON:" + e;
- }
- prefixedPrototypes.forEach(setPrototypeAlias);
+ // For this version of vendor-prefixes.js, always replace the prefixes.
+ if (document.querySelector("script[data-prefixed-objects]")) {
+ var prefixObjectsData = document.querySelector("script[data-prefixed-objects]").dataset["prefixedObjects"];
+ try {
+ var prefixedObjects = JSON.parse(prefixObjectsData);
+ } catch (e) {
+ throw "couldn't parse data-prefixed-objects as JSON:" + e;
}
- var ul = document.createElement("ul");
- Object.keys(aliases).forEach(function (alias) {
- var li = document.createElement("li");
- li.appendChild(document.createTextNode(alias + " has been set to be an alias of vendor-prefixed " + aliases[alias]));
- ul.appendChild(li);
- });
- documentingPrefixUsage.appendChild(ul);
- } else {
- // Document that the test can be run with prefixes enabled
-
- var a = document.createElement('a');
- var link = "";
- if (location.search) {
- link = location.search + "&usePrefixes=1";
- } else {
- link = "?usePrefixes=1";
- }
- a.setAttribute("href", link);
- a.appendChild(document.createTextNode("with vendor prefixes enabled"));
- documentingPrefixUsage.appendChild(document.createTextNode("The feature(s) tested here are known to have been made available via vendor prefixes; you can run this test "));
- documentingPrefixUsage.appendChild(a);
- documentingPrefixUsage.appendChild(document.createTextNode("."));
+ prefixedObjects.forEach(setAlias);
}
- var log = document.getElementById('log');
- if (log) {
- log.parentNode.insertBefore(documentingPrefixUsage, log);
- } else {
- document.body.appendChild(documentingPrefixUsage);
+ if (document.querySelector("script[data-prefixed-prototypes]")) {
+ var prefixProtoData = document.querySelector("script[data-prefixed-prototypes]").dataset["prefixedPrototypes"];
+ try {
+ var prefixedPrototypes = JSON.parse(prefixProtoData);
+ } catch (e) {
+ throw "couldn't parse data-prefixed-prototypes as JSON:" + e;
+ }
+ prefixedPrototypes.forEach(setPrototypeAlias);
}
})();

Powered by Google App Engine
This is Rietveld 408576698