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

Side by Side Diff: third_party/WebKit/LayoutTests/animations/interpolation/resources/interpolation-test.js

Issue 1783693006: Use <string> serialization rules for computed value of reference filter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2015 Google Inc. All rights reserved. 2 * Copyright (C) 2015 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 replace(/\.\d+/, function(m) { 206 replace(/\.\d+/, function(m) {
207 return m.replace(/0+$/, ''); 207 return m.replace(/0+$/, '');
208 }). 208 }).
209 replace(/\.$/, ''). 209 replace(/\.$/, '').
210 replace(/^-0$/, '0'); 210 replace(/^-0$/, '0');
211 }); 211 });
212 } 212 }
213 213
214 var anchor = document.createElement('a'); 214 var anchor = document.createElement('a');
215 function sanitizeUrls(value) { 215 function sanitizeUrls(value) {
216 var matches = value.match(/url\("([^\)]*)"\)/g); 216 var matches = value.match(/url\("([^#][^\)]*)"\)/g);
217 if (matches !== null) { 217 if (matches !== null) {
218 for (var i = 0; i < matches.length; ++i) { 218 for (var i = 0; i < matches.length; ++i) {
219 var url = /url\("([^\)]*)"\)/g.exec(matches[i])[1]; 219 var url = /url\("([^#][^\)]*)"\)/g.exec(matches[i])[1];
220 anchor.href = url; 220 anchor.href = url;
221 anchor.pathname = '...' + anchor.pathname.substring(anchor.pathname.last IndexOf('/')); 221 anchor.pathname = '...' + anchor.pathname.substring(anchor.pathname.last IndexOf('/'));
222 value = value.replace(matches[i], 'url(' + anchor.href + ')'); 222 value = value.replace(matches[i], 'url(' + anchor.href + ')');
223 } 223 }
224 } 224 }
225 return value; 225 return value;
226 } 226 }
227 227
228 function normalizeValue(value) { 228 function normalizeValue(value) {
229 return roundNumbers(sanitizeUrls(value)). 229 return roundNumbers(sanitizeUrls(value)).
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 loadScript('../../resources/testharness.js').then(function() { 413 loadScript('../../resources/testharness.js').then(function() {
414 return loadScript('../../resources/testharnessreport.js'); 414 return loadScript('../../resources/testharnessreport.js');
415 }).then(function() { 415 }).then(function() {
416 var asyncHandle = async_test('This test uses interpolation-test.js.') 416 var asyncHandle = async_test('This test uses interpolation-test.js.')
417 requestAnimationFrame(function() { 417 requestAnimationFrame(function() {
418 runTests(); 418 runTests();
419 asyncHandle.done() 419 asyncHandle.done()
420 }); 420 });
421 }); 421 });
422 })(); 422 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698