View Issue Details

IDProjectCategoryView StatusLast Update
0034733pas2jsrtlpublic2018-12-21 22:57
ReportersilvioprogAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product VersionProduct Build 
Target Version1.2.0Fixed in Versiontrunk 
Summary0034733: [PATCH] Added new web types: TJSHTMLButtonElement/TJSHTMLEmbedElement
DescriptionHi.

Patch in attachment.

best
TagsNo tags attached.
Fixed in Revision226
Attached Files
  • 0001-Web.pas-patch-by-silvioprog.diff (2,301 bytes)
    Index: packages/rtl/web.pas
    ===================================================================
    --- packages/rtl/web.pas	(revision 225)
    +++ packages/rtl/web.pas	(working copy)
    @@ -2044,7 +2044,7 @@
         formMethod : string;
         formNoValidate : Boolean;
         formTarget : string;
    -    height : Boolean;
    +    height : string;
         indeterminate : boolean;
         inputMode : string;
         max : string;
    @@ -2065,7 +2065,7 @@
         selectionDirection : string;
         useMap : string;
         value : string;
    -    width : NativeInt;
    +    width : string;
         property files : TJSHTMLFileList Read FFiles;
         property form : TJSHTMLFormElement read FForm;
         property labels : TJSNodeList read FLabels;
    @@ -2075,6 +2075,48 @@
         property validity : TJSValidityState read FValidity;
       end;
     
    +  { TJSHTMLMenuElement }
    +
    +  TJSHTMLMenuElement = class external name 'HTMLMenuElement' (TJSHTMLElement) //  uhm... should it be declared? it is experimental at Mozilla docs...
    +  end;
    +
    +  { TJSHTMLButtonElement }
    +
    +  TJSHTMLButtonElement = class external name 'HTMLButtonElement' (TJSHTMLElement)
    +  private
    +    FForm: TJSHTMLFormElement; external name 'form';
    +    FLabels: TJSNodeList; external name 'labels';
    +    FValidationmMessage: String; external name 'validationMessage';
    +    FValidity: TJSValidityState; external name 'validity';
    +    FWillValidate: boolean; external name 'willValidate';
    +  Public
    +    autofocus : boolean;
    +    disabled : boolean;
    +    formAction : String;
    +    formEnctype : String;
    +    formMethod : String;
    +    formNoValidate : Boolean;
    +    formTarget : String;
    +    menu: TJSHTMLMenuElement;
    +    _type : String; external name 'type';
    +  Public
    +    property form : TJSHTMLFormElement Read FForm;
    +    property labels : TJSNodeList Read FLabels;
    +    property validationMessage : String Read FValidationmMessage;
    +    property validity : TJSValidityState Read FValidity;
    +    property willValidate : boolean read FWillValidate;
    +  end;
    +
    +  { TJSHTMLEmbedElement }
    +
    +  TJSHTMLEmbedElement = class external name 'HTMLEmbedElement' (TJSHTMLElement)
    +  Public
    +    height: String;
    +    src: String;
    +    _type : String; external name 'type';
    +    width: String;
    +  end;
    +
       { TJSHTMLOptionElement }
     
       TJSHTMLOptionElement = class external name 'Option' (TJSHTMLElement)
    

Activities

silvioprog

2018-12-19 23:23

reporter  

0001-Web.pas-patch-by-silvioprog.diff (2,301 bytes)
Index: packages/rtl/web.pas
===================================================================
--- packages/rtl/web.pas	(revision 225)
+++ packages/rtl/web.pas	(working copy)
@@ -2044,7 +2044,7 @@
     formMethod : string;
     formNoValidate : Boolean;
     formTarget : string;
-    height : Boolean;
+    height : string;
     indeterminate : boolean;
     inputMode : string;
     max : string;
@@ -2065,7 +2065,7 @@
     selectionDirection : string;
     useMap : string;
     value : string;
-    width : NativeInt;
+    width : string;
     property files : TJSHTMLFileList Read FFiles;
     property form : TJSHTMLFormElement read FForm;
     property labels : TJSNodeList read FLabels;
@@ -2075,6 +2075,48 @@
     property validity : TJSValidityState read FValidity;
   end;
 
+  { TJSHTMLMenuElement }
+
+  TJSHTMLMenuElement = class external name 'HTMLMenuElement' (TJSHTMLElement) //  uhm... should it be declared? it is experimental at Mozilla docs...
+  end;
+
+  { TJSHTMLButtonElement }
+
+  TJSHTMLButtonElement = class external name 'HTMLButtonElement' (TJSHTMLElement)
+  private
+    FForm: TJSHTMLFormElement; external name 'form';
+    FLabels: TJSNodeList; external name 'labels';
+    FValidationmMessage: String; external name 'validationMessage';
+    FValidity: TJSValidityState; external name 'validity';
+    FWillValidate: boolean; external name 'willValidate';
+  Public
+    autofocus : boolean;
+    disabled : boolean;
+    formAction : String;
+    formEnctype : String;
+    formMethod : String;
+    formNoValidate : Boolean;
+    formTarget : String;
+    menu: TJSHTMLMenuElement;
+    _type : String; external name 'type';
+  Public
+    property form : TJSHTMLFormElement Read FForm;
+    property labels : TJSNodeList Read FLabels;
+    property validationMessage : String Read FValidationmMessage;
+    property validity : TJSValidityState Read FValidity;
+    property willValidate : boolean read FWillValidate;
+  end;
+
+  { TJSHTMLEmbedElement }
+
+  TJSHTMLEmbedElement = class external name 'HTMLEmbedElement' (TJSHTMLElement)
+  Public
+    height: String;
+    src: String;
+    _type : String; external name 'type';
+    width: String;
+  end;
+
   { TJSHTMLOptionElement }
 
   TJSHTMLOptionElement = class external name 'Option' (TJSHTMLElement)

silvioprog

2018-12-19 23:26

reporter   ~0112726

Last edited: 2018-12-19 23:28

View 2 revisions

Some notes. According to Mozilla, the "checkValidity()/setCustomValidity(in DOMString error)" are not supported for button elements. 🤔

I changed the "height:Boolean" to "height:string" (the same for "width"). They are declared as DOMString (maybe for Num-px or Num-%) at Mozilla docs.

Michael Van Canneyt

2018-12-21 18:50

administrator   ~0112791

Fixed, merged to 1.2.0 release.

Thank you very much !

silvioprog

2018-12-21 22:57

reporter   ~0112792

Thanks for applying dude! :-)

Issue History

Date Modified Username Field Change
2018-12-19 23:23 silvioprog New Issue
2018-12-19 23:23 silvioprog File Added: 0001-Web.pas-patch-by-silvioprog.diff
2018-12-19 23:26 silvioprog Note Added: 0112726
2018-12-19 23:28 silvioprog Note Edited: 0112726 View Revisions
2018-12-20 12:09 Michael Van Canneyt Assigned To => Michael Van Canneyt
2018-12-20 12:09 Michael Van Canneyt Status new => assigned
2018-12-21 18:50 Michael Van Canneyt Fixed in Revision => 226
2018-12-21 18:50 Michael Van Canneyt Note Added: 0112791
2018-12-21 18:50 Michael Van Canneyt Status assigned => resolved
2018-12-21 18:50 Michael Van Canneyt Fixed in Version => trunk
2018-12-21 18:50 Michael Van Canneyt Resolution open => fixed
2018-12-21 18:50 Michael Van Canneyt Target Version => 1.2.0
2018-12-21 22:57 silvioprog Note Added: 0112792
2018-12-21 22:57 silvioprog Status resolved => closed