Commit graph

302 commits

Author SHA1 Message Date
Yoav Alon
9bf909ac2f added support for :read-only and :read-write pseudo-classes
partial fix for https://github.com/servo/servo/issues/10732
2016-04-27 01:38:58 +03:00
Alberto Corona
5e863f2eb8
Implement HTMLTextArea.setSelectionRange 2016-04-17 17:27:26 +02:00
bors-servo
934ae41fc9 Auto merge of #10522 - KiChjang:input-cleanup, r=frewsxcv
Various cleanups in HTMLInputElement

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10522)
<!-- Reviewable:end -->
2016-04-12 07:56:38 +05:30
Arnaud Marant
9b8f183cba Issue #10491 add HTMLInputElement attributes that reflect content identically
it uses a new version of string-cache https://github.com/servo/string-cache/pull/148
2016-04-12 00:15:57 +02:00
Keith Yeung
c9193eaeca Remove get_ prefix for functions in LayoutHTMLInputElementHelpers 2016-04-11 09:17:04 -04:00
Keith Yeung
2d503c8281 Rename fn get_form_datum to form_datum 2016-04-11 08:56:47 -04:00
Keith Yeung
814afd6537 Move check for mutability up as a guard clause 2016-04-11 08:55:26 -04:00
Keith Yeung
916c035b57 Rename fn mutable to is_mutable 2016-04-11 08:54:50 -04:00
Keith Yeung
f54a8fc845 Use fn in_same_group where appropriate 2016-04-11 08:41:46 -04:00
Keith Yeung
0541a01924 Rename get_radio_group_name to radio_group_name 2016-04-11 08:20:30 -04:00
Keith Yeung
e4cd8044a5 Remove unused fn get_indeterminate_state 2016-04-11 08:18:53 -04:00
Keith Yeung
311d2c65b6 Rename get_value_mode to value_mode 2016-04-11 08:07:32 -04:00
Corey Farwell
11a3ce1257 Remove get_* on getters as per RFC 0344.
https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#gettersetter-apis

https://github.com/servo/servo/issues/6224
2016-04-10 22:49:35 -04:00
Rahul Sharma
2caa9a2a76 refactors entities from script_thread into script_runtime 2016-04-06 12:46:49 +05:30
Matt Brubeck
776aae6399 Fix incremental reflow of text selection changes
Also replace force_relayout methods with direct Node::dirty calls, for
clarity.
2016-04-01 22:00:05 -07:00
bors-servo
80d903a897 Auto merge of #10019 - rebstar6:htmllabelclick, r=jdm
Fix htmllabelelement click to activate correct element

Address https://github.com/servo/servo/issues/9928

Pass on label click to the label element's labeled control

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10019)
<!-- Reviewable:end -->
2016-03-30 05:41:00 +05:30
Rebecca
3c7e6a4be8 Fix HtmlLabelElement activation to run on correct element
Also removes old code that caused radio button clicks on disabled elements
2016-03-29 18:48:07 -04:00
Matt Brubeck
6171000875 Highlight selected text in input fields
Fixes #9993.  This does not yet allow stylesheets to set the selection colors;
instead it uses a hard-coded orange background and white foreground.
2016-03-24 18:33:26 -07:00
Sagar Muchhal
051ffba0e5 Implement initial pieces of form validation. 2016-03-24 09:07:38 -04:00
bors-servo
f2f6787189 Auto merge of #9930 - rebstar6:htmlclick, r=jdm
Remove activatable element filter within HTMLElement#click()

Address https://github.com/servo/servo/issues/6542

Ensure that click() calls are not limited to activatable elements. Also makes the isTrusted attribute false when synthetic click activation are called from a click() method (as per spec).

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9930)
<!-- Reviewable:end -->
2016-03-11 10:06:24 +05:30
Rebecca
d6678a184b Call synthetic_click_activation for all clicks
Moved synthetic_click_actiavtion out of Activatable trait so it can be
called by all elements (not just activatable). Calls appropriately
from click. Also updates the isdisabled check in click to check for all
types of elements
2016-03-10 14:43:33 -05:00
Saurav Sachidanand
a3d77790a6 Implement input.setSelectionRange 2016-03-10 19:54:21 +05:30
Greg Guthe
e6c31e305d Get input value IDL attribute matching spec
Refs: https://github.com/servo/servo/issues/9455
2016-02-25 18:59:34 -05:00
Daniel Robertson
7a35ef1555 Implement RootedReference<T> for Option<JS<T>>
An implementation of RootedReference for Option<JS<T>> based off of
other implementations of RootedReference for Option wrapped types.
2016-02-16 22:40:03 +00:00
Kamil Muszyński
076cc409e6 Issue #9561 Renamed *_thread_source to *_task_source and ThreadSource to TaskSource 2016-02-14 15:29:44 +01:00
bors-servo
a24e86e76f Auto merge of #9614 - paulrouget:inputEventBubbles, r=mbrubeck
input event should bubble

