mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
script: Eliminate the phantom type in favor of just whitelisting methods
that layout can safely call. This is simpler. Currently, the set of methods is not safe, but I plan to lock it down more soon.
This commit is contained in:
parent
da4cff034b
commit
be69a503fe
96 changed files with 646 additions and 522 deletions
|
@ -121,7 +121,7 @@ DOMInterfaces = {
|
|||
}],
|
||||
|
||||
'CharacterData': {
|
||||
'nativeType': 'AbstractNode<ScriptView>',
|
||||
'nativeType': 'AbstractNode',
|
||||
'concreteType': 'CharacterData',
|
||||
'pointerType': ''
|
||||
},
|
||||
|
@ -182,7 +182,7 @@ DOMInterfaces = {
|
|||
}],
|
||||
|
||||
'Element': {
|
||||
'nativeType': 'AbstractNode<ScriptView>',
|
||||
'nativeType': 'AbstractNode',
|
||||
'pointerType': '',
|
||||
'needsAbstract': ['getClientRects', 'getBoundingClientRect', 'setAttribute', 'setAttributeNS', 'id', 'attributes']
|
||||
},
|
||||
|
@ -239,7 +239,7 @@ DOMInterfaces = {
|
|||
},
|
||||
|
||||
'HTMLFormElement': {
|
||||
'nativeType': 'AbstractNode<ScriptView>',
|
||||
'nativeType': 'AbstractNode',
|
||||
'pointerType': '',
|
||||
'register': False
|
||||
},
|
||||
|
@ -302,7 +302,7 @@ DOMInterfaces = {
|
|||
},
|
||||
|
||||
'Node': {
|
||||
'nativeType': 'AbstractNode<ScriptView>',
|
||||
'nativeType': 'AbstractNode',
|
||||
'concreteType': 'Node<ScriptView>',
|
||||
'pointerType': '',
|
||||
'needsAbstract': [
|
||||
|
@ -574,7 +574,7 @@ def addExternalIface(iface, nativeType=None, headerFile=None, pointerType=None):
|
|||
|
||||
def addHTMLElement(element, concrete=None, needsAbstract=[]):
|
||||
DOMInterfaces[element] = {
|
||||
'nativeType': 'AbstractNode<ScriptView>',
|
||||
'nativeType': 'AbstractNode',
|
||||
'pointerType': '',
|
||||
'concreteType': concrete if concrete else element,
|
||||
'customTrace': 'trace',
|
||||
|
|
|
@ -11,7 +11,7 @@ use std::libc;
|
|||
use std::ptr;
|
||||
use js::jsapi::{JSTracer, JSTRACE_OBJECT, JS_CallTracer};
|
||||
|
||||
impl Reflectable for AbstractNode<ScriptView> {
|
||||
impl Reflectable for AbstractNode {
|
||||
fn reflector<'a>(&'a self) -> &'a Reflector {
|
||||
self.node().reflector()
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ impl Reflectable for AbstractNode<ScriptView> {
|
|||
impl Traceable for Node<ScriptView> {
|
||||
fn trace(&self, tracer: *mut JSTracer) {
|
||||
#[fixed_stack_segment]
|
||||
fn trace_node(tracer: *mut JSTracer, node: Option<AbstractNode<ScriptView>>, name: &str) {
|
||||
fn trace_node(tracer: *mut JSTracer, node: Option<AbstractNode>, name: &str) {
|
||||
if node.is_none() {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue