Skip to content
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

New definition of "H", "L", "M", "T", new feature FORMS (if needed) #56

Merged
merged 10 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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