aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlelement.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove `get_*` on getters as per RFC 0344.Corey Farwell2016-04-101-3/+3
| | | | | | https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#gettersetter-apis https://github.com/servo/servo/issues/6224
* Auto merge of #9930 - rebstar6:htmlclick, r=jdmbors-servo2016-03-111-9/+8
|\ | | | | | | | | | | | | | | | | | | | | | | Remove activatable element filter within HTMLElement#click() Address https://github.com/servo/servo/issues/6542 Ensure that click() calls are not limited to activatable elements. Also makes the isTrusted attribute false when synthetic click activation are called from a click() method (as per spec). <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9930) <!-- Reviewable:end -->
| * Call synthetic_click_activation for all clicksRebecca2016-03-101-9/+8
| | | | | | | | | | | | | | Moved synthetic_click_actiavtion out of Activatable trait so it can be called by all elements (not just activatable). Calls appropriately from click. Also updates the isdisabled check in click to check for all types of elements
* | use return value of invoking event handlers to cancel the eventJoão Oliveira2016-02-261-0/+18
| |
* | Implement From<DOMString> for AtomAnthony Ramine2016-02-241-2/+2
|/
* Compile raw inline event handlers lazily. Resolves #8489.Josh Matthews2016-02-111-5/+3
|
* 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.
* Add onresize handler to GlobalEventHandlersJeff Harrison2016-01-291-0/+18
| | | | | Refs: https://github.com/servo/servo/issues/7996 Rebased: https://github.com/servo/servo/pull/8006
* Refactor 'listed element' logic for HTMLFieldSetElement::ElementsCorey Farwell2016-01-091-0/+24
| | | | | `HTMLElement::is_listed_element` method was added, which matches the `HTMLElement::is_labelable_element` method directly above
* Generate PartialEq automaticallyGuillaume Gomez2016-01-031-6/+0
|
* move FocusType enum to the script crateRoman Klauke2015-12-061-2/+1
| | | | | | | This commit moves the FocusType enum to the script crate and replaces all usages with the new `usage`. Fixes #8840
* Remove unnecessary conversion to/from DOMString for localName.Eli Friedman2015-12-021-3/+3
|
* Compute attribute name atoms at compile-time.Eli Friedman2015-11-271-3/+3
|
* Update string_cache to 0.2.Alan Jeffrey2015-11-251-6/+8
| | | | | | | | | | | 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("...").
* Differentiate between error and non-error event handlers per the spec.Josh Matthews2015-11-121-0/+1
|
* 'type' attribute on HTMLInputElement should be stored as an AtomCorey Farwell2015-11-061-1/+1
| | | | Fixes #8180
* Make DOMString a newtype around String, rather than a typedef.Ms2ger2015-11-041-4/+4
| | | | | | | | | | 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-12/+9
|
* merge from masterrohan.prinja2015-11-031-4/+95
|\
| * Implement 'labels' attribute on 'labelable elements'Corey Farwell2015-11-011-1/+43
| |
| * Removed JS::root Fixes #8251nxnfufunezn2015-10-311-2/+2
| |
| * Move EventState to rust-selectors.Bobby Holley2015-10-301-3/+4
| |
| * Implement DOMStringMap::SupportedPropertyNames and ↵Nova Fallen2015-10-301-0/+48
| | | | | | | | NamedNodeMap::SupportedPropertyNames
* | rearrange imports to be in alphabetical orderrohan.prinja2015-10-301-2/+2
| |
* | replace InheritTypes imports with inheritance importsrohan.prinja2015-10-301-1/+1
| |
* | more refactoringrohan.prinja2015-10-301-1/+1
| |
* | move Castable into dom::bindings::inheritancerohan.prinja2015-10-301-1/+1
|/
* Implement 'control' attribute for <label> elementsCorey Farwell2015-10-251-0/+20
|
* Clean up the cast callsAnthony Ramine2015-10-211-19/+11
|
* Introduce trait CastableAnthony Ramine2015-10-211-29/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-7/+7
| | | | | | Conceptually they belong there, rather than on |Node|. Fixes #7934.
* Explicitly customise flags of new nodes where neededAnthony Ramine2015-10-151-6/+11
| | | | | | | 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-12/+1
|
* Generate the TypeId enums in codegenAnthony Ramine2015-10-141-78/+9
|
* Link to the HTML multipage spec, not the single-page one.Eli Friedman2015-10-131-1/+1
|
* Refactor Error enum usage to consistently be qualifiedAnthony Urena2015-10-061-3/+2
|
* 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/+2
| | | | This merges import blocks that were reported by tidy as unmerged.
* Move EventTargetTypeId/NodeTypeId to DOMClassMichael Wu2015-09-121-1/+1
|
* Auto merge of #7452 - nox:cleanup-attributes, r=noxbors-servo2015-09-021-29/+15
|\ | | | | | | | | | | | | | | | | | | 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 -->
| * Introduce VirtualMethods::attribute_mutated()Anthony Ramine2015-09-021-29/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Enforce linking to spec for method implementations via macrosCorey Farwell2015-08-311-0/+6
|/
* Merge adjacent identical `impl` sectionsCorey Farwell2015-08-281-3/+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-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-22/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Auto merge of #7397 - Manishearth:doublepointer-meet-fire, r=noxbors-servo2015-08-261-4/+4
|\ | | | | | | | | | | | | | | | | | | 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 -->