aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmloptionelement.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove use of unstable box syntax.Simon Sapin2017-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | http://www.robohornet.org gives a score of 101.36 on master, and 102.68 with this PR. The latter is slightly better, but probably within noise level. So it looks like this PR does not affect DOM performance. This is expected since `Box::new` is defined as: ```rust impl<T> Box<T> { #[inline(always)] pub fn new(x: T) -> Box<T> { box x } } ``` With inlining, it should compile to the same as box syntax.
* Rename Root<T> to DomRoot<T>Anthony Ramine2017-09-261-5/+5
| | | | | | | In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>, where Root<T> will be able to handle all the things that need to be rooted that have a stable traceable address that doesn't move for the whole lifetime of the root. Stay tuned.
* Rename dom::bindings::js to dom::bindings::rootAnthony Ramine2017-09-261-1/+1
|
* Solving merge conficts related to the html5ever_atoms -> html5ever changeChristian Poveda2017-05-031-1/+1
|\
| * Upgrade to html5ever 0.16Simon Sapin2017-05-021-1/+1
| |
* | Changed all prefixes from DOMString to the atomic Prefix from html5everChristian Poveda2017-05-031-3/+3
|/
* Make #[dom_struct] a proc_macro attributeAnthony Ramine2017-02-241-0/+1
|
* Update to string-cache 0.3Simon Sapin2016-11-031-8/+8
|
* Implement `value` property on `<select>`.Corey Farwell2016-10-161-0/+4
|
* Most of the code refactoring needed to be done is done with this commit.Arthur Marble2016-09-181-4/+4
|
* add HTMLOptionElement form attribute supportAlexandrov Sergey2016-08-301-0/+16
|
* Inline DOM element creation into box expressions in components/script/dom/Kuba Birecki2016-07-141-2/+3
|
* Move util::str to styleAnthony Ramine2016-07-051-1/+1
|
* Move DOMString back to scriptAnthony Ramine2016-05-241-1/+2
| | | | This entirely removes the 'non-geckolib' feature of the util crate.
* Update rust-selectorsEmilio Cobos Álvarez2016-02-031-1/+1
| | | | | This commits updates rust-selectors to use the generic parser, and as such it moves the element state into the style crate.
* Ask for reset when option is removed.Dongie Agnir2015-12-271-0/+6
|
* Introduce UnbindContextAnthony Ramine2015-12-131-5/+3
| | | | | This holds the context that describes the original node that was removed from a tree when unbinding from a tree.
* Remove unnecessary conversion to/from DOMString for localName.Eli Friedman2015-12-021-2/+3
|
* Compute attribute name atoms at compile-time.Eli Friedman2015-11-271-1/+1
|
* 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.
* Replaced DOMString constructor by conversion functions.Alan Jeffrey2015-11-121-4/+5
| | | | | | Replaced DOMString(...) by DOMString::from(...). Replaced ....0 by String::from(...). Removed any uses of .to_owner() in DOMString::from("...").
* Make DOMString a newtype around String, rather than a typedef.Ms2ger2015-11-041-2/+2
| | | | | | | | | | 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-1/+1
|
* merge from masterrohan.prinja2015-11-031-4/+3
|\
| * Auto merge of #8245 - eefriedman:misc-attribute-fixes, r=noxbors-servo2015-11-021-3/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Use attribute getter/setter macros for misc DOM attributes. This fixes a few minor bugs. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8245) <!-- Reviewable:end -->
| | * Use attribute getter/setter macros for misc DOM attributes.Eli Friedman2015-11-011-3/+1
| | | | | | | | | | | | | | | | | | This fixes a few minor bugs. Also adds some better testing for "unsigned long" attributes.
| * | Move EventState to rust-selectors.Bobby Holley2015-10-301-1/+2
| |/
* / move Castable into dom::bindings::inheritancerohan.prinja2015-10-301-1/+1
|/
* Add fixes based on review.Dongie Agnir2015-10-271-15/+13
| | | | | | - Use if let instead of match for Option - Refactor common code into pick_if_selected_and_reset
* Add fixes based on review.Dongie Agnir2015-10-271-10/+10
| | | | | | | | - Whitespace and indentation issues - call as_for_reset on option insert - add link to 'pick' in standard
* Move cast into if block.Dongie Agnir2015-10-231-1/+1
|
* ask for reset and pick on option insert.Dongie Agnir2015-10-231-0/+9
|
* Implement pick_option.Dongie Agnir2015-10-231-0/+3
|
* Implement ask_for_reset for HTMLSelectElement.Dongie Agnir2015-10-231-2/+9
| | | | Fixes #7774
* Clean up the cast callsAnthony Ramine2015-10-211-11/+6
|
* Introduce trait CastableAnthony Ramine2015-10-211-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove explicit lifetimes which can be elided.Adam Szopa2015-10-211-1/+1
|
* Move Event States to |Element|.Bobby Holley2015-10-161-13/+14
| | | | | | Conceptually they belong there, rather than on |Node|. Fixes #7934.
* Explicitly customise flags of new nodes where neededAnthony Ramine2015-10-151-4/+5
| | | | | | | Given codegen now generates the various TypeId enums, it seems pointless to still have to write their respective values in every DOM struct inheriting from Node just to set the initial IS_IN_DOC flag in Document and IN_ENABLED_STATE in form controls.
* Generate all Derived implementations in codegenAnthony Ramine2015-10-141-13/+3
|
* Generate the TypeId enums in codegenAnthony Ramine2015-10-141-7/+8
|
* Explicitly place '/' before fragment for multipage spec linksCorey Farwell2015-10-101-4/+4
| | | | | This prevents us from 301 redirecting, which could cause the fragment to get lost
* Replace usage of old-style WHATWG spec linksCorey Farwell2015-10-101-4/+4
|
* Remove a pointless level of indentation.Ms2ger2015-10-071-8/+8
|
* Pass an Element to collect_text.Ms2ger2015-10-071-11/+9
|
* Avoid panicking in the implementation of HTMLOptionElement#text for ↵Ms2ger2015-10-071-1/+2
| | | | non-element, non-text children.
* Auto merge of #7776 - frewsxcv:str-join, r=mbrubeckbors-servo2015-09-291-3/+2
|\ | | | | | | | | | | | | | | | | | | Avoid allocations when joining strings <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7776) <!-- Reviewable:end -->
| * Use util::str::str_join in more placesCorey Farwell2015-09-281-3/+2
| | | | | | | | | | Instead of intermediate allocations of `Vec`s, we should utilize `str_join` which operates on iterators
* | Link to 'ask for a reset' tracking issueCorey Farwell2015-09-281-0/+1
|/ | | | FIXME added in https://github.com/servo/servo/pull/7745
* Implement <option> 'defaultSelected' and 'selected' attributesCorey Farwell2015-09-261-2/+44
| | | | Continued from #7743