Skip to content

Commit 3f152ec

Browse files
author
OlegT
committed
ALTV-754 Revert "ALTV-732 | New rml APIs (#354)"
This reverts commit 60fc7a5.
1 parent 60fc7a5 commit 3f152ec

File tree

2 files changed

+6
-54
lines changed

2 files changed

+6
-54
lines changed

client/src/bindings/RmlDocument.cpp

+5-53
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,11 @@ static void DocumentConstructor(const v8::FunctionCallbackInfo<v8::Value>& info)
1010
V8_GET_ISOLATE_CONTEXT_RESOURCE();
1111
V8_CHECK_CONSTRUCTOR();
1212
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());
4418
V8_BIND_BASE_OBJECT(doc, "Failed to create Rml document");
4519
}
4620

@@ -109,24 +83,6 @@ static void CreateTextNode(const v8::FunctionCallbackInfo<v8::Value>& info)
10983
V8_RETURN(resource->GetBaseObjectOrNull(node));
11084
}
11185

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-
13086
static void StaticGetByID(const v8::FunctionCallbackInfo<v8::Value>& info)
13187
{
13288
V8_GET_ISOLATE_CONTEXT_RESOURCE();
@@ -161,7 +117,6 @@ extern V8Class v8RmlDocument("RmlDocument",
161117
V8Helpers::SetAccessor<alt::IRmlDocument, const std::string&, &alt::IRmlDocument::GetSourceUrl>(isolate, tpl, "sourceUrl");
162118
V8Helpers::SetAccessor<alt::IRmlDocument, bool, &alt::IRmlDocument::IsVisible>(isolate, tpl, "isVisible");
163119
V8Helpers::SetAccessor<alt::IRmlDocument, bool, &alt::IRmlDocument::IsModal>(isolate, tpl, "isModal");
164-
V8Helpers::SetAccessor<alt::IRmlDocument, bool, &alt::IRmlDocument::IsFullscreen>(isolate, tpl, "isFullscreen");
165120

166121
V8Helpers::SetAccessor<alt::IRmlDocument, IRmlElement*, &alt::IRmlDocument::GetBody>(isolate, tpl, "body");
167122

@@ -172,7 +127,4 @@ extern V8Class v8RmlDocument("RmlDocument",
172127

173128
V8Helpers::SetMethod(isolate, tpl, "createElement", &CreateElement);
174129
V8Helpers::SetMethod(isolate, tpl, "createTextNode", &CreateTextNode);
175-
176-
V8Helpers::SetMethod(isolate, tpl, "setDrawOrigin", &SetDrawOrigin);
177-
V8Helpers::SetMethod(isolate, tpl, "clearDrawOrigin", &ClearDrawOrigin);
178130
});

0 commit comments

Comments
 (0)