Skip to content

Commit ec67f1b

Browse files
committed
Minor edits
- fix coding style - fix type hints - fix/add links - rewording
1 parent 4cc594d commit ec67f1b

File tree

13 files changed

+139
-121
lines changed

13 files changed

+139
-121
lines changed

__tests__/stylesheet.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,12 +2322,17 @@ describe('CSSViewTransitionRule', () => {
23222322
})
23232323

23242324
/**
2325-
* The following does not conform to the specification, which expects the setter
2326-
* to do nothing and requires implementing it in each CSSRule child classes.
2327-
*
23282325
* @see {@link https://github.com/w3c/csswg-drafts/issues/8778}
2326+
*
2327+
* The specification wants the setter of CSSRule.cssText to do nothing, which
2328+
* requires implementing it in every CSSRule child class, as one cannot set a
2329+
* property when its getter is defined on the child class and its setter is
2330+
* defined on the parent class.
2331+
*
2332+
* Instead, CSSRule.cssText is defined as read-only: in strict mode, it throws
2333+
* an error.
23292334
*/
2330-
it('throws an error when setting CSSRule.cssText', () => {
2335+
test('Setting CSSRule.cssText does nothing', () => {
23312336
const { cssRules: [cssRule] } = createStyleSheet('style {}')
23322337
cssRule.cssText = 'override {}'
23332338
expect(cssRule.cssText).toBe('style {}')

lib/cssom/CSSImportRule-impl.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ class CSSImportRuleImpl extends CSSRuleImpl {
4848
/**
4949
* @returns {string}
5050
* @see {@link https://drafts.csswg.org/cssom-1/#dom-cssrule-csstext}
51-
* @see {@link https://github.com/w3c/csswg-drafts/issues/4828#issuecomment-1059910651}
5251
*/
5352
get cssText() {
5453
const { _conditions, href, layerName, media } = this

lib/cssom/CSSRule.webidl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// https://drafts.csswg.org/css-conditional-3/#extensions-to-cssrule-interface
55
// https://drafts.csswg.org/css-counter-styles-3/#extensions-to-cssrule-interface
66
// https://drafts.csswg.org/css-fonts-4/#om-fontfeaturevalues
7+
// https://github.com/w3c/csswg-drafts/issues/8778
78
[Exposed=Window]
89
interface CSSRule {
910
const unsigned short STYLE_RULE = 1;

lib/parse/configure.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
/**
33
* @param {object} node
44
* @returns {object}
5+
* @see {@link https://drafts.csswg.org/css-cascade-5/#typedef-layer-name}
56
* @see {@link https://drafts.csswg.org/css-mixins-1/#typedef-syntax-component}
67
* @see {@link https://drafts.csswg.org/css-page-3/#syntax-page-selector}
78
* @see {@link https://drafts.csswg.org/css-syntax-3/#urange-syntax}
9+
* @see {@link https://drafts.csswg.org/css-values-5/#typedef-attr-name}
10+
* @see {@link https://drafts.csswg.org/css-view-transitions-2/#typedef-pt-name-and-class-selector}
811
* @see {@link https://drafts.csswg.org/mediaqueries-5/#mq-syntax}
912
* @see {@link https://drafts.csswg.org/selectors-4/#white-space}
1013
*

lib/parse/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ function parseCSSValue(input, definition, context, strategy = 'backtrack') {
627627
/**
628628
* @param {object} declaration
629629
* @param {object} [context]
630-
* @returns {object}
630+
* @returns {object|null}
631631
*/
632632
function parseCSSDeclaration(declaration, context = createContext()) {
633633
if (declaration.important && !context.rule.definition.cascading) {

0 commit comments

Comments
 (0)