diff --git a/bridge/CMakeLists.txt b/bridge/CMakeLists.txt index 0ae18aa451..501163c87c 100644 --- a/bridge/CMakeLists.txt +++ b/bridge/CMakeLists.txt @@ -376,7 +376,7 @@ if ($ENV{WEBF_JS_ENGINE} MATCHES "quickjs") core/geometry/dom_matrix.cc core/geometry/dom_matrix_read_only.cc core/geometry/dom_point.cc - core/geometry/dom_point_readonly.cc + core/geometry/dom_point_read_only.cc core/html/forms/html_button_element.cc core/html/forms/html_input_element.cc core/html/forms/html_form_element.cc @@ -509,7 +509,7 @@ if ($ENV{WEBF_JS_ENGINE} MATCHES "quickjs") out/qjs_dom_matrix.cc out/qjs_dom_matrix_read_only.cc out/qjs_dom_point.cc - out/qjs_dom_point_readonly.cc + out/qjs_dom_point_read_only.cc out/qjs_union_double_sequencedouble.cc out/qjs_unionhtml_image_elementhtml_canvas_element.cc out/qjs_union_dom_stringcanvas_gradient.cc diff --git a/bridge/bindings/qjs/binding_initializer.cc b/bridge/bindings/qjs/binding_initializer.cc index 043f44be24..300794bf28 100644 --- a/bridge/bindings/qjs/binding_initializer.cc +++ b/bridge/bindings/qjs/binding_initializer.cc @@ -26,7 +26,7 @@ #include "qjs_dom_matrix.h" #include "qjs_dom_matrix_read_only.h" #include "qjs_dom_point.h" -#include "qjs_dom_point_readonly.h" +#include "qjs_dom_point_read_only.h" #include "qjs_dom_string_map.h" #include "qjs_dom_token_list.h" #include "qjs_element.h" @@ -168,7 +168,7 @@ void InstallBindings(ExecutingContext* context) { QJSPath2D::Install(context); QJSDOMMatrixReadOnly::Install(context); QJSDOMMatrix::Install(context); - QJSDOMPointReadonly::Install(context); + QJSDOMPointReadOnly::Install(context); QJSDOMPoint::Install(context); QJSCSSStyleDeclaration::Install(context); QJSInlineCssStyleDeclaration::Install(context); diff --git a/bridge/bindings/qjs/wrapper_type_info.h b/bridge/bindings/qjs/wrapper_type_info.h index bb2f132243..af11c2caa6 100644 --- a/bridge/bindings/qjs/wrapper_type_info.h +++ b/bridge/bindings/qjs/wrapper_type_info.h @@ -83,7 +83,7 @@ enum { JS_CLASS_DOM_MATRIX, JS_CLASS_DOM_MATRIX_READ_ONLY, JS_CLASS_DOM_POINT, - JS_CLASS_DOM_POINT_READONLY, + JS_CLASS_DOM_POINT_READ_ONLY, JS_CLASS_HTML_TEMPLATE_ELEMENT, JS_CLASS_HTML_UNKNOWN_ELEMENT, JS_CLASS_HTML_INPUT_ELEMENT, diff --git a/bridge/core/geometry/dom_point.cc b/bridge/core/geometry/dom_point.cc index 89fdccf596..f47bd1dadb 100644 --- a/bridge/core/geometry/dom_point.cc +++ b/bridge/core/geometry/dom_point.cc @@ -30,16 +30,16 @@ DOMPoint* DOMPoint::Create(ExecutingContext* context, } DOMPoint::DOMPoint(webf::ExecutingContext* context, webf::ExceptionState& exception_state) - : DOMPointReadonly(context, exception_state) {} + : DOMPointReadOnly(context, exception_state) {} DOMPoint::DOMPoint(ExecutingContext* context, double x, ExceptionState& exception_state) - : DOMPointReadonly(context, x, exception_state) {} + : DOMPointReadOnly(context, x, exception_state) {} DOMPoint::DOMPoint(ExecutingContext* context, double x, double y, ExceptionState& exception_state) - : DOMPointReadonly(context, x, y, exception_state) {} + : DOMPointReadOnly(context, x, y, exception_state) {} DOMPoint::DOMPoint(ExecutingContext* context, double x, double y, double z, ExceptionState& exception_state) - : DOMPointReadonly(context, x, y, z, exception_state) {} + : DOMPointReadOnly(context, x, y, z, exception_state) {} DOMPoint::DOMPoint(ExecutingContext* context, double x, double y, double z, double w, ExceptionState& exception_state) - : DOMPointReadonly(context, x, y, z, w, exception_state) {} -DOMPoint::DOMPoint(webf::ExecutingContext* context, webf::NativeBindingObject* native_binding_object): DOMPointReadonly(context, native_binding_object) {} + : DOMPointReadOnly(context, x, y, z, w, exception_state) {} +DOMPoint::DOMPoint(webf::ExecutingContext* context, webf::NativeBindingObject* native_binding_object): DOMPointReadOnly(context, native_binding_object) {} } // namespace webf diff --git a/bridge/core/geometry/dom_point.d.ts b/bridge/core/geometry/dom_point.d.ts index 742fb9ec79..06af3a6c3b 100644 --- a/bridge/core/geometry/dom_point.d.ts +++ b/bridge/core/geometry/dom_point.d.ts @@ -1,3 +1,3 @@ -interface DOMPoint extends DOMPointReadonly { +interface DOMPoint extends DOMPointReadOnly { new(x?: number, y?:number, z?:number, w?:number): DOMPoint; } \ No newline at end of file diff --git a/bridge/core/geometry/dom_point.h b/bridge/core/geometry/dom_point.h index d9371de559..546ae604f7 100644 --- a/bridge/core/geometry/dom_point.h +++ b/bridge/core/geometry/dom_point.h @@ -7,11 +7,11 @@ #include "bindings/qjs/script_wrappable.h" #include "core/binding_object.h" -#include "dom_point_readonly.h" +#include "dom_point_read_only.h" namespace webf { -class DOMPoint : public DOMPointReadonly { +class DOMPoint : public DOMPointReadOnly { DEFINE_WRAPPERTYPEINFO(); public: @@ -38,7 +38,7 @@ class DOMPoint : public DOMPointReadonly { }; template <> struct DowncastTraits { - static bool AllowFrom(const DOMPointReadonly& matrix) { return matrix.IsDOMPoint(); } + static bool AllowFrom(const DOMPointReadOnly& matrix) { return matrix.IsDOMPoint(); } }; } // namespace webf diff --git a/bridge/core/geometry/dom_point_readonly.cc b/bridge/core/geometry/dom_point_read_only.cc similarity index 78% rename from bridge/core/geometry/dom_point_readonly.cc rename to bridge/core/geometry/dom_point_read_only.cc index ca65ef6bc6..8dc21f98d8 100644 --- a/bridge/core/geometry/dom_point_readonly.cc +++ b/bridge/core/geometry/dom_point_read_only.cc @@ -2,9 +2,9 @@ * Copyright (C) 2022-present The WebF authors. All rights reserved. */ -#include "dom_point_readonly.h" +#include "dom_point_read_only.h" -#include +#include "binding_call_methods.h" #include #include "core/executing_context.h" @@ -13,44 +13,44 @@ namespace webf { -DOMPointReadonly* DOMPointReadonly::Create(webf::ExecutingContext* context, webf::ExceptionState& exception_state) { - return MakeGarbageCollected(context, exception_state); +DOMPointReadOnly* DOMPointReadOnly::Create(webf::ExecutingContext* context, webf::ExceptionState& exception_state) { + return MakeGarbageCollected(context, exception_state); } -DOMPointReadonly* DOMPointReadonly::Create(webf::ExecutingContext* context, +DOMPointReadOnly* DOMPointReadOnly::Create(webf::ExecutingContext* context, double x, webf::ExceptionState& exception_state) { - return MakeGarbageCollected(context, x, exception_state); + return MakeGarbageCollected(context, x, exception_state); } -DOMPointReadonly* DOMPointReadonly::Create(webf::ExecutingContext* context, +DOMPointReadOnly* DOMPointReadOnly::Create(webf::ExecutingContext* context, double x, double y, webf::ExceptionState& exception_state) { - return MakeGarbageCollected(context, x, y, exception_state); + return MakeGarbageCollected(context, x, y, exception_state); } -DOMPointReadonly* DOMPointReadonly::Create(webf::ExecutingContext* context, +DOMPointReadOnly* DOMPointReadOnly::Create(webf::ExecutingContext* context, double x, double y, double z, webf::ExceptionState& exception_state) { - return MakeGarbageCollected(context, x, y, z, exception_state); + return MakeGarbageCollected(context, x, y, z, exception_state); } -DOMPointReadonly* DOMPointReadonly::Create(webf::ExecutingContext* context, +DOMPointReadOnly* DOMPointReadOnly::Create(webf::ExecutingContext* context, double x, double y, double z, double w, webf::ExceptionState& exception_state) { - return MakeGarbageCollected(context, x, y, z, w, exception_state); + return MakeGarbageCollected(context, x, y, z, w, exception_state); } -DOMPointReadonly::DOMPointReadonly(webf::ExecutingContext* context, webf::ExceptionState& exception_state) +DOMPointReadOnly::DOMPointReadOnly(webf::ExecutingContext* context, webf::ExceptionState& exception_state) : BindingObject(context->ctx()) { GetExecutingContext()->dartMethodPtr()->createBindingObject(GetExecutingContext()->isDedicated(), GetExecutingContext()->contextId(), bindingObject(), CreateBindingObjectType::kCreateDOMPoint, nullptr, 0); } -DOMPointReadonly::DOMPointReadonly(webf::ExecutingContext* context, double x, webf::ExceptionState& exception_state) +DOMPointReadOnly::DOMPointReadOnly(webf::ExecutingContext* context, double x, webf::ExceptionState& exception_state) : BindingObject(context->ctx()) { NativeValue arguments[] = {NativeValueConverter::ToNativeValue(x)}; @@ -59,7 +59,7 @@ DOMPointReadonly::DOMPointReadonly(webf::ExecutingContext* context, double x, we CreateBindingObjectType::kCreateDOMPoint, arguments, sizeof(arguments) / sizeof(NativeValue)); } -DOMPointReadonly::DOMPointReadonly(webf::ExecutingContext* context, +DOMPointReadOnly::DOMPointReadOnly(webf::ExecutingContext* context, double x, double y, webf::ExceptionState& exception_state) @@ -72,7 +72,7 @@ DOMPointReadonly::DOMPointReadonly(webf::ExecutingContext* context, CreateBindingObjectType::kCreateDOMPoint, arguments, sizeof(arguments) / sizeof(NativeValue)); } -DOMPointReadonly::DOMPointReadonly(webf::ExecutingContext* context, +DOMPointReadOnly::DOMPointReadOnly(webf::ExecutingContext* context, double x, double y, double w, @@ -87,7 +87,7 @@ DOMPointReadonly::DOMPointReadonly(webf::ExecutingContext* context, CreateBindingObjectType::kCreateDOMPoint, arguments, sizeof(arguments) / sizeof(NativeValue)); } -DOMPointReadonly::DOMPointReadonly(webf::ExecutingContext* context, +DOMPointReadOnly::DOMPointReadOnly(webf::ExecutingContext* context, double x, double y, double w, @@ -104,46 +104,46 @@ DOMPointReadonly::DOMPointReadonly(webf::ExecutingContext* context, CreateBindingObjectType::kCreateDOMPoint, arguments, sizeof(arguments) / sizeof(NativeValue)); } -DOMPointReadonly::DOMPointReadonly(webf::ExecutingContext* context, webf::NativeBindingObject* native_binding_object) +DOMPointReadOnly::DOMPointReadOnly(webf::ExecutingContext* context, webf::NativeBindingObject* native_binding_object) : BindingObject(context->ctx(), native_binding_object) {} -double DOMPointReadonly::getPointProperty(const AtomicString& prop) const { +double DOMPointReadOnly::getPointProperty(const AtomicString& prop) const { NativeValue dart_result = GetBindingProperty(prop, FlushUICommandReason::kDependentsOnElement, ASSERT_NO_EXCEPTION()); return NativeValueConverter::FromNativeValue(dart_result); } -void DOMPointReadonly::setPointProperty(const AtomicString& prop, double v, ExceptionState& exception_state) { +void DOMPointReadOnly::setPointProperty(const AtomicString& prop, double v, ExceptionState& exception_state) { if (DynamicTo(this)) { SetBindingProperty(prop, NativeValueConverter::ToNativeValue(v), exception_state); } } -double DOMPointReadonly::x() const { +double DOMPointReadOnly::x() const { return getPointProperty(binding_call_methods::kx); } -void DOMPointReadonly::setX(double v, ExceptionState& exception_state) { +void DOMPointReadOnly::setX(double v, ExceptionState& exception_state) { setPointProperty(binding_call_methods::kx, v, exception_state); } -double DOMPointReadonly::y() { +double DOMPointReadOnly::y() { return getPointProperty(binding_call_methods::ky); } -void DOMPointReadonly::setY(double v, ExceptionState& exception_state) { +void DOMPointReadOnly::setY(double v, ExceptionState& exception_state) { setPointProperty(binding_call_methods::ky, v, exception_state); } -double DOMPointReadonly::z() const { +double DOMPointReadOnly::z() const { return getPointProperty(binding_call_methods::kz); } -void DOMPointReadonly::setZ(double v, ExceptionState& exception_state) { +void DOMPointReadOnly::setZ(double v, ExceptionState& exception_state) { setPointProperty(binding_call_methods::kz, v, exception_state); } -double DOMPointReadonly::w() const { +double DOMPointReadOnly::w() const { return getPointProperty(binding_call_methods::kw); } -void DOMPointReadonly::setW(double v, ExceptionState& exception_state) { +void DOMPointReadOnly::setW(double v, ExceptionState& exception_state) { setPointProperty(binding_call_methods::kw, v, exception_state); } -DOMPoint* DOMPointReadonly::matrixTransform(DOMMatrix* matrix, ExceptionState& exception_state) const { +DOMPoint* DOMPointReadOnly::matrixTransform(DOMMatrix* matrix, ExceptionState& exception_state) const { NativeValue arguments[] = { NativeValueConverter>::ToNativeValue(matrix) }; @@ -157,7 +157,7 @@ DOMPoint* DOMPointReadonly::matrixTransform(DOMMatrix* matrix, ExceptionState& e return MakeGarbageCollected(GetExecutingContext(), native_binding_object); } -NativeValue DOMPointReadonly::HandleCallFromDartSide(const AtomicString& method, +NativeValue DOMPointReadOnly::HandleCallFromDartSide(const AtomicString& method, int32_t argc, const NativeValue* argv, Dart_Handle dart_object) { diff --git a/bridge/core/geometry/dom_point_readonly.d.ts b/bridge/core/geometry/dom_point_read_only.d.ts similarity index 82% rename from bridge/core/geometry/dom_point_readonly.d.ts rename to bridge/core/geometry/dom_point_read_only.d.ts index 7b3ccabb72..88c36e833b 100644 --- a/bridge/core/geometry/dom_point_readonly.d.ts +++ b/bridge/core/geometry/dom_point_read_only.d.ts @@ -1,8 +1,8 @@ -interface DOMPointReadonly { +interface DOMPointReadOnly { x: number; y: number; z: number; w: number; matrixTransform(matrix: DOMMatrix): DOMPoint; - new(x?: number, y?:number, z?:number, w?:number): DOMPointReadonly; + new(x?: number, y?:number, z?:number, w?:number): DOMPointReadOnly; } \ No newline at end of file diff --git a/bridge/core/geometry/dom_point_readonly.h b/bridge/core/geometry/dom_point_read_only.h similarity index 74% rename from bridge/core/geometry/dom_point_readonly.h rename to bridge/core/geometry/dom_point_read_only.h index d0467297f7..52c787f31c 100644 --- a/bridge/core/geometry/dom_point_readonly.h +++ b/bridge/core/geometry/dom_point_read_only.h @@ -20,34 +20,34 @@ struct DOMPointData { class DOMPoint; class DOMMatrix; -class DOMPointReadonly : public BindingObject { +class DOMPointReadOnly : public BindingObject { DEFINE_WRAPPERTYPEINFO(); public: - using ImplType = DOMPointReadonly*; + using ImplType = DOMPointReadOnly*; - static DOMPointReadonly* Create(ExecutingContext* context, ExceptionState& exception_state); - static DOMPointReadonly* Create(ExecutingContext* context, double x, ExceptionState& exception_state); - static DOMPointReadonly* Create(ExecutingContext* context, double x, double y, ExceptionState& exception_state); - static DOMPointReadonly* Create(ExecutingContext* context, + static DOMPointReadOnly* Create(ExecutingContext* context, ExceptionState& exception_state); + static DOMPointReadOnly* Create(ExecutingContext* context, double x, ExceptionState& exception_state); + static DOMPointReadOnly* Create(ExecutingContext* context, double x, double y, ExceptionState& exception_state); + static DOMPointReadOnly* Create(ExecutingContext* context, double x, double y, double z, ExceptionState& exception_state); - static DOMPointReadonly* Create(ExecutingContext* context, + static DOMPointReadOnly* Create(ExecutingContext* context, double x, double y, double z, double w, ExceptionState& exception_state); - DOMPointReadonly() = delete; + DOMPointReadOnly() = delete; - explicit DOMPointReadonly(ExecutingContext* context, ExceptionState& exception_state); - explicit DOMPointReadonly(ExecutingContext* context, double x, ExceptionState& exception_state); - explicit DOMPointReadonly(ExecutingContext* context, double x, double y, ExceptionState& exception_state); - explicit DOMPointReadonly(ExecutingContext* context, double x, double y, double z, ExceptionState& exception_state); - explicit DOMPointReadonly(ExecutingContext* context, + explicit DOMPointReadOnly(ExecutingContext* context, ExceptionState& exception_state); + explicit DOMPointReadOnly(ExecutingContext* context, double x, ExceptionState& exception_state); + explicit DOMPointReadOnly(ExecutingContext* context, double x, double y, ExceptionState& exception_state); + explicit DOMPointReadOnly(ExecutingContext* context, double x, double y, double z, ExceptionState& exception_state); + explicit DOMPointReadOnly(ExecutingContext* context, double x, double y, double z, @@ -72,7 +72,7 @@ class DOMPointReadonly : public BindingObject { const NativeValue* argv, Dart_Handle dart_object) override; protected: - explicit DOMPointReadonly(ExecutingContext* context, NativeBindingObject* native_binding_object); + explicit DOMPointReadOnly(ExecutingContext* context, NativeBindingObject* native_binding_object); private: [[nodiscard]] double getPointProperty(const AtomicString& prop) const; diff --git a/bridge/scripts/code_generator/src/idl/utils.ts b/bridge/scripts/code_generator/src/idl/utils.ts index 9be9708790..fb968f047f 100644 --- a/bridge/scripts/code_generator/src/idl/utils.ts +++ b/bridge/scripts/code_generator/src/idl/utils.ts @@ -15,11 +15,10 @@ export function addIndent(str: String, space: number) { export function getClassName(blob: IDLBlob) { let raw = camelCase(blob.filename[4].toUpperCase() + blob.filename.slice(5)); if (raw.slice(0, 3) == 'dom') { - console.log("className:" + raw) if (raw === 'domMatrixReadonly') { return `DOMMatrixReadOnly`; } else if (raw === 'domPointReadonly') { - return `DOMPointReadonly`; + return `DOMPointReadOnly`; } return 'DOM' + raw.slice(3); }