Commit graph

28 commits

Author SHA1 Message Date
Kagami Sascha Rosylight
52ea5204a2 Convert Web IDL void to undefined
Fixes #27660
2022-01-05 03:39:33 +01:00
Arjun Ramachandrula
00f69dd50f Ported Rel, SetRel, and RelList from HTMLAnchorElement into HTMLForElement
Updated tests to reflect rel and relList in HTMLFormElement

Added AttrValue as style

Added attr

Updated outstanding test cases

Fixed formatting. Hopefully this time works

Implemented HTMLFormElement.relList
2020-07-14 12:37:57 -04:00
Maxim Tsoy
8194da2752 Implement HTMLFormElement.requestSubmit()Also includes a fix for reentrant form submission behavior 2020-07-02 12:33:21 +02:00
teapotd
779552ee7d Form constraints validation 2020-04-02 10:16:46 +02:00
Patrick Shaughnessy
111ede9c77 Make property descriptors hold named/indexed property values 2020-01-10 12:32:08 -05:00
Chintan Gandhi
f73e1453ca uncomment the named getter from HTMLFormElement.webidl 2019-11-27 10:37:32 -05:00
Kagami Sascha Rosylight
e271edad92 Convert [HTMLConstructor] as constructor extension 2019-10-19 20:55:45 +09:00
Kagami Sascha Rosylight
2660f35925 Remove [PrimaryGlobal] 2019-10-03 14:25:23 +09:00
Jan Andre Ikenmeyer
6b0c111126
Update MPL license to https (part 2) 2018-11-19 14:46:57 +01:00
Jon Leighton
ce7bae8834 Implement setRangeText API
Spec: https://html.spec.whatwg.org/multipage/#dom-textarea/input-setrangetext

In order to do this, we need to define the SelectionMode enum in WebIDL:
https://html.spec.whatwg.org/multipage/#selectionmode

Since the enum is used by HTMLTextAreaElement and HTMLInputElement, it
doesn't seem to make sense to define it in the WebIDL file for one or
other of those.

However, we also can't create a stand-alone SelectionMode.webidl file,
because the current binding-generation code won't generate a "pub mod
SelectionMode;" line in mod.rs unless SelectionMode.webidl contains
either an interface or a namespace. (This logic happens in
components/script/dom/bindings/codegen/Configuration.py:35, in the
Configuration.__init__ method.)

I thought about changing the binding-generation code, but that seems
difficult. So I settled for placing the enum inside
HTMLFormElement.webidl, as that seems like a "neutral" location. We
could equally settle for putting it under HTMLTextAreaElement or
HTMLInputElement, it probably doesn't really matter.

The setRangeText algorithm set the "dirty value flag" on the
input/textarea. I made some clean-ups related to this:

1. HTMLTextAreaElement called its dirty value flag "value_changed"; I
   changed this to "value_dirty" to be consistent with the spec.

2. HTMLInputElement had a "value_changed" field and also a "value_dirty"
   field, which were each used in slightly different places (and
   sometimes in both places). I consolidated these into a single
   "value_dirty" field, which was necessary in order to make some of the
   tests pass.

TextControl::set_dom_range_text replaces part of the existing textinput
content with the replacement string (steps 9-10 of the algorithm). My
implementation changes the textinput's selection and then replaces the
selection. A downside of this approach is that we lose the original
selection state from before the call to setRangeText. Therefore, we have
to save the state into the original_selection_state variable so that we
can later pass it into TextControl::set_selection_range. This allows
TextControl::set_selection_range to correctly decide whether or not to
fire the select event.

An alternative approach would be to implement a method on TextInput
which allows a subtring of the content to be mutated, without touching
the current selection state. However, any such method would potentially
put the TextInput into an inconsistent state where the edit_point and/or
selection_origin is a TextPoint which doesn't exist in the content. It
would be up to the caller to subsequently make sure that the TextInput
gets put back into a valid state (which would actually happen, when
TextControl::set_selection_range is called).

I think TextInput's public API should not make it possible to put it
into an invalid state, as that would be a potential source of bugs.
That's why I didn't take this approach. (TextInput's public API does
currently make it possible to create an invalid state, but I'd like to
submit a follow-up patch to lock this down.)
2018-01-26 20:12:33 +01:00
Connor Brewster
2460997ee1 Add CEReactions where needed 2017-07-18 12:22:20 -06:00
Connor Brewster
d951dee640 Add HTMLConstructor attributes where needed 2017-06-15 21:16:57 -06:00
Jonathan Guillotte-Blouin
6a4173fbeb Bug 1270740 - remove requestAutocomplete reference 2017-05-15 14:23:30 -07:00
Scott Trinh
ab0ddf9040 Partial fix for 12415 2016-10-17 16:08:07 -04:00
Ms2ger
ed743bb50c Explicitly expose everything everywhere. 2016-07-12 13:06:48 +02:00
mrmiywj
4bb88432b2 indexed getter of form elements 2016-06-14 21:40:32 -07:00
edunham
7ae63b1213 Remove modelines everywhere but tests/wpt 2016-04-20 10:49:09 -07:00
Joshua Holmer
75d258f866 Update HTMLFormElement.length to be of type unsigned long
Fixes #9402
2016-01-22 12:09:12 -05:00
Corey Farwell
f72d153c8d Implement HTMLFormElement::Length 2016-01-10 14:44:13 -05:00
Corey Farwell
bff8947e43 Implement HTMLFormElement::Elements
Fixes #8566
2016-01-10 12:08:24 -05:00
Corey Farwell
8f35652f25 Update HTMLFormElement WebIDL to match spec
https://html.spec.whatwg.org/multipage/#htmlformelement
2016-01-08 20:38:56 -05:00
Corey Farwell
9b68d715de Explicitly place '/' before fragment for multipage spec links
This prevents us from 301 redirecting, which could cause the fragment to
get lost
2015-10-10 12:07:10 -04:00
Corey Farwell
85f2b6fc5b Replace usage of old-style WHATWG spec links 2015-10-10 11:55:09 -04:00
Corey Farwell
5eaa922045 Update WHATWG links to use HTTPS
Extracted this out of #5649

This commit was created with the following commands:

```
find . -iname "*.webidl" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)whatwg.org/https:\1whatwg.org/g'
```

```
find . -iname "*.rs" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)whatwg.org/https:\1whatwg.org/g'
```
2015-04-13 21:34:27 -07:00
Matthew Rasmus
f0ce2af89c Implements basic form resetting
What can this do? Reset `<input type=text>` fields back to their default
value through a call to a form's reset method. That's all for now!

Fixes compile error after rebase
2014-12-16 11:33:56 -08:00
Manish Goregaokar
b28a4c8858 Implement extremely basic form submission (fixes #3554) 2014-10-11 16:00:16 +05:30
Manish Goregaokar
332c94b730 Implement most of HTMLFormElement's webidl 2014-10-07 21:12:55 +05:30
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00
Renamed from src/components/script/dom/webidls/HTMLFormElement.webidl (Browse further)