Anthony Ramine
aab2c40389
Generate the TypeId enums in codegen
2015-10-14 18:45:35 +02:00
Corey Farwell
64f4835a4f
Implement <body>'s "text" attribute
2015-10-08 10:55:12 -04:00
bors-servo
f5cd90805e
Auto merge of #7882 - anthgur:consistent-enum-use, r=Ms2ger
...
Refactor Error enum usage to consistently be qualified
Closes #7869
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7882 )
<!-- Reviewable:end -->
2015-10-06 04:58:17 -06:00
Anthony Urena
ba86131cd5
Refactor Error enum usage to consistently be qualified
2015-10-06 05:43:52 -04:00
Ms2ger
cd7b4d4e61
Define the parsed attribute getters for HTMLTableCellElement on LayoutJS.
...
This documents their intended usage and prevents script callers from using
them.
2015-10-06 09:40:33 +02:00
Ms2ger
1552022d96
Move some methods from RawLayoutElementHelpers to LayoutElementHelpers.
...
This is part of a long-term plan to ensure layout never has access to
unwrapped pointers to DOM objects. The remaining methods on the
RawLayoutElementHelpers trait are harder to move, because of the lifetimes in
their signatures.
2015-10-05 11:40:37 +02:00
Corey Farwell
74e4c4fdc7
Implement size
attribute for <font> element
2015-09-30 22:51:30 -04:00
Glenn Watson
339a3f869b
Split Au type into separate crate, with minimal dependencies.
2015-10-01 07:16:11 +10:00
Patrick Walton
075fd6818c
script: Wrap a long line.
2015-09-24 18:54:54 -07:00
Ravi Shankar
889eec364b
sorted the extern crate, mod & use declarations
2015-09-24 02:12:45 +05:30
Corey Farwell
fe7647a43e
Prefer element casting over mem::transmute
2015-09-22 18:38:31 -04: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
Simon Sapin
feaf6f4c3f
Initial support for custom properties in CSSStyleDeclaration
2015-09-17 14:48:56 +02:00
Corey Farwell
3ae76f4e76
Implement <font> 'face' attribute
2015-09-14 20:24:52 -04:00
Ali Sabil
2e9d8a76d1
Use cached element ID in LayoutElement::get_id
2015-09-13 23:55:40 +02:00
Ali Sabil
ea655ada10
Cache the id
attribute on Element
2015-09-13 23:55:40 +02:00
Anthony Ramine
650afc9d3e
Fix cloning of Element's attributes
...
No virtual method was invoked when copies of attributes were appended to
newly-cloned elements.
2015-09-13 23:40:24 +02:00
Michael Wu
941f7dc04b
Move EventTargetTypeId/NodeTypeId to DOMClass
2015-09-12 01:09:46 +02:00
bors-servo
5a0be12e43
Auto merge of #7531 - nox:template, r=Ms2ger
...
Implement <template>
All tests using iframes can't currently pass, same for innerHTML-related tests with <template> elements. The latter contradicts the spec, see the links below.
Apart from this, they work, AFAICT.
https://github.com/servo/html5ever/issues/164
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27314
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7531 )
<!-- Reviewable:end -->
2015-09-08 02:29:00 -06:00
Anthony Ramine
b3820047da
Fix HTMLTemplateElement.innerHTML
...
https://github.com/w3c/DOM-Parsing/issues/1
2015-09-08 10:28:24 +02:00
Manish Goregaokar
54c036cd66
Elide most 'a lifetimes
2015-09-04 08:55:51 +05:30
bors-servo
05deb3dcc8
Auto merge of #7518 - servo:custom-properties, r=pcwalton
...
Initial support for CSS Custom Properties
https://drafts.csswg.org/css-variables/
Missing:
* `var()` in shorthand property declarations.
* Correct handling of EOF in custom property declarations.
r? @pcwalton
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7518 )
<!-- Reviewable:end -->
2015-09-03 16:09:02 -06:00
Simon Sapin
5fb6acb753
Rename DeclaredValue::SpecifiedValue to DeclaredValue::Value
2015-09-03 23:02:15 +02:00
Prabhjyot Singh Sodhi
105ea0d690
renaming tokens(), atom() and uint() and rewriting to return or panic
2015-09-02 22:20:33 +05:30
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
Anthony Ramine
58e1bd0e57
Introduce VirtualMethods::attribute_mutated()
...
This replaces before_remove_attr(), after_remove_attr() and after_set_attr().
The virtual method takes the mutated attribute and an AttributeMutation value
to disambiguate between "attribute is changed", "attribute is added" and
"attribute is removed".
In the case of "attribute is changed", the mutation value contains a reference
to the old value of the mutated attribute, which is used to unregister outdated
named elements when the "id" attribute is changed on an element.
This greatly simplifies the handling of attributes, which in many cases don't
have any specific behaviour whether they are removed or changed or added. It
also fixes a few bugs where things were put in before_remove_attr() instead of
after_remove_attr() (e.g. when removing an href attribute from a base element).
A few helper functions in Element were also renamed and made private.
2015-09-02 15:45:38 +02:00
bors-servo
a547ae6826
Auto merge of #7496 - servo:calc_, r=SimonSapin
...
Implement CSS3 Calc
This is #7185 with one commit added to make it build merged with master, which got support for the `ch` unit in the meantime.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7496 )
<!-- Reviewable:end -->
2015-09-02 02:33:18 -06:00
Simon Sapin
40b4348824
Upgrade to rustc 1.4.0-dev (cb9323ec0 2015-09-01)
2015-09-02 09:22:17 +02:00
Simon Sapin
80d471d5cf
Merge branch 'master' into calc
2015-09-01 18:39:16 +02:00
Anthony Ramine
5672142042
Remove Element::get_attributes()
2015-09-01 18:25:25 +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
51418fc348
Replace many uses of Attr::Value() by Attr::value()
...
The later only borrows the attribute, without copying its value as a string.
2015-08-30 15:30:01 +02:00
Anthony Ramine
105d990845
Replace many uses of to_ascii_lowercase() by make_ascii_lowercase()
2015-08-30 15:30:00 +02: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
David Zbarsky
6573e8088c
Properly serialize % values in calc expressions
2015-08-26 14:14:56 -07: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