Skip to content

Commit

Permalink
New aliases CREATE_ELEMENT and NODE_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime committed Oct 15, 2024
1 parent fa66053 commit bbb56da
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 2 deletions.
30 changes: 30 additions & 0 deletions api-doc/interfaces/FeatureAll.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,16 @@ Available in Internet Explorer 10+, Safari before 14.1, and Android Browser. Thi

***

### CREATE\_ELEMENT

> **CREATE\_ELEMENT**: [`ElementaryFeature`](ElementaryFeature.md)
Existence of the function document.createElement.

An alias for `ANY_DOCUMENT`.

***

### DEFAULT

> **DEFAULT**: [`PredefinedFeature`](PredefinedFeature.md)
Expand Down Expand Up @@ -424,6 +434,16 @@ Available in Chrome, Edge, Firefox, Safari 12+, Opera, and Node.js 11+.

***

### FORMS

> **FORMS**: [`ElementaryFeature`](ElementaryFeature.md)
Existence of the object document.forms with string representation "\[object HTMLCollection\]".

An alias for `ANY_DOCUMENT`.

***

### FROM\_CODE\_POINT

> **FROM\_CODE\_POINT**: [`ElementaryFeature`](ElementaryFeature.md)
Expand Down Expand Up @@ -846,6 +866,16 @@ Features available in Node.js 7.6 to 9.

***

### NODE\_NAME

> **NODE\_NAME**: [`ElementaryFeature`](ElementaryFeature.md)
Existence of the string document.nodeName that starts with a number sign \("#"\).

An alias for `ANY_DOCUMENT`.

***

### NODECONSTRUCTOR

> **NODECONSTRUCTOR**: [`ElementaryFeature`](ElementaryFeature.md)
Expand Down
42 changes: 42 additions & 0 deletions api-doc/interfaces/FeatureConstructor.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,20 @@ Available in Internet Explorer 10+, Safari before 14.1, and Android Browser. Thi

***

### CREATE\_ELEMENT

> **CREATE\_ELEMENT**: [`ElementaryFeature`](ElementaryFeature.md)
Existence of the function document.createElement.

An alias for `ANY_DOCUMENT`.

#### Inherited from

[`FeatureAll`](FeatureAll.md).[`CREATE_ELEMENT`](FeatureAll.md#create_element)

***

### DEFAULT

> **DEFAULT**: [`PredefinedFeature`](PredefinedFeature.md)
Expand Down Expand Up @@ -682,6 +696,20 @@ Available in Chrome, Edge, Firefox, Safari 12+, Opera, and Node.js 11+.

***

### FORMS

> **FORMS**: [`ElementaryFeature`](ElementaryFeature.md)
Existence of the object document.forms with string representation "\[object HTMLCollection\]".

An alias for `ANY_DOCUMENT`.

#### Inherited from

[`FeatureAll`](FeatureAll.md).[`FORMS`](FeatureAll.md#forms)

***

### FROM\_CODE\_POINT

> **FROM\_CODE\_POINT**: [`ElementaryFeature`](ElementaryFeature.md)
Expand Down Expand Up @@ -1264,6 +1292,20 @@ Features available in Node.js 7.6 to 9.

***

### NODE\_NAME

> **NODE\_NAME**: [`ElementaryFeature`](ElementaryFeature.md)
Existence of the string document.nodeName that starts with a number sign \("#"\).

An alias for `ANY_DOCUMENT`.

#### Inherited from

[`FeatureAll`](FeatureAll.md).[`NODE_NAME`](FeatureAll.md#node_name)

***

### NODECONSTRUCTOR

> **NODECONSTRUCTOR**: [`ElementaryFeature`](ElementaryFeature.md)
Expand Down
6 changes: 4 additions & 2 deletions src/lib/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ function getFHPaddingEntries(index)
var CALL_ON_GLOBAL = Feature.CALL_ON_GLOBAL;
var CAPITAL_HTML = Feature.CAPITAL_HTML;
var CONSOLE = Feature.CONSOLE;
var CREATE_ELEMENT = Feature.CREATE_ELEMENT;
var DOCUMENT = Feature.DOCUMENT;
var DOMWINDOW = Feature.DOMWINDOW;
var ESC_HTML_ALL = Feature.ESC_HTML_ALL;
Expand Down Expand Up @@ -389,6 +390,7 @@ function getFHPaddingEntries(index)
var MOZILLA = Feature.MOZILLA;
var NAME = Feature.NAME;
var NODECONSTRUCTOR = Feature.NODECONSTRUCTOR;
var NODE_NAME = Feature.NODE_NAME;
var NO_FF_SRC = Feature.NO_FF_SRC;
var NO_IE_SRC = Feature.NO_IE_SRC;
var NO_OLD_SAFARI_ARRAY_ITERATOR = Feature.NO_OLD_SAFARI_ARRAY_ITERATOR;
Expand Down Expand Up @@ -772,7 +774,7 @@ function getFHPaddingEntries(index)
],
'#':
[
define('document.nodeName[0]', ANY_DOCUMENT),
define('document.nodeName[0]', NODE_NAME),
defineCharDefault(),
],
// '$'
Expand Down Expand Up @@ -1080,8 +1082,8 @@ function getFHPaddingEntries(index)
'V':
[
define('"v"[TO_UPPER_CASE]()'),
define('(RP_0_S + document.createElement("video"))[12]', ANY_DOCUMENT),
define('btoa(undefined)[10]', ATOB),
define('(RP_0_S + document.createElement("video"))[12]', CREATE_ELEMENT),
defineCharDefault({ atob: false }),
],
'W':
Expand Down
11 changes: 11 additions & 0 deletions src/lib/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ var featureInfos =
},
attributes: { 'web-worker': 'no-console-in-web-worker' },
},
CREATE_ELEMENT:
{
description: 'Existence of the function document.createElement.',
aliasFor: 'ANY_DOCUMENT',
},
DOCUMENT:
{
description:
Expand Down Expand Up @@ -626,6 +631,12 @@ var featureInfos =
},
attributes: { 'web-worker': 'web-worker-restriction' },
},
NODE_NAME:
{
description:
'Existence of the string document.nodeName that starts with a number sign ("#").',
aliasFor: 'ANY_DOCUMENT',
},
NO_FF_SRC:
{
description:
Expand Down

0 comments on commit bbb56da

Please sign in to comment.