Chromium Code Reviews| Index: LayoutTests/scrollbars/custom-scrollbar-changing-style.html |
| diff --git a/LayoutTests/scrollbars/custom-scrollbar-changing-style.html b/LayoutTests/scrollbars/custom-scrollbar-changing-style.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7df76d2b4c5a2c8af3b99ab17aec7d4c9852321f |
| --- /dev/null |
| +++ b/LayoutTests/scrollbars/custom-scrollbar-changing-style.html |
| @@ -0,0 +1,36 @@ |
| +<!DOCTYPE html> |
| +<style> |
| +::-webkit-scrollbar { |
| + height: 10px; |
| + width: 10px |
| +} |
| +::-webkit-scrollbar-thumb { |
| + background: rgba(255,0,0,0.8); |
| +} |
| +html { |
| + overflow-y: scroll; |
| +} |
| +</style> |
| +<script> |
| + if (window.testRunner) |
| + testRunner.waitUntilDone(); |
| + function addstyle(){ |
| + var addRule = (function(style){ |
| + var sheet = document.head.appendChild(style).sheet; |
|
skobes
2014/11/07 00:13:59
I think this would be easier to understand if the
MuVen
2014/11/07 09:46:59
Done.
|
| + return function(selector, css){ |
| + var propText = Object.keys(css).map(function(p){ |
| + return p+":"+css[p] |
| + }).join(";"); |
| + sheet.insertRule(selector + "{" + propText + "}", sheet.cssRules.length); |
| + } |
| + })(document.createElement("style")); |
| + |
| + addRule("::-webkit-scrollbar-thumb", { |
| + background: "rgba(13,53,178,0.8)", |
| + }); |
| + if (window.testRunner) |
| + testRunner.notifyDone(); |
| + }; |
| +setTimeout(function() {addstyle();}, 1); |
| +</script> |
| +<div style="height:700px"></div> |