haxetink / tink_domspec Goto Github PK
View Code? Open in Web Editor NEWTinkerbell DOM Specification
License: The Unlicense
Tinkerbell DOM Specification
License: The Unlicense
Although things normally seem to work well for me, from a hxx string as soon as I use some Int
attribute for a tag accepting them (e.g. <input>
accepts maxLength:Int
) I get an error.
For example
function render() '<div class="alert" tabIndex="-1">'
Gives String should be Null<Int>
.
Another example
<input maxLength="34" type="text" name="nickname" value="" />
Gives String should be Null<Int>
.
I cannot remove the double quotes, or then I have this error: expected "
.
I tried with curly brackets like maxLength="{34}"
but no luck either.
Now it parses from the Attr name (e.g. InputAttr
-> InputElement
) which is not very flexible.
For example I just added ins/del
element, they have their own attributes in additional to the global ones. But they don't have a separate type InsElement/DelElement
. So we should type them as plain Element
It seems that FormAttr
typedef is incomplete. I can't use any of these attributes in a Coconut application:
name
target
encoding
/enctype
acceptCharset
autocomplete
noValidate
Every time I use any of these attributes, I get the error:
<form> has no attribute XXX
See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement
I'm looking for a way to go from 'div'
to js.html.DivElement
etc. It should be useful to type EventFrom
properly. The letter casing is not consistent so I think mapping it like tink.domspec.Tags
is probably the best way. I can contribute if it's something that fits here?
I wrote a test(a5ec800) to check for existence for attributes specified in Attributes.hx
and noticed that meta#charset is actually not a property of the "meta" DOM element in JS.
SO says so:
there is no property that reflects the charset content attribute.
For possibility to inline svg like this
<div class="icon-for-button">
<svg>
<rect ... />
<path .... />
</svg>
</div>
aria-hidden="true"
is an attribute which has the effect of having the marked node and its children ignored by the accessibilty APIs (so <span aria-hidden="true">Not everything should be said</span>
would not be read aloud by text-to-speech systems).
I would like to submit a PR having aria-hidden
plus a couple of others to address some missing accessibility features, which I think is important both for library support and users.
However I am unsure how, because of the dash (aria-hidden
) it contains.
Another related question. This code compiles fine:
function render() '
<div class="modal" style="display: block" tabIndex={-1}>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{title}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<!--<span aria-hidden="true">×</span>-->
</button>
... etc
';
It is puzzling that the commented out <span aria-hidden..
> would refuse to compile (I think it's because it's missing from the specs). While the <button .. aria-label="Close">
right above it sees no problem, yet it is absent from the view markup in the DOM inspector.
Is there an obvious reason why?
I want to add this to typedef GlobalAttr<Style>
:
@:html('aria-label') @:optional var ariaLabel(default, never):String;
@:html('aria-labeledby') @:optional var ariaLabelledby(default, never):String;
@:html('aria-describedby') @:optional var ariaDescribedby(default, never):String;
@:html('aria-autocomplete') @:optional var ariaAutocomplete(default, never):String;
@:html('aria-dropeffect') @:optional var ariaDropEffect(default, never):String;
@:html('aria-hidden') @:optional var ariaHidden(default, never):Bool;
@:html('aria-disabled') @:optional var ariaDisabled(default, never):Bool;
@:html('aria-checked') @:optional var ariaChecked(default, never):Bool;
@:html('aria-haspopup') @:optional var ariaHasPopup(default, never):Bool;
@:html('aria-grabbed') @:optional var ariaGrabbed(default, never):Bool;
But I get this error:
type TType(tink.domspec.Tags,[]) has no fields
It specifically throws that error on the Bool
s, with just the Strings it compiles nicely.
Using Haxe 4.0.5 / latest git tink_domspec
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.