Commit graph

131 commits

Author SHA1 Message Date
Matt Brubeck
efc3683cc7 Fix commonmark Markdown warnings in docs, part 1
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is
passed to rustdoc.

This is mostly a global find-and-replace for bare URIs on lines by
themselves in doc comments.
2017-10-17 11:24:57 -07:00
Simon Sapin
aa15dc269f Remove use of unstable box syntax.
http://www.robohornet.org gives a score of 101.36 on master,
and 102.68 with this PR. The latter is slightly better,
but probably within noise level.
So it looks like this PR does not affect DOM performance.

This is expected since `Box::new` is defined as:

```rust
impl<T> Box<T> {
    #[inline(always)]
    pub fn new(x: T) -> Box<T> {
        box x
    }
}
```

With inlining, it should compile to the same as box syntax.
2017-10-16 17:16:20 +02:00
Anthony Ramine
71b015173f Fix the form action IDL attributes
The returned string, if the attribute is present and non-empty,
should be a URL resolved against the element's document's base URL.
2017-10-11 13:56:10 +02:00
Anthony Ramine
f87c2a8d76 Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>,
where Root<T> will be able to handle all the things that need to be
rooted that have a stable traceable address that doesn't move for the
whole lifetime of the root. Stay tuned.
2017-09-26 09:49:10 +02:00
Anthony Ramine
c52fd0a780 Rename MutNullableJS<T> to MutNullableDom<T> 2017-09-26 09:49:02 +02:00
Anthony Ramine
0e3c54c191 Rename dom::bindings::js to dom::bindings::root 2017-09-26 02:19:05 +02:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Christian Poveda
62821a6915 Solving merge conficts related to the html5ever_atoms -> html5ever change 2017-05-03 12:57:49 -05:00
Christian Poveda
875e422fe6 Changed all prefixes from DOMString to the atomic Prefix from html5ever 2017-05-03 10:17:42 -05:00
Simon Sapin
6c518c89b9 Upgrade to html5ever 0.16 2017-05-02 19:24:28 +02:00
Mukilan Thiyagarajan
38a61712e4 Implement the form owner concept 2017-03-15 16:39:55 +01:00
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
bors-servo
beec035eb0 Auto merge of #13969 - bbansalWolfPack:master, r=jdm
html form validation initial steps with  test html file

<!-- Please describe your changes on the following line: -->

Added code for initial steps in html form validation.
1. Added methods for trait validatable
2. implemented stub methods for  elements like HTMLInputElement, HTMLButtonElement, etc

<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X ] `./mach build -d` does not report any errors
- [ X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->

---

This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13969)

<!-- Reviewable:end -->
2016-11-25 06:49:44 -08:00
Bhavya Bansal
2a40877851 html form validation initial steps with test html file, added stub methods, added code to handle validations 2016-11-23 22:46:57 -08:00
Simon Sapin
53b638c0e2 Update to string-cache 0.3 2016-11-03 16:23:05 +01:00
Corey Farwell
2944c8d964 Make make_enumerated_getter prettier again.
Fixes https://github.com/servo/servo/issues/4723.
2016-10-12 23:00:07 -04:00
Anthony Ramine
0b3ab875f4 Remove intrinsic Root::r() 2016-10-11 19:44:32 +02:00
Arthur Marble
883902bd97 Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
Arthur Marble
5ce3510a50 Refactored metaKey to meta_key where possible 2016-09-17 20:31:46 -05:00
Arthur Marble
bdbc04409d This commit refactors altKey to alt_key when possible. 2016-09-17 20:31:46 -05:00
Arthur Marble
fd0622a741 This commit refactors shiftKey to shift_key where possible. 2016-09-17 20:31:46 -05:00
Arthur Marble
77170a14bc This commit refactors ctrlKey to ctrl_key wherever possible. 2016-09-17 20:31:46 -05:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Kuba Birecki
85f4da18a6 Inline DOM element creation into box expressions in components/script/dom/ 2016-07-14 08:44:22 +02:00
Rafael Quintero
80aad09ae4 delete suffixes
delete suffixes for variants SubmittedFrom, ResetFrom

delete suffixes

for variants SubmittedFrom, ResetFrom
2016-06-04 09:23:55 -04:00
Anthony Ramine
cdc7bca944 Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
2016-05-24 10:54:57 +02:00
Manish Goregaokar
102cdaa7cc
Include <button type=submit> data whilst constructing the form dataset 2016-05-23 15:12:19 +05:30
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03: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
Sagar Muchhal
051ffba0e5 Implement initial pieces of form validation. 2016-03-24 09:07:38 -04:00
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
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
Josh Matthews
ffc1c777fe Implement support for modifying the type attribute of button elements. Fixes #9091. 2015-12-30 16:04:05 -05:00
Josh Matthews
7693b03468 Make button elements activatable. Fixes #4837. Fixes #8101. 2015-12-29 10:45:04 -05:00
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
Keith Yeung
3395e54585 Implement basic framework for static and interactive validation on forms 2015-12-15 16:34:42 -08: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
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
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
Ms2ger
6b75078503 Make DOMString a newtype around String, rather than a typedef.
This should make it somewhat easier to experiment with alternative
representations in the future. To reduce churn, this commit leaves the String
field public, though.

Also, this will allow us to use the default String type to represent the IDL
USVString type, which explicitly forbids unpaired surrogates, ans as such is
a better match to the Rust String type.
2015-11-04 12:09:11 +01:00
David Zbarsky
722aa86c89 Get rid of a bunch of explicit derefs 2015-11-03 19:51:46 -08:00
rohan.prinja
6e774ea6eb merge from master 2015-11-03 19:01:23 +09:00
bors-servo
50d51bab7f Auto merge of #8245 - eefriedman:misc-attribute-fixes, r=nox
Use attribute getter/setter macros for misc DOM attributes.

This fixes a few minor bugs.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8245)
<!-- Reviewable:end -->
2015-11-02 15:14:32 +05:30
Eli Friedman
cf8f2b1874 Use attribute getter/setter macros for misc DOM attributes.
This fixes a few minor bugs.

Also adds some better testing for "unsigned long" attributes.
2015-11-01 12:47:28 -08:00
Corey Farwell
9df375195e Implement 'labels' attribute on 'labelable elements' 2015-11-01 09:50:14 -05:00
Bobby Holley
79ac365a68 Move EventState to rust-selectors. 2015-10-30 21:02:35 -07:00
rohan.prinja
bb2536cd01 move Castable into dom::bindings::inheritance 2015-10-30 20:24:42 +09:00
Anthony Ramine
68014af78e Clean up the cast calls 2015-10-21 11:40:34 +02:00