Fix some pre-existing dynamic restyling issues with scrollbar-width.

This was pre-existing but caught by some scrollbar-width tests. A
test-case that reproduces on current nightly:

  data:text/html,<html style="overflow: scroll; scrollbar-color: red red; scrollbar-width: thin">

Toggling the `scrollbar-width` declaration in devtools doesn't change
the effective scrollbar width. Ensure we correctly reflow the scrollbars
in this case.

Differential Revision: https://phabricator.services.mozilla.com/D128515

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1590247
gecko-commit: 16504649f4893ace8dcc78da4900e546f610fe1f
gecko-reviewers: dholbert
diff --git a/css/css-scrollbars/scrollbar-width-paint-003-ref.html b/css/css-scrollbars/scrollbar-width-paint-003-ref.html
new file mode 100644
index 0000000..b7acab4
--- /dev/null
+++ b/css/css-scrollbars/scrollbar-width-paint-003-ref.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<title>CSS Test Reference</title>
+<style>
+  :root { overflow: scroll; scrollbar-color: green green; }
+</style>
diff --git a/css/css-scrollbars/scrollbar-width-paint-003.html b/css/css-scrollbars/scrollbar-width-paint-003.html
new file mode 100644
index 0000000..516c620
--- /dev/null
+++ b/css/css-scrollbars/scrollbar-width-paint-003.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<title>CSS Scrollbars: scrollbar-width correctly updates with overflow: scroll</title>
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<link rel="author" title="Mozilla" href="https://mozilla.org">
+<link rel="match" href="scrollbar-width-paint-003-ref.html">
+<link rel="help" href="https://www.w3.org/TR/css-scrollbars-1/">
+<script src="/common/reftest-wait.js"></script>
+<style>
+  :root {
+    overflow: scroll;
+    scrollbar-width: thin;
+    scrollbar-color: green green;
+  }
+</style>
+<script>
+  requestAnimationFrame(() => requestAnimationFrame(() => {
+    document.documentElement.style.scrollbarWidth = 'auto';
+    takeScreenshot();
+  }));
+</script>