@@ -10,37 +10,11 @@ static void DocumentConstructor(const v8::FunctionCallbackInfo<v8::Value>& info)
10
10
V8_GET_ISOLATE_CONTEXT_RESOURCE ();
11
11
V8_CHECK_CONSTRUCTOR ();
12
12
V8_CHECK_ARGS_LEN (1 );
13
-
14
- alt::IRmlDocument::CreateOptions options;
15
- options.currentPath = V8Helpers::GetCurrentSourceOrigin (isolate);
16
-
17
- if (info[0 ]->IsObject ())
18
- {
19
- V8_ARG_TO_OBJECT (1 , jsOptions);
20
-
21
- V8_OBJECT_GET_STRING (jsOptions, " url" , url);
22
- options.url = url;
23
-
24
- auto isFullscreen = V8Helpers::Get (ctx, jsOptions, " isFullscreen" );
25
- if (!isFullscreen->IsUndefined ())
26
- {
27
- V8_CHECK (V8Helpers::SafeToBoolean (isFullscreen, isolate, options.isFullscreen ), " Failed to convert isFullscreen to boolean" );
28
- }
29
-
30
- auto size = V8Helpers::Get (ctx, jsOptions, " size" );
31
- if (!size->IsUndefined ())
32
- {
33
- V8_CHECK (V8Helpers::SafeToVector2Int (size, ctx, options.size ), " Failed to convert size to boolean" );
34
- }
35
- }
36
- else
37
- {
38
- // Old way
39
- V8_ARG_TO_STRING (1 , url);
40
- options.url = url;
41
- }
42
-
43
- auto doc = alt::ICore::Instance ().CreateDocument (options, resource->GetResource ());
13
+
14
+ V8_ARG_TO_STRING (1 , url);
15
+
16
+ std::string origin = V8Helpers::GetCurrentSourceOrigin (isolate);
17
+ auto doc = alt::ICore::Instance ().CreateDocument (url, origin, resource->GetResource ());
44
18
V8_BIND_BASE_OBJECT (doc, " Failed to create Rml document" );
45
19
}
46
20
@@ -109,24 +83,6 @@ static void CreateTextNode(const v8::FunctionCallbackInfo<v8::Value>& info)
109
83
V8_RETURN (resource->GetBaseObjectOrNull (node));
110
84
}
111
85
112
- static void SetDrawOrigin (const v8::FunctionCallbackInfo<v8::Value>& info)
113
- {
114
- V8_GET_ISOLATE_CONTEXT_RESOURCE ();
115
- V8_GET_THIS_BASE_OBJECT (document, alt::IRmlDocument);
116
- V8_CHECK_ARGS_LEN (1 );
117
-
118
- V8_ARG_TO_VECTOR3 (1 , origin);
119
- document->SetDrawOrigin (origin);
120
- }
121
-
122
- static void ClearDrawOrigin (const v8::FunctionCallbackInfo<v8::Value>& info)
123
- {
124
- V8_GET_ISOLATE_CONTEXT_RESOURCE ();
125
- V8_GET_THIS_BASE_OBJECT (document, alt::IRmlDocument);
126
-
127
- document->ClearDrawOrigin ();
128
- }
129
-
130
86
static void StaticGetByID (const v8::FunctionCallbackInfo<v8::Value>& info)
131
87
{
132
88
V8_GET_ISOLATE_CONTEXT_RESOURCE ();
@@ -161,7 +117,6 @@ extern V8Class v8RmlDocument("RmlDocument",
161
117
V8Helpers::SetAccessor<alt::IRmlDocument, const std::string&, &alt::IRmlDocument::GetSourceUrl>(isolate, tpl, " sourceUrl" );
162
118
V8Helpers::SetAccessor<alt::IRmlDocument, bool , &alt::IRmlDocument::IsVisible>(isolate, tpl, " isVisible" );
163
119
V8Helpers::SetAccessor<alt::IRmlDocument, bool , &alt::IRmlDocument::IsModal>(isolate, tpl, " isModal" );
164
- V8Helpers::SetAccessor<alt::IRmlDocument, bool , &alt::IRmlDocument::IsFullscreen>(isolate, tpl, " isFullscreen" );
165
120
166
121
V8Helpers::SetAccessor<alt::IRmlDocument, IRmlElement*, &alt::IRmlDocument::GetBody>(isolate, tpl, " body" );
167
122
@@ -172,7 +127,4 @@ extern V8Class v8RmlDocument("RmlDocument",
172
127
173
128
V8Helpers::SetMethod (isolate, tpl, " createElement" , &CreateElement);
174
129
V8Helpers::SetMethod (isolate, tpl, " createTextNode" , &CreateTextNode);
175
-
176
- V8Helpers::SetMethod (isolate, tpl, " setDrawOrigin" , &SetDrawOrigin);
177
- V8Helpers::SetMethod (isolate, tpl, " clearDrawOrigin" , &ClearDrawOrigin);
178
130
});
0 commit comments