just for with expressions

This commit is contained in:
Adam D. Ruppe 2025-02-08 15:46:18 -05:00
parent 34481024a6
commit ea09f6530a
1 changed files with 18 additions and 0 deletions

18
dom.d
View File

@ -2308,6 +2308,7 @@ class Element : DomParent {
// do nothing, this is primarily a virtual hook
// for links and forms
void setValue(string field, string value) { }
void setValue(string field, string[] value) { }
// this is a thing so i can remove observer support if it gets slow
@ -3351,6 +3352,15 @@ class Element : DomParent {
return stealChildren(d.root);
}
/++
Returns `this` for use inside `with` expressions.
History:
Added December 20, 2024
+/
inout(Element) self() inout pure @nogc nothrow @safe scope return {
return this;
}
/++
Inserts a child under this element after the element `where`.
@ -5750,6 +5760,10 @@ class Link : Element {
updateQueryString(vars);
}
override void setValue(string name, string[] variable) {
assert(0, "not implemented FIXME");
}
/// Removes the given variable from the query string
void removeValue(string name) {
auto vars = variablesHash();
@ -5821,6 +5835,10 @@ class Form : Element {
setValue(field, value, true);
}
override void setValue(string name, string[] variable) {
assert(0, "not implemented FIXME");
}
// FIXME: doesn't handle arrays; multiple fields can have the same name
/// Set's the form field's value. For input boxes, this sets the value attribute. For