| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 })(); |
| OLD | NEW |