No test because: https://github.com/servo/servo/issues/9574#issuecomment-181558144

Fix #9574

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9614)
<!-- Reviewable:end -->
2016-02-12 12:00:31 +05:30
Paul Rouget
54e737c2b0 input event should bubble 2016-02-12 07:27:27 +01:00
Ms2ger
5317af1e19 Remove the global argument to EventTarget::{fire_event, fire_simple_event}. 2016-02-08 19:21:56 +01:00
Emilio Cobos Álvarez
a1c830f1c1 Update rust-selectors
This commits updates rust-selectors to use the generic parser, and as
such it moves the element state into the style crate.
2016-02-03 02:11:31 +01:00
bors-servo
099beee85c Auto merge of #8983 - Manishearth:cursors, r=jdm
Various textinput fixes

 - Currently the cursor sticks around if you click elsewhere. Now the text inputs are relayout-ed on blur.
 - Currently whitespace gets collapsed in text input (https://github.com/servo/servo/issues/8772). Not anymore.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8983)
<!-- Reviewable:end -->
2016-01-11 23:21:03 +05:30
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
Brandon Fairchild
fb0304cfdb Rename fire_simple_event_params to fire_event
Fixes #9180.
2016-01-07 13:49:49 -05:00
Manish Goregaokar
f67e208630 Remove virtual call and unconditionally dirty node on set_focus_state 2016-01-07 13:38:05 +05:30
Guillaume Gomez
99ac1a81cc Generate PartialEq automatically 2016-01-03 18:07:09 +01:00
Manish Goregaokar
23e7dfa57b Relayout text input elements on blur 2016-01-03 13:18:24 +05:30
bors-servo
7f156b8c12 Auto merge of #9072 - Manishearth:password-placeholder, r=eefriedman
Fix placeholders for password inputs

currently they show dots instead of the placeholder text

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9072)
<!-- Reviewable:end -->
2016-01-03 10:21:26 +05:30
Manish Goregaokar
cc5844a373 Move placeholder logic out of get_raw_textinput_value 2016-01-03 09:47:30 +05:30
bors-servo
9da739acef Auto merge of #9123 - karyon:clippy_cleanup, r=Manishearth
Fix a bunch of clippy lints

This fixes about 130 clippy lints. Let me know if i should split up the commit.

I wasn't sure about some of the changes, especially map_or instead of map(...).unwrap_or(...) and if let instead of single arm match were not always a strict improvement in my opinion, but i'll leave that decision to the reviewer :)

There are about 150 lints left which i thought were clippy bugs or i didn't know how to fix.

cc @Manishearth

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9123)
<!-- Reviewable:end -->
2016-01-03 09:16:34 +05:30
Iszak Bryan
603d0a54ea Use atom's for matching to gain performance benefits 2016-01-03 00:13:52 +00:00
Johannes Linke
6b215f38ee Fix a bunch of clippy lints 2016-01-02 23:27:15 +01:00
Chad Kimes
0e663e0f2f De-duplicate input event send code 2016-01-02 11:31:22 -05:00
Chad Kimes
12a0884f51 Add 'input' event for HTMLInputElement 2016-01-02 11:07:12 -05:00
Manish Goregaokar
6a0ec85d43 Fix placeholders for password inputs
currently they show dots
2015-12-27 00:18:06 +05:30
bors-servo
89ab368258 Auto merge of #8506 - nox:finish-ranges, r=dzbarsky
Properly propagate changes when range or trees are mutated

Does the same thing as #6817, but storing Range instances directly in their start and end containers.

Cc @dzbarsky

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8506)
<!-- Reviewable:end -->
2015-12-26 04:08:15 +05:30
Arthur Skobara
d38771e270 Implement EventTarget::fire_simple_event and EventTarget::fire_simple_event_params 2015-12-22 13:47:57 +06:00
Keith Yeung
3395e54585 Implement basic framework for static and interactive validation on forms 2015-12-15 16:34:42 -08:00
Arthur Skobara
8d2f9fc586 Add comments for the "Constructing the form data set" algorithm 2015-12-14 08:37:30 +06:00
Anthony Ramine
8f01790f06 Introduce UnbindContext
This holds the context that describes the original node that was removed from a tree
when unbinding from a tree.
2015-12-13 21:14:31 +01:00
Corey Farwell
4accaf50b2 Pass around event types as Atoms instead of Strings
`Event` internally stores the `type` as an `Atom`, and we're `String`s
everywhere, which can cause unnecessary allocations to occur since
they'll end up as `Atom`s anyways.
2015-12-10 23:47:25 -05:00
Tomas Cernaj
5507be2653 Move ScriptMsg from msg crate into script_traits 2015-12-09 20:50:11 +01:00