Skip to content

Commit

Permalink
New definition of "H", "L", "M", "T", new feature FORMS (if needed) (
Browse files Browse the repository at this point in the history
…#56)

* update definitions

* fix

* fix

* fix

* fix

* Update src/lib/features.js

Co-authored-by: Francesco Trotta <[email protected]>

* Update src/lib/features.js

Co-authored-by: Francesco Trotta <[email protected]>

* Update src/lib/features.js

Co-authored-by: Francesco Trotta <[email protected]>

* update definitions

* fix

---------

Co-authored-by: Francesco Trotta <[email protected]>
  • Loading branch information
Clayblockunova and fasttime authored Oct 14, 2024
1 parent 49a64aa commit fa66053
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/lib/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ function getFHPaddingEntries(index)
var FF_SRC = Feature.FF_SRC;
var FILL = Feature.FILL;
var FLAT = Feature.FLAT;
var FORMS = Feature.FORMS;
var FROM_CODE_POINT = Feature.FROM_CODE_POINT;
var FUNCTION_19_LF = Feature.FUNCTION_19_LF;
var FUNCTION_22_LF = Feature.FUNCTION_22_LF;
Expand Down Expand Up @@ -915,9 +916,9 @@ function getFHPaddingEntries(index)
],
'H':
[
define('(RP_3_WA + document.createElement(false))[11]', ANY_DOCUMENT),
define('btoa(true)[1]', ATOB),
define('"".link()[3]', CAPITAL_HTML),
define('(RP_3_WA + document.forms)[11]', FORMS),
define
({ expr: '(RP_3_WA + Function("return history")())[11]', optimize: true }, HISTORY),
define('(RP_1_WA + Audio)[10]', HTMLAUDIOELEMENT),
Expand All @@ -938,9 +939,9 @@ function getFHPaddingEntries(index)
],
'L':
[
define('(RP_0_S + document.createElement(false))[11]', ANY_DOCUMENT),
define('btoa(".")[0]', ATOB),
define('(RP_3_WA + "".fontcolor())[11]', CAPITAL_HTML),
define('(RP_0_S + document.forms)[11]', FORMS),
define('(RP_0_S + Audio)[12]', HTMLAUDIOELEMENT),
define
(
Expand Down Expand Up @@ -987,10 +988,10 @@ function getFHPaddingEntries(index)
],
'M':
[
define('(RP_0_S + document.createElement(false))[10]', ANY_DOCUMENT),
define('btoa(0)[0]', ATOB),
define('"".small()[2]', CAPITAL_HTML),
define('(RP_0_S + self)[10]', DOMWINDOW),
define('(RP_0_S + document.forms)[10]', FORMS),
define('(RP_4_A + Date())[30]', GMT),
define('(RP_0_S + Audio)[11]', HTMLAUDIOELEMENT),
define('USER_AGENT[0]', MOZILLA),
Expand Down Expand Up @@ -1047,6 +1048,7 @@ function getFHPaddingEntries(index)
),
define('btoa(NaN)[0]', ATOB),
define('"".fontcolor([])[20]', CAPITAL_HTML),
define('(RP_1_WA + document.forms)[10]', FORMS),
define('(RP_3_WA + Date())[30]', GMT),
define('(RP_0_S + Audio)[10]', HTMLAUDIOELEMENT),
defineCharDefault({ atob: false }),
Expand Down
7 changes: 7 additions & 0 deletions src/lib/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,13 @@ var featureInfos =
return available;
},
},
FORMS:
{
description:
'Existence of the object document.forms with string representation "[object ' +
'HTMLCollection]".',
aliasFor: 'ANY_DOCUMENT',
},
FROM_CODE_POINT:
{
description: 'Existence of the function String.fromCodePoint.',
Expand Down
7 changes: 6 additions & 1 deletion test/helpers/feature-emulation.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,12 @@
'[object HTMLVideoElement]' : '[object HTMLUnknownElement]';
return elementStr;
};
document = { createElement: createElement, nodeName: '#document' };
document =
{
createElement: createElement,
forms: '[object HTMLCollection]',
nodeName: '#document',
};
override(this, 'document', { value: document });
}
var valueOf = createStaticSupplier(str);
Expand Down

0 comments on commit fa66053

Please sign in to comment.