aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/attr.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* Make reflect_dom_object take a &GlobalScopeAnthony Ramine2016-10-061-2/+1
|
* Revert "Make DOMRefCell use style’s copy of RefCell"Simon Sapin2016-10-041-1/+1
| | | | This reverts commit ec723057b2360446790d436fe5e234d798fb4175.
* Make DOMRefCell use style’s copy of RefCellSimon Sapin2016-08-311-1/+1
|
* Stop re-exporting AttrValue.Ms2ger2016-06-071-1/+1
|
* Removed mutation calls from sync_property_with_attrs_style method in order ↵David Raifaizen2016-05-251-1/+6
| | | | to avoid reparsing serialized output
* Move DOMString back to scriptAnthony Ramine2016-05-241-9/+8
| | | | This entirely removes the 'non-geckolib' feature of the util crate.
* Implement nodeName on AttrDavid Zbarsky2016-04-031-0/+5
|
* Implement SetNamedItem, SetNamedItemNS, SetAttributeNode and SetAttributeNodeNSMathieu Hordesseaux2016-01-281-7/+3
|
* Fix a bunch of clippy lintsJohannes Linke2016-01-021-1/+1
|
* Update string_cache to 0.2.Alan Jeffrey2015-11-251-1/+1
| | | | | | | | | | | 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/+32
|
* Replaced DOMString constructor by conversion functions.Alan Jeffrey2015-11-121-7/+11
| | | | | | Replaced DOMString(...) by DOMString::from(...). Replaced ....0 by String::from(...). Removed any uses of .to_owner() in DOMString::from("...").
* Implement attribute restyle hints.Bobby Holley2015-11-101-0/+5
| | | | Fixes #6942.
* Factor the name-related fields of Attr into a struct and move it to style.Bobby Holley2015-11-091-22/+21
|
* Hoist AttrValue into style.Bobby Holley2015-11-091-163/+2
|
* Add Dimension member to AttrValueCorey Farwell2015-11-091-2/+21
| | | | Fixes #8417
* Remove HTMLTableCellElement fields with parsed attribute values.Eli Friedman2015-11-041-1/+7
|
* Make DOMString a newtype around String, rather than a typedef.Ms2ger2015-11-041-8/+8
| | | | | | | | | | 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.
* Get rid of a bunch of explicit derefsDavid Zbarsky2015-11-031-1/+1
|
* more refactoringrohan.prinja2015-10-301-1/+1
|
* move Castable into dom::bindings::inheritancerohan.prinja2015-10-301-1/+1
|
* remove get_rooted() and replace all references to it with references to get()rohan.prinja2015-10-291-1/+1
|
* Clean up the cast callsAnthony Ramine2015-10-211-2/+1
|
* Introduce trait CastableAnthony Ramine2015-10-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix remaining MutHeap methods not to expose JS<T>.Eli Friedman2015-10-151-1/+1
|
* Make get() and set() on MutNullableHeap use the correct types.Eli Friedman2015-10-151-1/+1
| | | | | | get() must always return a rooted value, because we have no way of ensuring the value won't be invalidated. set() takes an &T because it's convenient; there isn't any need to expose JS<T>.
* Consolidate magic number representing max unsigned longCorey Farwell2015-10-101-2/+3
|
* Auto merge of #7841 - frewsxcv:htmlbodyelement-text, r=noxbors-servo2015-10-091-1/+16
|\ | | | | | | | | | | | | | | | | | | Implement <body>'s "text" attribute <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7841) <!-- Reviewable:end -->
| * Implement <body>'s "text" attributeCorey Farwell2015-10-081-1/+16
| |
* | Refactor away duplication of get_rooted functionalityPierre Chevalier2015-10-081-1/+1
|/ | | | | | | | | | | | | | Refactor .get().map(Root::from_rooted) and .get().map(|foo| foo.root()) to .get_rooted() on MutNullableHeap objects. First part done mechanically with the following comand: sed -i s/"get().map(Root::from_rooted)"/"get_rooted()"/g *.rs Second part done manually after finding them with git grep ".get().map(" Fixes 7929.
* Add doc-comments about methods that can panicCorey Farwell2015-09-301-0/+19
| | | | https://github.com/servo/servo/pull/7683/files#r40072222
* Implement `size` attribute for <font> elementCorey Farwell2015-09-301-1/+11
|
* sorted the extern crate, mod & use declarationsRavi Shankar2015-09-241-1/+1
|
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-191-6/+3
| | | | This merges import blocks that were reported by tidy as unmerged.
* Elide most 'a lifetimesManish Goregaokar2015-09-041-6/+6
|
* renaming tokens(), atom() and uint() and rewriting to return or panicPrabhjyot Singh Sodhi2015-09-021-9/+9
|
* Introduce VirtualMethods::attribute_mutated()Anthony Ramine2015-09-021-23/+18
| | | | | | | | | | | | | | | | | | 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.
* Make the traits for the IDL interfaces take &selfAnthony Ramine2015-08-271-13/+13
|
* Remove AttributeHandlersAnthony Ramine2015-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove helper traitsAnthony Ramine2015-08-271-15/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* sort all usesJohann Tuffe2015-08-201-1/+1
|
* Measure heap memory usage for more types. Fixes #6951Bogdan Cuza2015-08-131-1/+3
|
* Create and utilize utility for joining strsCorey Farwell2015-07-081-6/+2
|
* Join Atoms without requiring intermediate VecCorey Farwell2015-07-081-1/+5
| | | | Related to: https://github.com/servo/string-cache/pull/89
* Utilize iterators for AttrValue::from_serialized_tokenlistCorey Farwell2015-07-041-6/+7
|
* Refactor #[jstraceable] to #[derive(JSTraceable)]David Winslow2015-07-011-2/+1
| | | | fixes #6524
* Implement AttrHelpersForLayout for LayoutJS<Attr> rather than Attr itself.Ms2ger2015-06-201-11/+8
|
* Upgrade to SM 39Michael Wu2015-06-191-28/+26
|
* script: Implement the `width` and `height` attributes for iframes perPatrick Walton2015-05-201-0/+6
| | | | | | HTML5 § 4.8.6. Improves Amazon and Ars Technica.