aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/attr.rs
Commit message (Collapse)AuthorAgeFilesLines
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`. `malloc_size_of` is better -- it handles various cases that `heapsize` does not -- so this patch changes Servo to use `malloc_size_of`. This patch makes the following changes to the `malloc_size_of` crate. - Adds `MallocSizeOf` trait implementations for numerous types, some built-in (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`). - Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't support that operation. - For `HashSet`/`HashMap`, falls back to a computed estimate when `enclosing_size_of_op` isn't available. - Adds an extern "C" `malloc_size_of` function that does the actual heap measurement; this is based on the same functions from the `heapsize` crate. This patch makes the following changes elsewhere. - Converts all the uses of `heapsize` to instead use `malloc_size_of`. - Disables the "heapsize"/"heap_size" feature for the external crates that provide it. - Removes the `HeapSizeOf` implementation from `hashglobe`. - Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of` doesn't derive those types, unlike `heapsize`.
* Fix commonmark Markdown warnings in docs, part 1Matt Brubeck2017-10-171-1/+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.
* Change AttrValue::Url to AttrValue::ResolvedUrlAnthony Ramine2017-10-151-16/+21
| | | | | There is actually only one attribute that can use that, the one for <body background>.
* Replace all uses of the style::stylearc alias with servo_arc.Michael Partheil2017-07-191-1/+1
| | | | | | The alias is left there temporarilly and will be removed completely in a later commit where also components/style/gecko/generated/structs_{debug|release}.rs are re-generated (they still use the old alias).
* Untry styleSimon Sapin2017-06-181-2/+2
|
* ol[type=…] and li[type=…] preshints need to be case-sensitiveSimon Sapin2017-05-181-0/+9
|
* Shrink selectors::Component, add case-insensitive for other attr selectorsSimon Sapin2017-05-181-3/+3
| | | | | * https://bugzilla.mozilla.org/show_bug.cgi?id=1364148 * https://bugzilla.mozilla.org/show_bug.cgi?id=1364162
* Simplify rust-selectors API for attribute selectorsSimon Sapin2017-05-181-0/+8
|
* Fix future illegal_floating_point_literal_pattern warnings.Simon Sapin2017-05-121-1/+1
| | | | They make component/style fail to build, because of `#[deny(warnings)]`
* Use StyleArc in the style system.Bobby Holley2017-05-021-1/+1
| | | | MozReview-Commit-ID: flF0fv9E9M
* Fix indentation errors in servo rust code that tidy now finds.coalman2017-04-181-2/+2
|
* script: Map HTMLCanvasElement width and height attributes.Emilio Cobos Álvarez2017-04-091-0/+17
|
* Remove servo_url dependency for geckolibXidorn Quan2017-04-071-3/+1
| | | | | | It seems mod attr is not used for geckolib at all, and that is the only place where servo_url is still referenced for geckolib, so we can just remove it.
* Move all PropertyDeclarationBlock from RwLock<_> to Locked<_>Simon Sapin2017-03-191-2/+2
|
* style: Unbox a bunch of color properties.Emilio Cobos Álvarez2017-02-141-12/+5
| | | | This builds on https://github.com/servo/rust-cssparser/pull/118.
* script: Don't avoid all the mutation notification methods when the style ↵Emilio Cobos Álvarez2017-01-301-1/+21
| | | | | | | | | | attribute changes. Styling was correct because of the explicit dirtiness, but still not fun. Some things, like dynamic updates to with things like [style~="color"] ~ foo selectors, were pretty broken, because we didn't take snapshots of those attributes.
* Remove redundant url clonesPu Xingyu2016-11-181-1/+1
| | | | | They are now redundant since now document.url() returns a struct rather than a reference.
* Urlmageddon: Use refcounted urls more often.Emilio Cobos Álvarez2016-11-171-4/+4
|
* Update to string-cache 0.3Simon Sapin2016-11-031-4/+4
|
* Replace the SelectorImplExt trait with inherent methods.Simon Sapin2016-08-091-1/+2
|
* account for sign in double parsingBob2016-07-281-6/+6
| | | | | When sign was present during double parsing correctly jump forward the extra character when parsing fraction and exponent.
* style: Rewrite the restyle hints code to allow different kinds of element ↵Emilio Cobos Álvarez2016-07-211-1/+1
| | | | | | | | | | | | | snapshots, and use it for Gecko. This is a rewrite for how style interfaces with its consumers in order to allow different representations for an element snapshot. This also changes the requirements of an element snapshot, requiring them to only implement MatchAttr, instead of MatchAttrGeneric. This is important for stylo since implementing MatchAttrGeneric is way more difficult for us given the atom limitations. This also allows for more performant implementations in the Gecko side of things.
* Some fixes in styleManish Goregaokar2016-07-121-1/+1
|
* Move util::str to styleAnthony Ramine2016-07-051-3/+2
|
* Add some documentation to the style crate.Ms2ger2016-06-271-7/+12
|
* Make the style crate almost build on stable Rust.Simon Sapin2016-06-221-3/+6
| | | | `discriminant_value` will need to be replaced with something else later.
* Move LengthOrPercentageOrAuto to style::attr.Ms2ger2016-06-061-2/+9
|
* Report use statements that use {} with only one entryCullen Rhodes2016-05-271-1/+1
|
* Parse HTMLInputElement attributesKeith Yeung2016-05-241-6/+15
|
* Move DOMString back to scriptAnthony Ramine2016-05-241-24/+24
| | | | This entirely removes the 'non-geckolib' feature of the util crate.
* Add string_cache override for geckolib based on gecko atoms.Bobby Holley2016-05-181-3/+5
| | | | The work in these patches is based on Ms2ger's gecko-atom crate.
* Return a Result<i64, ()> from do_parse_integerAkshit Khurana2016-04-261-7/+7
| | | | Fixes #10860
* Add parsing of double values in style attributesKeith Yeung2016-04-251-6/+58
|
* Use num-traits in style.Ms2ger2016-04-201-1/+1
|
* Remove extra definition of WHITESPACE under components/util/str.rszakorgyula2016-04-201-3/+3
|
* Move `util::str::parse_length` into 'style' component.Corey Farwell2016-03-241-1/+71
| | | | | The function is only used in the 'style' component, so we'll move it there alongside other relevant parse functions.
* Implement From<DOMString> for AtomAnthony Ramine2016-02-241-2/+1
|
* Move parse_integer and parse_unsigned_integer from util::str to style::attrzakorgyula2016-02-171-2/+45
|
* refactor, moving functions into attr and htmlfontelemend fixes #9639 #9638Jayflux2016-02-151-3/+145
|
* Remove parsed attribute 'background' field on HTMLBodyElementCorey Farwell2016-01-021-0/+20
| | | | https://github.com/servo/servo/issues/7863
* Implement non-zero dimension attribute parsingCorey Farwell2015-12-241-1/+6
| | | | | | | | | | | | | Fixes #8445 The only attributes I found that we have implemented that uses non-zero dimenion attributes: * `width` for `<td>` and `<th>` (table cells) * `width` for `<table>` I updated these implementations to use the new non-zero dimension attribute parsing and added associated regression tests.
* Makes setting negative values to maxLength throw an IndexSize exceptionSam Gibson2015-12-031-3/+13
|
* Adds support for input element's maxlength attrSam Gibson2015-12-031-1/+9
| | | | | servo/servo#7320 servo/servo#7004
* Update string_cache to 0.2.Alan Jeffrey2015-11-251-2/+3
| | | | | | | | | | | 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.
* Replaced DOMString constructor by conversion functions.Alan Jeffrey2015-11-121-1/+2
| | | | | | Replaced DOMString(...) by DOMString::from(...). Replaced ....0 by String::from(...). Removed any uses of .to_owner() in DOMString::from("...").
* Factor the name-related fields of Attr into a struct and move it to style.Bobby Holley2015-11-091-0/+8
|
* Hoist AttrValue into style.Bobby Holley2015-11-091-0/+170