Commit graph

60 commits

Author SHA1 Message Date
Josh Matthews
4328713f71 Update to SpiderMonkey 66. 2019-05-10 22:43:43 -04:00
Fernando Jiménez Moreno
c75da615bd Add custom elements related stuff into ElementRareData 2019-04-26 11:31:19 +02:00
Peter Hall
8bfd4dc1e2 #8539 Config preferences backend restructure 2019-03-20 15:01:26 +00:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Simon Sapin
76e59a46d3 Sort use statements 2018-11-06 15:26:02 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
Simon Pieters
9b74f0af24 Remove the HTMLTable{Header,Data}CellElement interfaces
Fixes #17222.
2018-10-02 19:23:02 +02:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Rakhi Sharma
d47ce855ce Implement HTMLPictureElement interface. 2018-01-29 20:27:54 -05:00
CYBAI
5486335708 Use specific assertion for DOM create 2018-01-26 01:18:56 +08:00
Emilio Cobos Álvarez
8b0f58c8af
script: Remove HTMLAppletElement.
It was removed from the spec, there's no reason to keep it in tree.
2017-11-06 17:08:14 +01:00
Anthony Ramine
f87c2a8d76 Rename Root<T> to DomRoot<T>
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.
2017-09-26 09:49:10 +02:00
Anthony Ramine
0e3c54c191 Rename dom::bindings::js to dom::bindings::root 2017-09-26 02:19:05 +02:00
Connor Brewster
9f51c7df21 Track custom element state 2017-08-09 14:36:22 -06:00
Connor Brewster
6d9d4add61 Enqueue upgrades 2017-08-09 14:36:18 -06:00
Connor Brewster
41371208a5 Check namespace during ce def lookup 2017-08-09 14:36:16 -06:00
Connor Brewster
37cbc85727 Use HTMLElement interface for possible CEs 2017-08-09 14:36:13 -06:00
Connor Brewster
4665991503 Support custom element callback reactions 2017-07-17 22:23:45 -06:00
Connor Brewster
37e8b89377 Allow element prefix to be set
Implements step 6.1.10 of
https://dom.spec.whatwg.org/#concept-create-element
2017-06-23 21:10:01 -06:00
Connor Brewster
062b128688 Add flag for sync/async CE creation 2017-06-23 21:09:57 -06:00
Connor Brewster
2f36d3544f Support is option when creating elements 2017-06-23 21:09:55 -06:00
Connor Brewster
6697f5469d Hook CE registry into element creation 2017-06-23 21:09:53 -06:00
Connor Brewster
2333b39569 Implement HTMLConstructor 2017-06-15 21:32:22 -06:00
Christian Poveda
62821a6915 Solving merge conficts related to the html5ever_atoms -> html5ever change 2017-05-03 12:57:49 -05:00
Christian Poveda
875e422fe6 Changed all prefixes from DOMString to the atomic Prefix from html5ever 2017-05-03 10:17:42 -05:00
Simon Sapin
6c518c89b9 Upgrade to html5ever 0.16 2017-05-02 19:24:28 +02:00
Emilio Cobos Álvarez
21bf91c386
script: Add infrastructure to track subresource loads in <link> and <style> elements. 2016-12-16 16:57:20 +01:00
Alan Jeffrey
9be4fd56ce Removed util. 2016-12-14 18:04:37 -06:00
Simon Sapin
53b638c0e2 Update to string-cache 0.3 2016-11-03 16:23:05 +01:00
Alexandrov Sergey
9876020c22 add SVGElement, SVGGraphicsElement interfaces and SVGSVGElement element 2016-10-06 18:22:53 +03:00
Anthony Ramine
cdc7bca944 Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
2016-05-24 10:54:57 +02:00
Lanza
cfc3500dbf Implement HTMLDetailsElement. Fixes #9216 2016-01-20 16:15:37 +01:00
Eli Friedman
e42dcb3712 Remove unnecessary conversion to/from DOMString for localName. 2015-12-02 13:42:45 -08:00
Alan Jeffrey
3dec6edd10 Update string_cache to 0.2.
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.
2015-11-25 10:13:21 -06:00
Ms2ger
0c61be7a57 Rustfmt some of script. 2015-11-18 11:14:05 +01:00
Alan Jeffrey
84bde75b42 Replaced DOMString constructor by conversion functions.
Replaced DOMString(...) by DOMString::from(...).
Replaced ....0 by String::from(...).
Removed any uses of .to_owner() in DOMString::from("...").
2015-11-12 17:52:59 -06:00
Till Schneidereit
543703e3d8 Move Stylesheet loading and ownership from the layout task into HTML elements
Stylesheets for `HTMLLinkElement`s are now loaded by the resource task, triggered by the element in question. Stylesheets are owned by the elements they're associated with, which can be `HTMLStyleElement`, `HTMLLinkElement`, and `HTMLMetaElement` (for `<meta name="viewport">).

Additionally, the quirks mode stylesheet (just as the user and user agent stylesheets a couple of commits ago), is implemented as a lazy static, loaded once per process and shared between all documents.

This all has various nice consequences:
 - Stylesheet loading becomes a non-blocking operation.
 - Stylesheets are removed when the element they're associated with is removed from the document.
 - It'll be possible to implement the CSSOM APIs that require direct access to the stylesheets (i.e., ~ all of them).
 - Various subtle correctness issues are fixed.

One piece of interesting follow-up work would be to move parsing of external stylesheets to the resource task, too. Right now, it happens in the link element once loading is complete, so blocks the script task. Moving it to the resource task would probably be fairly straight-forward as it doesn't require access to any external state.
2015-11-07 18:11:29 +01:00
Ms2ger
6b75078503 Make DOMString a newtype around String, rather than a typedef.
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.
2015-11-04 12:09:11 +01:00
Keith Yeung
1fc50af8d3 Add HTMLPreElement type to xml and plaintext DOM nodes 2015-10-26 10:22:04 -07:00
Anthony Ramine
68014af78e Clean up the cast calls 2015-10-21 11:40:34 +02:00
Anthony Ramine
13ea3ac413 Introduce trait Castable
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
2015-10-21 11:37:16 +02:00
Corey Farwell
59e2911f28 Add 'listing' alias for <pre> elements 2015-10-10 08:58:38 -04:00
Corey Farwell
adbcb5345c HTMLTableSectionElement improvements
'thead' and 'tfoot' now create instances of HTMLTableSectionElement

HTMLTableSectionElement.rows has been implemented
2015-10-03 12:23:22 -04:00
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
Corey Farwell
cc8994422b Fix a few incorrect Element interfaces 2015-09-13 08:02:51 -04:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Michael Wu
675267b782 Upgrade to SM 39 2015-06-19 18:42:48 -04:00
Ms2ger
9435565f85 Pass an Atom to Element::create. 2015-04-27 12:31:37 -07:00
Ms2ger
a862479ca8 Remove as_slice() calls from script. 2015-04-26 10:52:55 +02:00
Dave Hodder
78de6b2db1 Add basic HTMLDialogElement interface 2015-04-04 19:59:37 +01:00