mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Simple privatizations
This commit is contained in:
parent
5b72087944
commit
acd98a73a4
36 changed files with 59 additions and 22 deletions
|
@ -17,6 +17,7 @@ pub enum BlobType {
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct Blob {
|
pub struct Blob {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
type_: BlobType
|
type_: BlobType
|
||||||
|
|
|
@ -15,6 +15,7 @@ use std::ptr;
|
||||||
|
|
||||||
#[allow(raw_pointer_deriving)]
|
#[allow(raw_pointer_deriving)]
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
|
#[privatize]
|
||||||
pub struct BrowserContext {
|
pub struct BrowserContext {
|
||||||
history: Vec<SessionHistoryEntry>,
|
history: Vec<SessionHistoryEntry>,
|
||||||
active_index: uint,
|
active_index: uint,
|
||||||
|
@ -66,6 +67,7 @@ impl BrowserContext {
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct SessionHistoryEntry {
|
pub struct SessionHistoryEntry {
|
||||||
document: JS<Document>,
|
document: JS<Document>,
|
||||||
children: Vec<BrowserContext>
|
children: Vec<BrowserContext>
|
||||||
|
|
|
@ -17,6 +17,7 @@ use canvas::canvas_render_task::{CanvasMsg, CanvasRenderTask, ClearRect, Close,
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct CanvasRenderingContext2D {
|
pub struct CanvasRenderingContext2D {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
global: GlobalField,
|
global: GlobalField,
|
||||||
|
|
|
@ -11,8 +11,9 @@ use servo_util::str::DOMString;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct Console {
|
pub struct Console {
|
||||||
pub reflector_: Reflector
|
reflector_: Reflector
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Console {
|
impl Console {
|
||||||
|
|
|
@ -19,6 +19,7 @@ use std::cell::Cell;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct CustomEvent {
|
pub struct CustomEvent {
|
||||||
event: Event,
|
event: Event,
|
||||||
detail: Cell<JSVal>,
|
detail: Cell<JSVal>,
|
||||||
|
|
|
@ -37,6 +37,7 @@ use url::Url;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct DedicatedWorkerGlobalScope {
|
pub struct DedicatedWorkerGlobalScope {
|
||||||
workerglobalscope: WorkerGlobalScope,
|
workerglobalscope: WorkerGlobalScope,
|
||||||
receiver: Receiver<ScriptMsg>,
|
receiver: Receiver<ScriptMsg>,
|
||||||
|
|
|
@ -20,8 +20,9 @@ use servo_util::str::DOMString;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct DocumentFragment {
|
pub struct DocumentFragment {
|
||||||
pub node: Node,
|
node: Node,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl DocumentFragmentDerived for EventTarget {
|
impl DocumentFragmentDerived for EventTarget {
|
||||||
|
|
|
@ -62,9 +62,10 @@ impl DOMErrorName {
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct DOMException {
|
pub struct DOMException {
|
||||||
pub code: DOMErrorName,
|
code: DOMErrorName,
|
||||||
pub reflector_: Reflector
|
reflector_: Reflector
|
||||||
}
|
}
|
||||||
|
|
||||||
impl DOMException {
|
impl DOMException {
|
||||||
|
|
|
@ -24,6 +24,7 @@ use servo_util::str::DOMString;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct DOMImplementation {
|
pub struct DOMImplementation {
|
||||||
document: JS<Document>,
|
document: JS<Document>,
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
|
|
|
@ -16,6 +16,7 @@ use servo_util::str::DOMString;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct DOMParser {
|
pub struct DOMParser {
|
||||||
window: JS<Window>, //XXXjdm Document instead?
|
window: JS<Window>, //XXXjdm Document instead?
|
||||||
reflector_: Reflector
|
reflector_: Reflector
|
||||||
|
|
|
@ -12,6 +12,7 @@ use servo_util::geometry::Au;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct DOMRect {
|
pub struct DOMRect {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
top: f32,
|
top: f32,
|
||||||
|
|
|
@ -12,6 +12,7 @@ use dom::window::Window;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct DOMRectList {
|
pub struct DOMRectList {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
rects: Vec<JS<DOMRect>>,
|
rects: Vec<JS<DOMRect>>,
|
||||||
|
|
|
@ -17,6 +17,7 @@ use string_cache::Atom;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct DOMTokenList {
|
pub struct DOMTokenList {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
element: JS<Element>,
|
element: JS<Element>,
|
||||||
|
|
|
@ -27,6 +27,7 @@ pub enum FormDatum {
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct FormData {
|
pub struct FormData {
|
||||||
data: RefCell<HashMap<DOMString, Vec<FormDatum>>>,
|
data: RefCell<HashMap<DOMString, Vec<FormDatum>>>,
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
|
|
|
@ -31,6 +31,7 @@ pub enum CollectionTypeId {
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct HTMLCollection {
|
pub struct HTMLCollection {
|
||||||
collection: CollectionTypeId,
|
collection: CollectionTypeId,
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
|
|
|
@ -17,6 +17,7 @@ use std::rc::Rc;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct Location {
|
pub struct Location {
|
||||||
reflector_: Reflector, //XXXjdm cycle: window->Location->window
|
reflector_: Reflector, //XXXjdm cycle: window->Location->window
|
||||||
page: Rc<Page>,
|
page: Rc<Page>,
|
||||||
|
|
|
@ -20,6 +20,7 @@ use js::jsval::JSVal;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct MessageEvent {
|
pub struct MessageEvent {
|
||||||
event: Event,
|
event: Event,
|
||||||
data: JSVal,
|
data: JSVal,
|
||||||
|
|
|
@ -21,18 +21,19 @@ use std::default::Default;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct MouseEvent {
|
pub struct MouseEvent {
|
||||||
pub mouseevent: UIEvent,
|
mouseevent: UIEvent,
|
||||||
pub screen_x: Cell<i32>,
|
screen_x: Cell<i32>,
|
||||||
pub screen_y: Cell<i32>,
|
screen_y: Cell<i32>,
|
||||||
pub client_x: Cell<i32>,
|
client_x: Cell<i32>,
|
||||||
pub client_y: Cell<i32>,
|
client_y: Cell<i32>,
|
||||||
pub ctrl_key: Cell<bool>,
|
ctrl_key: Cell<bool>,
|
||||||
pub shift_key: Cell<bool>,
|
shift_key: Cell<bool>,
|
||||||
pub alt_key: Cell<bool>,
|
alt_key: Cell<bool>,
|
||||||
pub meta_key: Cell<bool>,
|
meta_key: Cell<bool>,
|
||||||
pub button: Cell<i16>,
|
button: Cell<i16>,
|
||||||
pub related_target: MutNullableJS<EventTarget>
|
related_target: MutNullableJS<EventTarget>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MouseEventDerived for Event {
|
impl MouseEventDerived for Event {
|
||||||
|
|
|
@ -13,6 +13,7 @@ use dom::window::Window;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct NamedNodeMap {
|
pub struct NamedNodeMap {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
owner: JS<Element>,
|
owner: JS<Element>,
|
||||||
|
|
|
@ -13,8 +13,9 @@ use servo_util::str::DOMString;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct Navigator {
|
pub struct Navigator {
|
||||||
pub reflector_: Reflector //XXXjdm cycle: window->navigator->window
|
reflector_: Reflector //XXXjdm cycle: window->navigator->window
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Navigator {
|
impl Navigator {
|
||||||
|
|
|
@ -10,8 +10,9 @@ use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct NodeIterator {
|
pub struct NodeIterator {
|
||||||
pub reflector_: Reflector
|
reflector_: Reflector
|
||||||
}
|
}
|
||||||
|
|
||||||
impl NodeIterator {
|
impl NodeIterator {
|
||||||
|
|
|
@ -19,6 +19,7 @@ pub enum NodeListType {
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct NodeList {
|
pub struct NodeList {
|
||||||
list_type: NodeListType,
|
list_type: NodeListType,
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
|
|
|
@ -15,6 +15,7 @@ pub type DOMHighResTimeStamp = f64;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct Performance {
|
pub struct Performance {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
timing: JS<PerformanceTiming>,
|
timing: JS<PerformanceTiming>,
|
||||||
|
|
|
@ -11,6 +11,7 @@ use dom::window::Window;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct PerformanceTiming {
|
pub struct PerformanceTiming {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
navigationStart: u64,
|
navigationStart: u64,
|
||||||
|
|
|
@ -15,6 +15,7 @@ use servo_util::str::DOMString;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct ProgressEvent {
|
pub struct ProgressEvent {
|
||||||
event: Event,
|
event: Event,
|
||||||
length_computable: bool,
|
length_computable: bool,
|
||||||
|
|
|
@ -13,6 +13,7 @@ use dom::document::Document;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct Range {
|
pub struct Range {
|
||||||
reflector_: Reflector
|
reflector_: Reflector
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ use dom::window::Window;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct Screen {
|
pub struct Screen {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ use js::jsval::{JSVal, NullValue};
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct TestBinding {
|
pub struct TestBinding {
|
||||||
reflector: Reflector,
|
reflector: Reflector,
|
||||||
global: GlobalField,
|
global: GlobalField,
|
||||||
|
|
|
@ -23,12 +23,13 @@ use std::cell::Cell;
|
||||||
// http://dom.spec.whatwg.org/#interface-treewalker
|
// http://dom.spec.whatwg.org/#interface-treewalker
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct TreeWalker {
|
pub struct TreeWalker {
|
||||||
pub reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
pub root_node: JS<Node>,
|
root_node: JS<Node>,
|
||||||
pub current_node: Cell<JS<Node>>,
|
current_node: Cell<JS<Node>>,
|
||||||
pub what_to_show: u32,
|
what_to_show: u32,
|
||||||
pub filter: Filter
|
filter: Filter
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TreeWalker {
|
impl TreeWalker {
|
||||||
|
|
|
@ -22,6 +22,7 @@ use std::ascii::OwnedStrAsciiExt;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct URLSearchParams {
|
pub struct URLSearchParams {
|
||||||
data: RefCell<HashMap<DOMString, Vec<DOMString>>>,
|
data: RefCell<HashMap<DOMString, Vec<DOMString>>>,
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
|
|
|
@ -10,6 +10,7 @@ use dom::window::Window;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct ValidityState {
|
pub struct ValidityState {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
state: u8,
|
state: u8,
|
||||||
|
|
|
@ -33,6 +33,7 @@ untraceable!(TrustedWorkerAddress)
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct Worker {
|
pub struct Worker {
|
||||||
eventtarget: EventTarget,
|
eventtarget: EventTarget,
|
||||||
refcount: Cell<uint>,
|
refcount: Cell<uint>,
|
||||||
|
|
|
@ -16,6 +16,7 @@ use url::Url;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct WorkerLocation {
|
pub struct WorkerLocation {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
url: Url,
|
url: Url,
|
||||||
|
|
|
@ -13,6 +13,7 @@ use servo_util::str::DOMString;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct WorkerNavigator {
|
pub struct WorkerNavigator {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,6 +104,7 @@ enum SyncOrAsync<'a> {
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct XMLHttpRequest {
|
pub struct XMLHttpRequest {
|
||||||
eventtarget: XMLHttpRequestEventTarget,
|
eventtarget: XMLHttpRequestEventTarget,
|
||||||
ready_state: Cell<XMLHttpRequestState>,
|
ready_state: Cell<XMLHttpRequestState>,
|
||||||
|
|
|
@ -13,6 +13,7 @@ use dom::xmlhttprequesteventtarget::XMLHttpRequestEventTarget;
|
||||||
|
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
#[privatize]
|
||||||
pub struct XMLHttpRequestUpload {
|
pub struct XMLHttpRequestUpload {
|
||||||
eventtarget: XMLHttpRequestEventTarget
|
eventtarget: XMLHttpRequestEventTarget
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue