Fix error message for deleteRule()
Previous to this CL, deleteRule on an empty style sheet would throw a
confusingly-worded error message such as this:
const styleEl = document.createElement('style');
document.head.appendChild(styleEl);
styleEl.sheet.deleteRule(0);
--> Uncaught IndexSizeError: Failed to execute 'deleteRule' on 'CSSStyleSheet': The index provided (0) is larger than the maximum index (4294967295).
Now, it throws this:
--> Uncaught IndexSizeError: Failed to execute 'deleteRule' on 'CSSStyleSheet': Style sheet is empty (length 0).
Bug: 949523
Change-Id: I5eba9942cf7ccc00013dbb3efa2887590d65a19a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1567911
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#650915}Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .