aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/cssstyledeclaration.rs
Commit message (Collapse)AuthorAgeFilesLines
* Defined new trait ParseErrorReporter and added error_reporter member to ↵GauriGNaik2015-11-251-1/+2
| | | | ParserContext
* Update string_cache to 0.2.Alan Jeffrey2015-11-251-3/+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.
* Rustfmt some of script.Ms2ger2015-11-181-15/+23
|
* Replaced DOMString constructor by conversion functions.Alan Jeffrey2015-11-121-10/+10
| | | | | | Replaced DOMString(...) by DOMString::from(...). Replaced ....0 by String::from(...). Removed any uses of .to_owner() in DOMString::from("...").
* Fix serialization of shorthands pending var() substitution.Simon Sapin2015-11-061-19/+37
|
* Make DOMString a newtype around String, rather than a typedef.Ms2ger2015-11-041-10/+10
| | | | | | | | | | 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.
* Use DOMString::new() somewhat consistently.Ms2ger2015-11-041-5/+5
|
* Get rid of a bunch of explicit derefsDavid Zbarsky2015-11-031-3/+3
|
* merge from masterrohan.prinja2015-11-031-1/+1
|\
| * Initialize dom struct fields in declaration orderMichael Wu2015-10-301-1/+1
| |
* | more refactoringrohan.prinja2015-10-301-1/+1
| |
* | move Castable into dom::bindings::inheritancerohan.prinja2015-10-301-1/+1
|/
* Remove unnecessary rooting from `CSSStyleDeclaration`Roman Klauke2015-10-231-20/+10
| | | | | | | This commit will replace calls to `self.owner.root()` with `self.owner` to avoid unnecessary rooting of JS elements objects. Ref.- Issue: #8126
* Clean up the cast callsAnthony Ramine2015-10-211-2/+2
|
* Introduce trait CastableAnthony Ramine2015-10-211-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This trait is used to hold onto the downcast and upcast functions of all castable IDL interfaces. A castable IDL interface is one which either derives from or is derived by other interfaces. The deriving relation is represented by implementations of marker trait DerivedFrom<T: Castable> generated in InheritTypes. /^[ ]*use dom::bindings::codegen::InheritTypes::.*(Base|Cast|Derived)/ { /::[a-zA-Z]+(Base|Cast|Derived);/d s/([{ ])[a-zA-Z]+(Base|Cast|Derived), /\1/g s/([{ ])[a-zA-Z]+(Base|Cast|Derived), /\1/g s/, [a-zA-Z]+(Base|Cast|Derived)([},])/\2/g s/, [a-zA-Z]+(Base|Cast|Derived)([},])/\2/g /\{([a-zA-Z]+(Base|Cast|Derived))?\};$/d s/\{([a-zA-Z_]+)\};$/\1;/ } s/([a-zA-Z]+)Cast::from_ref\(\&?\**([a-zA-Z_]+)(\.r\(\))?\)/\2.upcast::<\1>()/g s/([a-zA-Z]+)Cast::from_ref\(\&?\**([a-zA-Z_]+)(\.[a-zA-Z_]+\(\))?\)/\2\3.upcast::<\1>()/g s/\(([a-zA-Z]+)Cast::from_ref\)/\(Castable::upcast::<\1>\)/g s/([a-zA-Z]+)Cast::from_root/Root::upcast::<\1>/g s/([a-zA-Z]+)Cast::from_layout_js\(\&([a-zA-Z_.]+)\)/\2.upcast::<\1>()/g s/([a-zA-Z]+)Cast::to_ref\(\&?\**([a-zA-Z_]+)(\.r\(\))?\)/\2.downcast::<\1>()/g s/([a-zA-Z]+)Cast::to_ref\(\&?\**([a-zA-Z_]+)(\.[a-zA-Z_]+\(\))?\)/\2\3.downcast::<\1>()/g s/\(([a-zA-Z]+)Cast::to_ref\)/\(Castable::downcast::<\1>\)/g s/([a-zA-Z]+)Cast::to_root/Root::downcast::<\1>/g s/([a-zA-Z]+)Cast::to_layout_js\(&?([a-zA-Z_.]+(\(\))?)\)/\2.downcast::<\1>()/g s/\.is_document\(\)/.is::<Document>()/g s/\.is_htmlanchorelement\(\)/.is::<HTMLAnchorElement>()/g s/\.is_htmlappletelement\(\)/.is::<HTMLAppletElement>()/g s/\.is_htmlareaelement\(\)/.is::<HTMLAreaElement>()/g s/\.is_htmlbodyelement\(\)/.is::<HTMLBodyElement>()/g s/\.is_htmlembedelement\(\)/.is::<HTMLEmbedElement>()/g s/\.is_htmlfieldsetelement\(\)/.is::<HTMLFieldSetElement>()/g s/\.is_htmlformelement\(\)/.is::<HTMLFormElement>()/g s/\.is_htmlframesetelement\(\)/.is::<HTMLFrameSetElement>()/g s/\.is_htmlhtmlelement\(\)/.is::<HTMLHtmlElement>()/g s/\.is_htmlimageelement\(\)/.is::<HTMLImageElement>()/g s/\.is_htmllegendelement\(\)/.is::<HTMLLegendElement>()/g s/\.is_htmloptgroupelement\(\)/.is::<HTMLOptGroupElement>()/g s/\.is_htmloptionelement\(\)/.is::<HTMLOptionElement>()/g s/\.is_htmlscriptelement\(\)/.is::<HTMLScriptElement>()/g s/\.is_htmltabledatacellelement\(\)/.is::<HTMLTableDataCellElement>()/g s/\.is_htmltableheadercellelement\(\)/.is::<HTMLTableHeaderCellElement>()/g s/\.is_htmltablerowelement\(\)/.is::<HTMLTableRowElement>()/g s/\.is_htmltablesectionelement\(\)/.is::<HTMLTableSectionElement>()/g s/\.is_htmltitleelement\(\)/.is::<HTMLTitleElement>()/g
* Use util::str::str_join in more placesCorey Farwell2015-09-281-4/+3
| | | | | Instead of intermediate allocations of `Vec`s, we should utilize `str_join` which operates on iterators
* sorted the extern crate, mod & use declarationsRavi Shankar2015-09-241-3/+3
|
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-191-5/+4
| | | | This merges import blocks that were reported by tidy as unmerged.
* Auto merge of #7429 - GyrosOfWar:serialize_list_space_fix, r=jdmbors-servo2015-09-021-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | 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 -->
| * Fixed serialize_list to no longer append an additional space at the end of ↵Martin Tomasi2015-09-021-3/+3
| | | | | | | | the string
* | Auto merge of #7452 - nox:cleanup-attributes, r=noxbors-servo2015-09-021-8/+10
|\ \ | |/ |/| | | | | | | | | | | | | | | 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 -->
| * Replace many uses of to_ascii_lowercase() by make_ascii_lowercase()Anthony Ramine2015-08-301-8/+10
| |
* | Enforce linking to spec for method implementations via macrosCorey Farwell2015-08-311-0/+1
|/
* Merge adjacent identical `impl` sectionsCorey Farwell2015-08-281-2/+0
| | | | | Prior to #7416 and #7401, many of these `impl` sections were not identical
* Make the traits for the IDL interfaces take &selfAnthony Ramine2015-08-271-14/+14
|
* Remove helper traitsAnthony Ramine2015-08-271-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* make dom_struct derive HeapSizeOf,João Oliveira2015-08-271-1/+0
| | | | closes #7357
* remove PrivateCSSStyleDeclarationHelpers trait from Element,João Oliveira2015-08-231-20/+3
| | | | | | call get_inline_style_declaration and get_important_inline_style_declaration inline closes #7319
* Auto merge of #7288 - mdibaiee:computedstyle-element, r=Ms2gerbors-servo2015-08-221-6/+5
|\ | | | | | | | | | | | | | | | | | | | | | | 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 -->
| * Fix #7268 - getComputedStyle should take `Element`, not `HTMLElement`Mahdi Dibaiee2015-08-221-6/+5
| |
* | sort all usesJohann Tuffe2015-08-201-2/+2
|/
* Replace uses of `for foo in bar.iter()`,João Oliveira2015-08-181-2/+2
| | | | | and `for foo in bar.iter_mut(), and for foo in bar.into_iter() (continuation of #7197)
* Measure heap memory usage for more types. Fixes #6951Bogdan Cuza2015-08-131-1/+2
|
* Make CSSStyleDeclaration setters rethrow errors instead of unwrapping and ↵David Zbarsky2015-08-111-2/+2
| | | | crashing.
* Remove some PropertyDeclaration cloning.Simon Sapin2015-07-311-22/+29
|
* Refactor CSSStyleDeclaration::setProperty to not synthesize a `name: value` ↵Simon Sapin2015-07-311-19/+13
| | | | string to parse.
* Fix CSSStyleDeclaration.setPropertyPrioritySimon Sapin2015-07-311-31/+19
| | | | | | 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.)
* Return None as style for elements not in a documentDavid Zbarsky2015-07-301-0/+5
|
* Implement getComputedStyleDavid Zbarsky2015-07-291-2/+20
|
* Add spec linksBogdan Cuza2015-07-281-11/+11
|
* Upgrade to SM 39Michael Wu2015-06-191-22/+22
|
* Remove usage of String::from_str, deprecated in #6377Simon Sapin2015-06-151-1/+1
|
* Uniformise root() methodsAnthony Ramine2015-04-281-1/+1
| | | | | They now live in traits Rootable, OptionalOptionalRootable, OptionalRootable and ResultRootable.
* Add/update comments with links to specCorey Farwell2015-04-141-0/+2
| | | | | | | | | | 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
* Consistently name enum members in `dom::bindings::error::Error`Eric Hegnes2015-04-051-3/+3
| | | | Fixes #5521
* Cleanup script::dom::cssstyledeclarationsCorey Farwell2015-03-301-18/+21
| | | | | | | | * 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
* Remove some unnecessary uses of `as_slice`Corey Farwell2015-03-291-23/+21
| | | | | | | | | | | 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
* Documentation and cleanup.Josh Matthews2015-03-031-4/+2
|
* Move everything unrelated to the frame tree out of Page and into Document or ↵Josh Matthews2015-03-031-5/+3
| | | | Window. Reduce the API surface of Page to a bare minimum to allow for easier future removal.
* Replace uint/int by usize/isize in various places.Ms2ger2015-02-201-3/+4
|