| <script src="../resources/magnitude-perf.js"></script> |
| var element, rel, relToRemove, type; |
| // Test 1 tests that remove is linear when there are N rels. |
| function setupFunction1(magnitude) |
| element = document.createElement(type); |
| rel = Array(magnitude).join('a ') + relToRemove; |
| // Test 2 tests that remove is linear when the length of the rel is N. |
| function setupFunction2(magnitude) |
| element = document.createElement(type); |
| relToRemove = Array(magnitude + 1).join('a'); |
| element.relList.remove(relToRemove); |
| Magnitude.description('Tests that relList remove is linear.'); |
| Magnitude.run(setupFunction1, test, Magnitude.LINEAR); |
| Magnitude.run(setupFunction2, test, Magnitude.LINEAR); |
| Magnitude.run(setupFunction1, test, Magnitude.LINEAR); |
| Magnitude.run(setupFunction2, test, Magnitude.LINEAR); |
| Magnitude.run(setupFunction1, test, Magnitude.LINEAR); |
| Magnitude.run(setupFunction2, test, Magnitude.LINEAR); |