Commit graph

51 commits

Author SHA1 Message Date
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
Matt Brubeck
8d540d1f9e Upgrade bincode, pkg-config, regex, cmake, fnv 2016-04-30 15:19:38 -07:00
Simon Sapin
83b3ebf6ac Simplify TOML syntax
* Sections like `[dependencies.foo]` can be entries in a `[dependencies]`
  section with the `{key = value}` syntax.
* Per-target dependencies can be expressed with more general `cfg(…)`
  conditions instead of exact target triples:
  https://github.com/rust-lang/cargo/pull/2328
2016-04-26 23:51:36 +02:00
Simon Sapin
7932ab6ac2 Upgrade to rust-url 1.0 and hyper 0.9 2016-04-23 20:27:58 +02:00
Alberto Corona
5e863f2eb8
Implement HTMLTextArea.setSelectionRange 2016-04-17 17:27:26 +02:00
Simon Sapin
6889f37d9e Remove the url! plugin.
In rust-url 1.0 the `Url` struct is going to have private fields, and there
is no way to to create an aribitrary one without going through the parser.

The plugin never had a clear demonstrated performance benefit,
it was made mostly because it was possible and relatively easy at the time.
2016-04-14 15:35:28 +02:00
Josh Matthews
a8233a135e Implement origin concept. 2016-04-13 10:37:55 +02:00
Matt Brubeck
deca979967 TextInput::max_length should be in code units, not bytes 2016-04-02 07:33:53 -07:00
Matt Brubeck
29fb3f1150 Find the correct column index in adjust_vertical 2016-04-01 14:00:50 -07:00
Matt Brubeck
d7e6f8b0f1 Use correct byte indices in replace_selection 2016-04-01 13:54:02 -07:00
bors-servo
44b2ba2547 Auto merge of #10255 - mbrubeck:box-unscanned, r=pcwalton
Reduce size of layout::fragment::Fragment struct

This reduces the size of the SpecificFragmentInfo enum from 48 to 24.

r? @pcwalton

<!-- 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/10255)
<!-- Reviewable:end -->
2016-03-30 07:49:25 +05:30
Matt Brubeck
33b9aa49db Update path in script_tests::size_of error messages 2016-03-29 08:41:12 -07:00
Matt Brubeck
db2c1841cb Fix delete_char when selection range is empty
An empty selection range should be treated the same as no selection.
Fixes browserhtml/browserhtml#930.
2016-03-25 08:39:53 -07:00
Matt Brubeck
973918967f Dirty elements whose selectors are affected by sibling changes
This fixes incremental layout of nodes that match pseudo-class selectors such
as :first-child, :nth-child, :last-child, :first-of-type, etc.

* Fixes #8191
* Fixes #9063
* Fixes #9303
* Fixes #9448

This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134
2016-02-23 17:31:38 -08:00
Tim Neumann
43c46090cf add XHR::SetRequestHeader Step 3 unit test 2016-02-23 15:22:37 +01:00
Daniel Robertson
d23774d3d7 Add methods to move ByteStrings underlying bytes
Add methods to move the underlying Vec<u8> for ByteString.
2016-02-18 19:40:24 +00:00
Anthony Ramine
9932a5cf82 Abstract out Node::unique_id in its own structure
An UnsafeCell is use to lazily create the Uuid.
2016-02-04 14:22:53 +01:00
David Raifaizen
76f689cd06 Changed blob to use DataSlice with Arc in order to limit wasteful copying of byte vector 2016-01-06 19:41:52 -05:00
Bobby Holley
47059d2d26 Separate style+layout and layout-specific wrapper functionality.
This patch does a number of things, unfortunately all at once:
* Hoists a large subset of the layout wrapper functionality into the style system.
* Merges TElementAttributes into the newly-created TElement.
* Reorganizes LayoutData by style vs layout, and removes LayoutDataShared.
* Simplifies the API for borrowing style/layout data.

