Corey Farwell
f14f09e886
Use util::str::str_join in more places
...
Instead of intermediate allocations of `Vec`s, we should utilize
`str_join` which operates on iterators
2015-09-28 19:57:06 -04:00
Ravi Shankar
889eec364b
sorted the extern crate, mod & use declarations
2015-09-24 02:12:45 +05:30
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
bors-servo
e1ede2074d
Auto merge of #7429 - GyrosOfWar:serialize_list_space_fix, r=jdm
...
Fixed serialize_list to no longer append an additional space at the e…
…nd of the string.
Fixes #7404
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7429 )
<!-- Reviewable:end -->
2015-09-02 09:15:16 -06:00
bors-servo
eaf90c0b1c
Auto merge of #7452 - nox:cleanup-attributes, r=nox
...
Introduce VirtualMethods::attribute_mutated()
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7452 )
<!-- Reviewable:end -->
2015-09-02 08:14:33 -06:00
Martin Tomasi
ccddc3c13e
Fixed serialize_list to no longer append an additional space at the end of the string
2015-09-02 15:46:04 +02:00
Corey Farwell
3a1d140ab5
Enforce linking to spec for method implementations via macros
2015-08-31 21:02:23 -04:00
Anthony Ramine
105d990845
Replace many uses of to_ascii_lowercase() by make_ascii_lowercase()
2015-08-30 15:30:00 +02:00
Corey Farwell
5ccb0d43ef
Merge adjacent identical impl
sections
...
Prior to #7416 and #7401 , many of these `impl` sections were not
identical
2015-08-28 10:30:42 -04:00
Anthony Ramine
709d347872
Make the traits for the IDL interfaces take &self
2015-08-27 22:27:43 +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
João Oliveira
1829c72061
remove PrivateCSSStyleDeclarationHelpers trait from Element,
...
call get_inline_style_declaration and
get_important_inline_style_declaration inline
closes #7319
2015-08-23 14:15:21 +01:00
bors-servo
6e06cae44a
Auto merge of #7288 - mdibaiee:computedstyle-element, r=Ms2ger
...
Fix #7268 - getComputedStyle should take `Element`, not `HTMLElement`
This is my first patch, I hope I'm doing it right.
About the test, do you think this is enough and reliable?
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7288 )
<!-- Reviewable:end -->
2015-08-22 20:43:45 -06:00
Mahdi Dibaiee
b7d25159d3
Fix #7268 - getComputedStyle should take Element
, not HTMLElement
2015-08-22 15:16:15 +04:30
Johann Tuffe
ec07178b6f
sort all uses
2015-08-20 20:47:12 +08: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
Bogdan Cuza
45145108da
Measure heap memory usage for more types. Fixes #6951
2015-08-13 21:44:41 +03:00
David Zbarsky
a3ee46fc9c
Make CSSStyleDeclaration setters rethrow errors instead of unwrapping and crashing.
2015-08-11 00:34:41 -04: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
David Zbarsky
36145d0686
Return None as style for elements not in a document
2015-07-30 12:36:08 -04:00
David Zbarsky
e484d6b5e3
Implement getComputedStyle
2015-07-29 20:17:50 -04:00
Bogdan Cuza
233a769c67
Add spec links
2015-07-28 13:28:41 +02:00
Michael Wu
675267b782
Upgrade to SM 39
2015-06-19 18:42:48 -04:00
Simon Sapin
5428226e04
Remove usage of String::from_str, deprecated in #6377
2015-06-15 15:37:14 +02:00
Anthony Ramine
7197052c0d
Uniformise root() methods
...
They now live in traits Rootable, OptionalOptionalRootable, OptionalRootable
and ResultRootable.
2015-04-28 09:22:45 +02:00
Corey Farwell
cc4a64e1fe
Add/update comments with links to spec
...
Extracted out of #5649
* add more hyperlinks to associated specification for structs/methods
* follow redirects and update links
* replace broken links
* removal of WHATWG multipage page name since the page name is not
guaranteed to be stable
2015-04-14 18:03:13 -04:00
Eric Hegnes
e398725242
Consistently name enum members in dom::bindings::error::Error
...
Fixes #5521
2015-04-05 00:09:40 -04:00
Corey Farwell
86c254ab6f
Cleanup script::dom::cssstyledeclarations
...
* Group imports
* Convert seralization helper function to use `Iterator::fold`
* Remove basically pointless `serialize_value` helper function
* Wrap lines longer than 100 chars
* Add URLs to spec
2015-03-30 12:38:06 -04:00
Corey Farwell
d838fcce30
Remove some unnecessary uses of as_slice
...
For the majority of these cases, `as_slice` can be removed due to
`Deref`. In particular, `Deref` for:
* `String` -> `str`
* `Atom` -> `str`
The latter of those two requires, a bump of the locked `string-cache`
library
2015-03-29 14:42:19 -04:00
Josh Matthews
c816975750
Documentation and cleanup.
2015-03-03 16:25:40 -05:00
Josh Matthews
e2c4f5ed67
Move everything unrelated to the frame tree out of Page and into Document or Window. Reduce the API surface of Page to a bare minimum to allow for easier future removal.
2015-03-03 16:25:40 -05:00
Ms2ger
6d30ec77c8
Replace uint/int by usize/isize in various places.
2015-02-20 14:45:47 +01:00
Simon Sapin
d13d36f57f
End the libstyle 'pub use' madness.
2015-01-30 15:08:29 +01:00
Ms2ger
505159a464
Import the util crate as util rather than servo_util.
...
This used to conflict with the util crate from the standard library, which
has long since been removed.
The import in layout has not been changed because of a conflict with the
util mod there.
2015-01-29 12:16:41 +01:00
Manish Goregaokar
b68b7e87c8
self import
2015-01-28 13:46:00 +05:30
Josh Matthews
95fc29fa0d
Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev.
2015-01-28 10:16:49 +10:00
Ms2ger
01ed338746
Move to to_owned rather than into_string.
...
into_string has been removed from Rust.
2015-01-20 14:49:07 +01:00
Bruno de Oliveira Abinader
dc008977f9
Share supported CSS properties between style and CSSStyleDeclaration
...
Avoids duplicated code when implementing the CSS properties accessors in
CSSStyleDeclaration WebIDL. Servo internal CSS properties are not
accessible.
CSS property "float" is unnacessible because we currently lack support
for BinaryName IDL annotation (#4435 ).
Fixes #4429 , #4430 .
2015-01-19 13:21:03 -04:00
Ms2ger
ff96d8ccd4
Remove unsound Root::deref() calls in CSSStyleDeclaration.
2015-01-01 20:36:44 +01:00
Ms2ger
1dad710063
Replace Root::deref() calls by Root::r() calls where possible.
...
This changes those calls that were already sound.
2015-01-01 20:36:43 +01:00
Ms2ger
b6117a57aa
Replace the remaining to_string calls by into_string calls.
2014-12-31 10:34:44 +01:00
ProgramFOX
18d8ee6ce0
Added readonly flag for CSSStyleDeclaration
2014-12-28 17:39:07 +01:00
Manish Goregaokar
50c246bdc5
Fix warnings post-upgrade
2014-12-27 03:28:35 +05:30
thiagopnts
eacbe331c9
Replace bool attribute in Element::update_inline_style with a descriptive enum
2014-12-24 13:23:58 -02:00
Adam Sunderland
674fe910c1
Add GetPropertyPriority to CSSStyleDeclaration
...
Tweak getPropertyPriority to match recommendations
Adding Tests for Style Priority
Use else if
Adding Content Test for GetPropertyPriority
Revert "Adding Tests for Style Priority"
This reverts commit 8666a37f833b06c3e43f27acd8a9678e94425e55.
2014-12-23 11:41:33 -06:00
ProgramFOX
07d37af37e
Implemented CSSStyleDeclaration.setPropertyPriority
...
Implemented CSSStyleDeclaration.setPropertyPriority, resolves #4433
2014-12-23 17:14:45 +01:00
Tetsuharu OHZEKI
a7bb436177
script: Remove glob imports added in #4405
2014-12-19 04:52:48 +09:00