Simon Sapin
40b4348824
Upgrade to rustc 1.4.0-dev (cb9323ec0 2015-09-01)
2015-09-02 09:22:17 +02:00
wilmoz
64ac4f175f
Make test-tidy check that braces have spaces before or after them
2015-08-31 12:30:55 -05:00
Anthony Ramine
709d347872
Make the traits for the IDL interfaces take &self
2015-08-27 22:27:43 +02:00
Anthony Ramine
2a028f66a2
Remove AttributeHandlers
...
On components/script/*.rs:
# Remove imports.
/^ *use dom::element::\{.*AttributeHandlers/ {
s/\{AttributeHandlers, /\{/
s/, AttributeHandlers//g
s/\{([a-zA-Z]+)\}/\1/
/\{\}/d
s/::self;$/;/
}
/^ *use dom::element::\{?AttributeHandlers\}?;$/d
# Remove AttributeHandlers.
/^pub trait AttributeHandlers \{$/,/^\}$/D
# Patch AttributeHandlers methods.
/^impl<'a> AttributeHandlers for &'a Element \{/,/^\}$/ {
s/^impl<'a> AttributeHandlers for &'a Element \{/impl Element {/
/^ *fn /s/\(self([,)])/\(\&self\1/
/^ *fn.*\(&self/s/fn/pub fn/
}
The few error cases were then fixed by hand.
2015-08-27 16:59:04 +02:00
Anthony Ramine
c831c2c0a5
Remove helper traits
...
Now that JSRef<T> is gone, there is no need to have helper traits.
On components/script/*.rs:
# Remove imports.
/^ *use dom::[a-z]+::\{.*Helpers/ {
s/\{(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers, /\{/
s/, (Raw[^L]|[^L][^a])[a-zA-Z]+Helpers([,}])/\2/g
s/\{([a-zA-Z]+)\}/\1/
/\{\}/d
s/::self;$/;/
}
/^ *use dom::[a-z]+::\{?(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers\}?;$/d
On components/script/dom/*.rs:
# Ignore layout things.
/^(pub )?(impl|trait).*Layout.* \{/,/^}$/ { P; D; }
# Delete helpers traits.
/^(pub )?trait ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? \{$/,/^\}$/D
# Patch private helpers.
/^impl.*Private.*Helpers/,/^\}$/ {
s/^impl<'a> Private([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for &'a ([^ ]+) \{$/impl \3 {/
/^ *(unsafe )?fn .*\(self.*[<&]'a/ {
s/&'a /\&/g
s/<'a, /</g
}
/^ *(unsafe )?fn /s/\(self([,)])/\(\&self\1/
}
# Patch public helpers.
/^impl.*Helpers/,/^\}$/ {
s/^impl(<'a>)? ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for (&'a )?([^ ]+) \{$/impl \5 {/
/^ *(unsafe )?fn .*\(self.*[<&]'a/ {
s/&'a /\&/g
s/<'a, /</g
}
/^ *(unsafe )?fn .*\(&?self[,)]/s/(unsafe )?fn/pub &/
/^ *pub (unsafe )?fn /s/\(self([,)])/\(\&self\1/
}
The few error cases were then fixed by hand.
2015-08-27 16:59:02 +02:00
João Oliveira
fd87c8cb3e
make dom_struct derive HeapSizeOf,
...
closes #7357
2015-08-27 01:17:48 +01:00
bors-servo
48945b0fc1
Auto merge of #7397 - Manishearth:doublepointer-meet-fire, r=nox
...
Remove doublepointer in VirtualMethods, and from_borrowed_ref
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7397 )
<!-- Reviewable:end -->
2015-08-26 15:01:12 -06:00
Manish Goregaokar
4678ec16bb
remove to_borrowed_ref, fix Activatable
2015-08-27 02:27:42 +05:30
Manish Goregaokar
b33c5427bc
Remove doublepointer in VirtualMethods, and from_borrowed_ref
...
Most of the heavy lifting done by:
```
$ ls *rs | xargs gawk -i inplace '/let .*: &&.*from_borrowed_ref/{sub("&&", "\\&");sub("_borrowed_","_");} {print $0}'
$ ls *rs | xargs gawk -i inplace "/impl.*VirtualMethods/{in_vm=1; sub(/<'a>/,\"\");sub(/&'a /,\"\")} /^}\$/{in_vm=0;} in_vm{\$0=gensub(/\\*self([^.])/,\"self\\\1\",\"g\"); sub(/from_borrowed_ref/,\"from_ref\")} {print}"
```
2015-08-27 02:14:48 +05:30
bors-servo
fa06a96f8a
Auto merge of #7334 - servo:active, r=SimonSapin
...
Parse :active pseudo-class selector.
This is #7258 with a spec link added in doc-comment.
The pseudo-class is never matched, but this can still help with stylesheets like `a:hover, a:active { color: something }` where failing to parse one pseudo-class makes the entire selector list invalid.
I filed #7333 about actually making it match.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7334 )
<!-- Reviewable:end -->
2015-08-24 04:23:13 -06:00
Johann Tuffe
ec07178b6f
sort all uses
2015-08-20 20:47:12 +08:00
Patrick Walton
6567c269cf
script: Update rust-selectors
to get :active
support.
...
I couldn't find the place in the spec where the precise behavior of
`:active` is described, so I don't set it. However, all the machinery to
keep track of its status is in place.
Improves YouTube.
2015-08-17 17:52:21 -07:00
João Oliveira
067a22a868
Replace uses of for foo in bar.iter()
,
...
and `for foo in bar.iter_mut(), and for foo in bar.into_iter()
(continuation of #7197 )
2015-08-18 01:46:11 +01:00
bors-servo
31413f4313
Auto merge of #7188 - servo:set_inline_style_property_priority, r=nox
...
Fix Element::set_inline_style_property_priority’s handling of priority
Thanks to @michaelwu for pointing out a copy-paste error.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7188 )
<!-- Reviewable:end -->
2015-08-15 09:17:31 -06:00
Bogdan Cuza
45145108da
Measure heap memory usage for more types. Fixes #6951
2015-08-13 21:44:41 +03:00
Simon Sapin
39ce15f20d
Fix Element::set_inline_style_property_priority’s handling of priority
...
Thanks to mwu for pointing out a copy-paste error.
2015-08-13 17:07:17 +02:00
Ms2ger
bd31b51a87
Use the base URL to parse style attributes.
2015-08-08 11:26:34 +02:00
Patrick Walton
df29b1e878
script: Make the legacy presentational attributes on <td>
apply to
...
`<th>` too.
Makes the Google SERPs not so narrow.
2015-08-06 10:26:45 -07:00
Josh Matthews
039929da5c
Warning police.
...
Closes #6949 .
2015-08-04 15:16:15 +02:00
Josh Matthews
8620fe5995
Start reporting memory usage for Window and all nodes in all DOM trees for frame treese in script tasks.
2015-08-03 23:05:00 -04:00
Glenn Watson
b9fea3deb3
Fix percentage height calculation, absolute containing block height calculations.
...
It's not possible to correctly determine during the css cascade whether the container height
is explicitly specified. Additionally, the spec https://drafts.csswg.org/css2/visudet.html#the-height-property
says this should affect the *used* height, rather than the computed height.
This significantly improves the layout in #6643 .
2015-08-03 10:47:56 +10:00
Patrick Walton
9bd8edea4a
script: Use Arc::make_unique
instead of Arc::get_mut
when updating
...
inline styles.
Transitions make the reasoning in the comment in the relevant sections
not true.
2015-08-02 09:10:17 -07:00
Simon Sapin
06ba62b012
Remove some PropertyDeclaration cloning.
2015-07-31 08:09:25 +02:00
Simon Sapin
d2bd070dc3
Refactor CSSStyleDeclaration::setProperty to not synthesize a name: value
string to parse.
2015-07-31 08:09:24 +02:00
Simon Sapin
1033886409
Fix CSSStyleDeclaration.setPropertyPriority
...
Before, it was a complicated no-op. (`parse_style_attribute` expects
input like `a: b; c: d;`, when given just a name it return an empty
vector.)
2015-07-31 08:08:36 +02:00
bors-servo
58fa3b69b7
Auto merge of #5851 - evilpie:background, r=SimonSapin
...
Implement the HTML background attribute
Fixes #5835
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5851 )
<!-- Reviewable:end -->
2015-07-29 14:37:45 -06:00
Bogdan Cuza
233a769c67
Add spec links
2015-07-28 13:28:41 +02:00
bors-servo
e0bd80f807
Auto merge of #6662 - tschneidereit:client-geometry, r=glennw,pcwatson
...
Implement Element.client{Top,Left,Width,Height}
This isn't done, but contains a working implementation of at least `clientTop`. Feedback would be much appreciated: it's probably far from ideal.
Implementing `clientLeft` is straight-forward, I think, but `clientWidth` and `clientHeight` require accessing the `border_box` - and I don't know how that works, yet.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6662 )
<!-- Reviewable:end -->
2015-07-27 20:45:05 -06:00
bors-servo
705c95dedb
Auto merge of #6660 - nox:children-changed, r=jdm
...
Introduce VirtualMethods::children_changed()
This virtual method mimics the behaviour of mutation observers and make it more viable than the older child_inserted(), which didn't cover removed nodes and was called as many times as there were inserted nodes.
A few other shortcomings where remove_child() was called directly instead of Node::remove() were also fixed while at it.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6660 )
<!-- Reviewable:end -->
2015-07-25 11:39:20 -06:00
Anthony Ramine
389a9ff643
Introduce RootedVec<JS<T>>::r()
2015-07-23 20:56:27 +02:00
bors-servo
f44d75e5b2
Auto merge of #6715 - Ms2ger:layoutelement, r=jdm
...
Implement more methods on LayoutJS.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6715 )
<!-- Reviewable:end -->
2015-07-23 12:40:52 -06:00
Ms2ger
487eef88e3
Move the state getters to LayoutElementHelpers.
2015-07-23 20:30:59 +02:00
Simon Sapin
055a1c5cee
Update rust-selectors
...
Update for https://github.com/servo/rust-selectors/pull/37
2015-07-23 18:53:57 +02:00
Ms2ger
9cc1e017ee
Move local_name and namespace to LayoutJS<Element>.
2015-07-22 18:28:17 +02:00
Ms2ger
23c679d55a
Implement style_attribute() on LayoutJS<Element>.
2015-07-22 17:27:23 +02:00
Till Schneidereit
162ecd0aac
Implement client{Top, Left, Height, Width} element properties
2015-07-19 15:04:50 +02:00
David Zbarsky
bc1eb97671
Remove some more unnecessary let bindings
2015-07-14 14:48:16 -04:00
Corey Farwell
78d2fe6e9b
Complete FIXMEs related to UFCS
2015-07-14 09:24:53 +09:00
David Zbarsky
326b2a7161
Test element prefix for element equality
2015-07-10 14:41:37 -04:00
Simon Sapin
75e3e787f6
Upgrade to rustc 1.3.0-dev (f3b97a74a 2015-07-03)
2015-07-04 11:32:41 +02:00
bors-servo
bbb39082e0
Auto merge of #6529 - dwins:master, r=Manishearth
...
Refactor #[jstraceable] to #[derive(JSTraceable)]
fixes #6524 . I had to make an additional change not mentioned in the ticket - adding the `#[feature]` to enable deriving custom traits but I assume that's expected at this time.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6529 )
<!-- Reviewable:end -->
2015-07-01 18:27:40 -06:00
David Winslow
4cf46bff2d
Refactor #[jstraceable] to #[derive(JSTraceable)]
...
fixes #6524
2015-07-01 18:27:06 -04:00
Matt Brubeck
13072c7b0c
Remove string_cache dependency from util.
...
Move `namespace::from_domstring` from util to script::dom, because it is used
only in that crate.
2015-07-01 10:04:53 -07:00
Ms2ger
108c9b161c
Remove unused imports.
2015-06-27 19:37:12 +02:00
Simon Sapin
9e1a674b16
Update rust-selectors
2015-06-26 12:35:08 -07:00
Maciej Skrzypkowski
21f495139f
Refactoring, return an Atom from Element::parsed_name. #5774
2015-06-23 08:55:40 +02:00
bors-servo
c119b59e82
Auto merge of #6427 - servo:selector-traits-refactor, r=Ms2ger
...
Update rust-selectors
https://github.com/servo/rust-selectors/pull/30
r? @Ms2ger
This conflicts with the SpiderMonkey upgrade #6150 . I’m happy to wait until that lands and rebase.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6427 )
<!-- Reviewable:end -->
2015-06-21 11:12:07 -06:00
Ms2ger
c019897a50
Implement AttrHelpersForLayout for LayoutJS<Attr> rather than Attr itself.
2015-06-20 18:51:25 +02:00
Tom Schuster
e44f8f5609
Implement the HTML background attribute
2015-06-20 15:06:03 +02:00
Simon Sapin
fc25397c91
Update rust-selectors
...
https://github.com/servo/rust-selectors/pull/30
2015-06-20 07:05:43 +02:00