There's still more to do to make the style system usable standalone, but
this is a good start.
2015-12-29 11:50:03 -08:00
Anthony Ramine
3c76835615 Properly propagate changes when range or trees are mutated 2015-12-25 23:35:57 +01:00
Sam Gibson
2ba1750c40 Resolves long-running merge conflicts 2015-12-03 14:00:53 +11:00
Sam Gibson
419a26e619 Adds a test for set_content to ignore max_length 2015-12-03 14:00:53 +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
Guillaume Gomez
6e7de62b38 Add check up on extern crate order and sort extern crates alphabetically 2015-11-28 03:11:08 +01:00
Aleksandr Likhanov
4bf21ab15e reduce node.unique_id size
fix sizeof unittest
update Cargo.lock
2015-11-19 00:48:20 +05: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
Alan Jeffrey
64a50bcf56 Added versioning to DOM nodes.
There is now an inclusive_descendants_version field of each node, which
increases each time the node, or any of its descendants, is dirtied.
This can be used for cache invalidation, by caching a version number
and comparting the current version number against the cached version number.
2015-11-06 17:23:16 -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
Ms2ger
dab3926622 Create a helper function to create TextInput structs in its unit test. 2015-11-04 12:09:09 +01:00
Bobby Holley
69255ed169 Bump the expected sizes for Element.
After rebasing, this suddenly became a problem again, even though there's no actual size increase here
(we're shrinking NodeFlags by 1 byte, and adding 1 byte of EventState). Moving the NodeFlags to the end
of Node and the EventState bits to the beginning of Element doesn't seem to helper either.

This is probably a padding issue that's worth investigating at some point, but given the level
of churn in this code it doesn't seem worth it to fuss to much over this right now.
2015-10-16 17:56:33 -07:00
bors-servo
d1269294e6 Auto merge of #7611 - nox:cache-element-id, r=frewsxcv
Cache the `id` attribute on Element

Thanks to @asabil for the original work, I only rebased it.

Fixes #6359 and #7040.


<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7611)
<!-- Reviewable:end -->
2015-09-20 09:23:20 -06:00
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
Ali Sabil
ea655ada10 Cache the id attribute on Element 2015-09-13 23:55:40 +02:00
Michael Wu
941f7dc04b Move EventTargetTypeId/NodeTypeId to DOMClass 2015-09-12 01:09:46 +02:00
bors-servo
4404809e6d Auto merge of #7459 - Mylainos:Issue-#7365, r=jdm
Issue #7365 : test cursor position after clearing selection

In textinput test if the cursor is at the correct position when clearing a selection by press an arrow key.

edit_point is always at the end of the selection, should I test when it's at the beginning ?

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7459)
<!-- Reviewable:end -->
2015-09-01 09:23:12 -06:00
erneyja
17663315dd make test-tidy check that = have space after them 2015-09-01 07:18:19 -04:00
Hugo Thiessard
6a2ae236d4 Issue #7365 : test for cursor position after clearing selection 2015-08-31 09:10:34 +02:00
Simon Sapin
95a252a650 Refactor script::textinput to count UTF-8 bytes rather than code points. 2015-08-28 11:57:40 +02:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Avi Weinstock
f86252a60b Add set_clipboard_context function and relevant plumbing. Use Option more consistantly (less unwraps) in textinput's selection handling. 2015-07-29 12:19:37 -04:00
Michael Wu
1a014beb08 Remove LayoutChan from LayoutDataWrapper 2015-07-04 03:54:40 -04:00
Corey Farwell
8e3f4bba85 Reduce max line length from 150 to 120 characters
Part of https://github.com/servo/servo/issues/6041
2015-05-24 00:01:49 -04:00
Avi Weinstock
d054946f7d Fix test_clipboard_paste to pass on Mac OS. 2015-05-06 15:30:29 -04:00
Avi Weinstock
b742eeca05 Made the clipboard-related functionality in TextInput more testable. Added test_clipboard_paste to the "test-unit" suite. 2015-05-06 11:46:18 -04:00
bors-servo
9974ebb2f9 Auto merge of #5547 - aweinstock314:x11-clipboard, r=jdm
Manual re-opening of #5479 (since it seems that GitHub disables re-opening with the same number after a rebase).

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5547)
<!-- Reviewable:end -->
2015-04-21 14:41:32 -05:00
Avi Weinstock
cf6aef5d51 Make the channel argument to TextInput::new be optional, to support the signature expected by the unit tests. 2015-04-21 15:18:23 -04:00
Simon Sapin
ce1f2bab7b Fix up the splitting of the unit tests crate.
Closes #5707. (Includes a rebase of it.)
Fixes #5688.
2015-04-21 20:22:10 +02:00
Prabhjyot Singh Sodhi
7b9c9e1453 Split up the unit tests crate 2015-04-21 20:05:53 +02:00
Simon Sapin
84e5f1e85b Use the correct license header. 2015-04-08 01:07:58 +02:00
Simon Sapin
3b1cfe8458 Add license headers in tests/unit 2015-04-08 01:07:55 +02:00