Skip to content

Commit

Permalink
Specify values as nonnull in Selection API to align with the spec
Browse files Browse the repository at this point in the history
This includes:
  - the return type of `Selection.prototype.getRangeAt`
  - the `range` parameter of `Selection.prototype.removeRange`
  - the `node` parameter of `Selection.prototype.containsNode`

The parameters in Selection.prototype.setBaseAndExtent have also be
updated to align with the names used in the spec.

This involved changing the return type to void and making the event
Non null.

Closes #3389.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=249925099
  • Loading branch information
realityforge authored and tjgq committed May 25, 2019
1 parent fef3117 commit 05ee39f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions externs/browser/gecko_dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ Selection.prototype.addRange = function(range) {};

/**
* @param {number} index
* @return {Range}
* @return {!Range}
* @nosideeffects
* @see https://w3c.github.io/selection-api/#dom-selection-getrangeat
*/
Expand Down Expand Up @@ -520,7 +520,7 @@ Selection.prototype.collapseToEnd = function() {};
Selection.prototype.collapseToStart = function() {};

/**
* @param {Node} node
* @param {!Node} node
* @param {boolean=} allowPartialContainment
* @return {boolean}
* @nosideeffects
Expand Down Expand Up @@ -549,7 +549,7 @@ Selection.prototype.extend = function(parentNode, offset) {};
Selection.prototype.removeAllRanges = function() {};

/**
* @param {Range} range
* @param {!Range} range
* @return {undefined}
* @see https://w3c.github.io/selection-api/#dom-selection-removerange
*/
Expand Down
10 changes: 5 additions & 5 deletions externs/browser/webkit_dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ Selection.prototype.type;
Selection.prototype.empty = function() {};

/**
* @param {Node} baseNode
* @param {number} baseOffset
* @param {Node} extentNode
* @param {number} extentOffset
* @param {Node} anchorNode
* @param {number} anchorOffset
* @param {Node} focusNode
* @param {number} focusOffset
* @return {undefined}
* @see https://w3c.github.io/selection-api/#dom-selection-setbaseandextent
*/
Selection.prototype.setBaseAndExtent =
function(baseNode, baseOffset, extentNode, extentOffset) {};
function(anchorNode, anchorOffset, focusNode, focusOffset) {};

/**
* @param {string} alter
Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/resources.json

Large diffs are not rendered by default.

0 comments on commit 05ee39f

Please sign in to comment.