New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix error message for deleteRule() #16342
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wpt-pr-bot
approved these changes
Apr 13, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already reviewed downstream.
Previous to this CL, deleteRule on an empty style sheet would throw a confusingly-worded IndexSizeError. Now, it properly throws a RangeError. For example: const styleEl = document.createElement('style'); document.head.appendChild(styleEl); styleEl.sheet.deleteRule(0); --> Uncaught RangeError: Failed to execute 'deleteRule' on 'CSSStyleSheet': The index provided (0) is outside the range [0, 0). Bug: 949523 Change-Id: I306409f53be88f4bead261dd171466fd3aad5565 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1561410 Auto-Submit: Mason Freed <masonfreed@chromium.org> Commit-Queue: Chris Harrelson <chrishtr@chromium.org> Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Cr-Commit-Position: refs/heads/master@{#650697}
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-1561410
branch
from
April 15, 2019 05:38
1e1af1b
to
85408d6
Compare
foolip
pushed a commit
that referenced
this pull request
Sep 6, 2019
This is mainly to get coverage of calling `deleteRule()` on an empty style, which was added and reverted with the wrong exception type: #16342 #16353 The test is split into more subtests, but the order is kept the same and only `assert_throws` tests were added in between tests to avoid having to change anything. For this reason the order of subtests is a bit haphazard.
foolip
added a commit
that referenced
this pull request
Sep 6, 2019
This is mainly to get coverage of calling `deleteRule()` on an empty style, which was added and reverted with the wrong exception type: #16342 #16353 The test is split into more subtests, but the order is kept the same and only `assert_throws` tests were added in between tests to avoid having to change anything. For this reason the order of subtests is a bit haphazard.
foolip
added a commit
that referenced
this pull request
Sep 9, 2019
This is mainly to get coverage of calling `deleteRule()` on an empty style, which was added and reverted with the wrong exception type: #16342 #16353 The test is split into more subtests, but the order is kept the same and only `assert_throws` tests were added in between tests to avoid having to change anything. For this reason the order of subtests is a bit haphazard.
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
Sep 14, 2019
…estonly Automatic update from web-platform-tests Test more CSSStyleSheet error cases (#18892) This is mainly to get coverage of calling `deleteRule()` on an empty style, which was added and reverted with the wrong exception type: web-platform-tests/wpt#16342 web-platform-tests/wpt#16353 The test is split into more subtests, but the order is kept the same and only `assert_throws` tests were added in between tests to avoid having to change anything. For this reason the order of subtests is a bit haphazard. -- wpt-commits: 8ed93b5f2393c8f123d6cc8b6daea9ecbf2eb2fd wpt-pr: 18892
xeonchen
pushed a commit
to xeonchen/gecko
that referenced
this pull request
Sep 14, 2019
…estonly Automatic update from web-platform-tests Test more CSSStyleSheet error cases (#18892) This is mainly to get coverage of calling `deleteRule()` on an empty style, which was added and reverted with the wrong exception type: web-platform-tests/wpt#16342 web-platform-tests/wpt#16353 The test is split into more subtests, but the order is kept the same and only `assert_throws` tests were added in between tests to avoid having to change anything. For this reason the order of subtests is a bit haphazard. -- wpt-commits: 8ed93b5f2393c8f123d6cc8b6daea9ecbf2eb2fd wpt-pr: 18892
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Oct 4, 2019
…estonly Automatic update from web-platform-tests Test more CSSStyleSheet error cases (#18892) This is mainly to get coverage of calling `deleteRule()` on an empty style, which was added and reverted with the wrong exception type: web-platform-tests/wpt#16342 web-platform-tests/wpt#16353 The test is split into more subtests, but the order is kept the same and only `assert_throws` tests were added in between tests to avoid having to change anything. For this reason the order of subtests is a bit haphazard. -- wpt-commits: 8ed93b5f2393c8f123d6cc8b6daea9ecbf2eb2fd wpt-pr: 18892 UltraBlame original commit: 2e44fe0d766c1ca7c6410f9d4e0bffed071e5ef2
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Oct 4, 2019
…estonly Automatic update from web-platform-tests Test more CSSStyleSheet error cases (#18892) This is mainly to get coverage of calling `deleteRule()` on an empty style, which was added and reverted with the wrong exception type: web-platform-tests/wpt#16342 web-platform-tests/wpt#16353 The test is split into more subtests, but the order is kept the same and only `assert_throws` tests were added in between tests to avoid having to change anything. For this reason the order of subtests is a bit haphazard. -- wpt-commits: 8ed93b5f2393c8f123d6cc8b6daea9ecbf2eb2fd wpt-pr: 18892 UltraBlame original commit: 2e44fe0d766c1ca7c6410f9d4e0bffed071e5ef2
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Oct 4, 2019
…estonly Automatic update from web-platform-tests Test more CSSStyleSheet error cases (#18892) This is mainly to get coverage of calling `deleteRule()` on an empty style, which was added and reverted with the wrong exception type: web-platform-tests/wpt#16342 web-platform-tests/wpt#16353 The test is split into more subtests, but the order is kept the same and only `assert_throws` tests were added in between tests to avoid having to change anything. For this reason the order of subtests is a bit haphazard. -- wpt-commits: 8ed93b5f2393c8f123d6cc8b6daea9ecbf2eb2fd wpt-pr: 18892 UltraBlame original commit: 2e44fe0d766c1ca7c6410f9d4e0bffed071e5ef2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previous to this CL, deleteRule on an empty style sheet would throw a
confusingly-worded IndexSizeError. Now, it properly throws a RangeError.
For example:
const styleEl = document.createElement('style');
document.head.appendChild(styleEl);
styleEl.sheet.deleteRule(0);
--> Uncaught RangeError: Failed to execute 'deleteRule' on 'CSSStyleSheet': The index provided (0) is outside the range [0, 0).
Bug: 949523
Change-Id: I306409f53be88f4bead261dd171466fd3aad5565
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1561410
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#650697}