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
bors-servo
63762d2b52
Auto merge of #8786 - eefriedman:localname-atom, r=jdm
...
Remove unnecessary conversion to/from DOMString for localName.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8786 )
<!-- Reviewable:end -->
2015-12-03 15:05:22 +05:30
Sam Gibson
9668500e97
Makes setting negative values to maxLength throw an IndexSize exception
2015-12-03 14:00:59 +11:00
Sam Gibson
6d1624f9d0
Add additional WPT tests for maxlength parser set
2015-12-03 14:00:57 +11:00
Sam Gibson
85b99f8ba4
Fix typo in error message
2015-12-03 14:00:56 +11:00
Sam Gibson
ecc7035de6
Correct the default max length
2015-12-03 14:00:55 +11:00
Sam Gibson
eecdfdf6c1
Makes int_getter macro, and uses -1 as default maxlength instead of maxint
2015-12-03 14:00:52 +11:00
Sam Gibson
d26c555e2a
Adds support for input element's maxlength attr
...
servo/servo#7320
servo/servo#7004
2015-12-03 14:00:51 +11:00
Eli Friedman
e42dcb3712
Remove unnecessary conversion to/from DOMString for localName.
2015-12-02 13:42:45 -08:00
Eli Friedman
c02c0576c8
Compute attribute name atoms at compile-time.
2015-11-27 15:42:34 -08:00
Alan Jeffrey
3dec6edd10
Update string_cache to 0.2.
...
Updated string_cache, html5ever, xml5ever and selectors in Cargo.toml files and Cargo.lock.
Removed references to string_cache_plugin.
Import atom! and ns! from string_cache.
Replaced ns!("") by ns!().
Replaced ns!(XML) and co by ns!(xml) and co.
Replaced atom!(foo) by atom!("foo").
Replaced Atom::from_slice by Atom::from.
Replaced atom.as_slice() by &*atom.
2015-11-25 10:13:21 -06:00
Keith Yeung
19294db6e5
Split ConstellationMsg into ScriptMsg and CompositorMsg
2015-11-16 23:10:53 -08:00
Corey Farwell
7b8d5bbb97
Prefer atoms over strs for string comparisons
2015-11-12 23:46:48 -05:00
Alan Jeffrey
5db67b5981
Added in-place mutation to DOMString.
...
The methods which are currently implemented are the ones on String that are currently being used:
string.push_str(...), string.clear() and string.extend(...). We may want to revisit this API.
2015-11-12 17:53:01 -06:00
Alan Jeffrey
84bde75b42
Replaced DOMString constructor by conversion functions.
...
Replaced DOMString(...) by DOMString::from(...).
Replaced ....0 by String::from(...).
Removed any uses of .to_owner() in DOMString::from("...").
2015-11-12 17:52:59 -06:00