mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
Add document.createElement and document.createTextNode.
This re-uses the parser's node creation code. That could probably be put somewhere nicer. Suggestions welcome!
This commit is contained in:
parent
2d556303ca
commit
227bb95213
4 changed files with 34 additions and 6 deletions
|
@ -209,7 +209,7 @@ fn js_script_listener(to_parent: SharedChan<HtmlDiscoveryMessage>,
|
|||
// Silly macros to handle constructing DOM nodes. This produces bad code and should be optimized
|
||||
// via atomization (issue #85).
|
||||
|
||||
fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView> {
|
||||
pub fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView> {
|
||||
// TODO (Issue #85): use atoms
|
||||
handle_element!(cx, tag, "a", HTMLAnchorElementTypeId, HTMLAnchorElement, []);
|
||||
handle_element!(cx, tag, "applet", HTMLAppletElementTypeId, HTMLAppletElement, []);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue