aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/virtualmethods.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* Introduce VirtualMethods::attribute_mutated()Anthony Ramine2015-09-021-22/+7
| | | | | | | | | | | | | | | | | | 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.
* Remove helper traitsAnthony Ramine2015-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove doublepointer in VirtualMethods, and from_borrowed_refManish Goregaokar2015-08-271-30/+30
| | | | | | | | | Most of the heavy lifting done by: ``` $ ls *rs | xargs gawk -i inplace '/let .*: &&.*from_borrowed_ref/{sub("&&", "\\&");sub("_borrowed_","_");} {print $0}' $ ls *rs | xargs gawk -i inplace "/impl.*VirtualMethods/{in_vm=1; sub(/<'a>/,\"\");sub(/&'a /,\"\")} /^}\$/{in_vm=0;} in_vm{\$0=gensub(/\\*self([^.])/,\"self\\\1\",\"g\"); sub(/from_borrowed_ref/,\"from_ref\")} {print}" ```
* sort all usesJohann Tuffe2015-08-201-3/+3
|
* Cleanup NodeIterator, Range, ServoHTMLParser, TextEncoder, URLHelper, URL, ↵Manish Goregaokar2015-08-181-1/+1
| | | | VirtualMethods
* Implement VirtualMethods for HTMLBaseElement.Ms2ger2015-08-081-0/+5
|
* Introduce VirtualMethods::children_changed()Anthony Ramine2015-07-251-4/+5
| | | | | | | | | This virtual method mimics the behaviour of mutation observers and make it more viable than the older child_inserted(), which didn't cover removed nodes and was called as many times as there were inserted nodes. A few other shortcomings where remove_child() was called directly instead of Node::remove() were also fixed while at it.
* Upgrade to SM 39Michael Wu2015-06-191-61/+34
|
* Auto merge of #5858 - pgonda:tabindex-focus-flag, r=jdmbors-servo2015-05-201-0/+8
|\ | | | | | | | | | | | | | | Added support for the tabindex field, also added its correct defaults (-2 TODOs for things not supported in Servo yet). Also added tabindex logic into Element::is_focusable_area. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5858) <!-- Reviewable:end -->
| * fixes #5603, adds support for tabindexPeter2015-05-201-0/+8
| |
* | script: Implement the `color` attribute of the `<font>` element.Patrick Walton2015-05-191-1/+9
|/ | | | Improves Hacker News.
* Make HTMLFormElement name attribute use an atomAnthony Ramine2015-05-141-0/+4
|
* Implement HTMLAppletElement.nameAnthony Ramine2015-05-141-0/+4
|
* Basic userscript supportManish Goregaokar2015-03-221-0/+6
|
* Use new `if let` syntax wherever possible. Fixes #4153.Zack Slayton2015-03-101-23/+14
|
* Import the util crate as util rather than servo_util.Ms2ger2015-01-291-1/+1
| | | | | | | | This used to conflict with the util crate from the standard library, which has long since been removed. The import in layout has not been changed because of a conflict with the util mod there.
* Don't shadow lifetimes in script.Ms2ger2015-01-281-1/+1
|
* Simplify vtable_for.Ms2ger2015-01-051-7/+2
|
* auto merge of #4542 : servo/servo/pre-rustup_20141221, r=saneyukibors-servo2015-01-041-26/+26
|\ | | | | | | In particular, this contains changes to qualify enums where rust will require it, and to stop using some features that will be removed.
| * Disambiguate trait object reference syntax.Ms2ger2015-01-041-26/+26
| |
* | Fix inheritance enums for htmlmediaelement and htmltablecellelementMegha Gupta2015-01-021-3/+7
| |
* | Add HTMLElementTypeId enum (fixes #3625)Megha Gupta2015-01-021-24/+24
|/
* Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d.Ms2ger2014-12-171-53/+29
|
* style: Address review comments relating to `bgcolor` and column spansPatrick Walton2014-12-151-1/+18
|
* style: Parse the legacy `border` attribute per the legacy HTML specification.Patrick Walton2014-12-151-0/+8
| | | | | | | Additionally, this patch cleans up some miscellaneous formatting issues and refactors files in `layout/css/` somewhat to eliminate needless levels of indirection. It also fixes our handling of presentational hints that only apply if border is nonzero.
* ports/cef: Implement accelerated compositing for the CEF port.Patrick Walton2014-12-101-0/+8
|
* Implement HTML{Anchor,Area,Link}Element.relList.Achal Shah2014-11-231-0/+7
| | | | https://github.com/servo/servo/issues/3994
* Pass an Atom to VirtualMethods::parse_plain_attribute.Ms2ger2014-11-051-1/+3
|
* Implement cloning steps for script elementMatt Brubeck2014-10-291-1/+11
|
* Switch to synchronous script loadingMatt Brubeck2014-10-291-0/+7
| | | | | | | This removes the old code for asyncronously loading scripts during HTML parsing and then executing them afterward. Fixes #3356.
* Usage of JSRef<Attr> in before_remove_attr & after_set_attrBruno de Oliveira Abinader2014-10-221-5/+5
| | | | | JSRef<Attr> does not require allocating a DOMString for value, which are unused in most cases. It also provides more access to Attr data.
* layout: Introduce support for legacy presentational attributes to selectorPatrick Walton2014-10-141-0/+9
| | | | | | | | matching, and use it for `<input size>` and `<td width>`. This implements a general framework for legacy presentational attributes to the DOM and style calculation, so that adding more of them later will be straightforward.
* Eliminate servo_util::atomKeegan McAllister2014-09-291-1/+1
| | | | We only needed this for Encodable, and now we use JSTraceable instead.
* CSS selector :enabled no longer matches Anchor, Area & Link elementsBruno de Oliveira Abinader2014-09-291-7/+0
| | | | | | | | | HTML spec has been modified [1] to disable support for :enabled CSS selector on Anchor, Area & Link elements, after discussion on W3C Bugzilla [2]. [1] https://html5.org/r/8818 [2] https://www.w3.org/Bugs/Public/show_bug.cgi?id=26622
* Upgrade to rustc d2b30f7d3 2014-09-23Simon Sapin2014-09-291-2/+2
|
* Upgrade to rustc 0.12.0-pre (4d2af3861 2014-09-17 15:51:11 +0000)Keegan McAllister2014-09-201-38/+38
|
* First steps of &JSRef -> JSRef conversionCameron Zwarich2014-09-191-20/+20
| | | | | | | | | Replace &JSRef with JSRef in the bulk of the generated code. This will remove a level of indirection throughout all DOM code. This patch doesn't change methods implemented on JSRef<T> to take `self` rather than `&self`, and it leaves a few other uses of &JSRef, but those changes can be made incrementally.
* Cargoify servoJack Moffitt2014-09-081-0/+219