Measure heap memory usage for more types. Fixes #6951

This commit is contained in:
Bogdan Cuza 2015-08-05 18:31:42 +03:00
parent 94c8dcd575
commit 45145108da
175 changed files with 669 additions and 94 deletions

View file

@ -30,6 +30,12 @@ features = [ "nightly" ]
version = "0.3" version = "0.3"
features = [ "serde-serialization" ] features = [ "serde-serialization" ]
[dependencies.plugins]
path = "../plugins"
[dependencies.util]
path = "../util"
[dependencies] [dependencies]
euclid = "0.1" euclid = "0.1"
serde_macros = "0.5" serde_macros = "0.5"

View file

@ -8,7 +8,7 @@
#![feature(custom_derive)] #![feature(custom_derive)]
#![feature(nonzero)] #![feature(nonzero)]
#![feature(plugin)] #![feature(plugin)]
#![plugin(serde_macros)] #![plugin(serde_macros, plugins)]
extern crate core; extern crate core;
extern crate azure; extern crate azure;
@ -19,6 +19,7 @@ extern crate ipc_channel;
extern crate layers; extern crate layers;
extern crate offscreen_gl_context; extern crate offscreen_gl_context;
extern crate serde; extern crate serde;
extern crate util;
use azure::azure::{AzFloat, AzColor}; use azure::azure::{AzFloat, AzColor};
use azure::azure_hl::{DrawTarget, Pattern, ColorPattern}; use azure::azure_hl::{DrawTarget, Pattern, ColorPattern};
@ -37,6 +38,7 @@ use layers::platform::surface::NativeSurface;
use offscreen_gl_context::GLContextAttributes; use offscreen_gl_context::GLContextAttributes;
use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::{Deserialize, Deserializer, Serialize, Serializer};
use core::nonzero::NonZero; use core::nonzero::NonZero;
use util::mem::HeapSizeOf;
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Deserialize, Serialize)]
pub enum CanvasMsg { pub enum CanvasMsg {
@ -159,7 +161,7 @@ pub enum CanvasWebGLMsg {
DrawingBufferHeight(IpcSender<i32>), DrawingBufferHeight(IpcSender<i32>),
} }
#[derive(Clone, Copy, PartialEq, Deserialize, Serialize)] #[derive(Clone, Copy, PartialEq, Deserialize, Serialize, HeapSizeOf)]
pub enum WebGLError { pub enum WebGLError {
InvalidEnum, InvalidEnum,
InvalidOperation, InvalidOperation,
@ -183,13 +185,13 @@ pub enum WebGLShaderParameter {
Invalid, Invalid,
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
pub struct CanvasGradientStop { pub struct CanvasGradientStop {
pub offset: f64, pub offset: f64,
pub color: RGBA, pub color: RGBA,
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
pub struct LinearGradientStyle { pub struct LinearGradientStyle {
pub x0: f64, pub x0: f64,
pub y0: f64, pub y0: f64,
@ -211,7 +213,7 @@ impl LinearGradientStyle {
} }
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
pub struct RadialGradientStyle { pub struct RadialGradientStyle {
pub x0: f64, pub x0: f64,
pub y0: f64, pub y0: f64,
@ -321,7 +323,7 @@ impl FillOrStrokeStyle {
} }
} }
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize)] #[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
pub enum LineCapStyle { pub enum LineCapStyle {
Butt = 0, Butt = 0,
Round = 1, Round = 1,
@ -347,7 +349,7 @@ impl LineCapStyle {
} }
} }
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize)] #[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
pub enum LineJoinStyle { pub enum LineJoinStyle {
Round = 0, Round = 0,
Bevel = 1, Bevel = 1,
@ -393,7 +395,7 @@ impl RepetitionStyle {
} }
} }
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize)] #[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
pub enum CompositionStyle { pub enum CompositionStyle {
SrcIn, SrcIn,
SrcOut, SrcOut,
@ -459,7 +461,7 @@ impl CompositionStyle {
} }
} }
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize)] #[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
pub enum BlendingStyle { pub enum BlendingStyle {
Multiply, Multiply,
Screen, Screen,
@ -541,7 +543,7 @@ impl BlendingStyle {
} }
} }
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize)] #[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
pub enum CompositionOrBlending { pub enum CompositionOrBlending {
Composition(CompositionStyle), Composition(CompositionStyle),
Blending(BlendingStyle), Blending(BlendingStyle),

View file

@ -24,6 +24,9 @@ features = [ "serde_serialization" ]
[dependencies.ipc-channel] [dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel" git = "https://github.com/pcwalton/ipc-channel"
[dependencies.plugins]
path = "../plugins"
[dependencies] [dependencies]
time = "0.1" time = "0.1"
rustc-serialize = "0.3" rustc-serialize = "0.3"

View file

@ -13,7 +13,7 @@
#![deny(unsafe_code)] #![deny(unsafe_code)]
#![feature(custom_derive, plugin)] #![feature(custom_derive, plugin)]
#![plugin(serde_macros)] #![plugin(serde_macros, plugins)]
#[macro_use] #[macro_use]
extern crate bitflags; extern crate bitflags;

View file

@ -19,6 +19,7 @@ use offscreen_gl_context::GLContextAttributes;
use png::Image; use png::Image;
use util::cursor::Cursor; use util::cursor::Cursor;
use util::geometry::{PagePx, ViewportPx}; use util::geometry::{PagePx, ViewportPx};
use util::mem::HeapSizeOf;
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::mpsc::{channel, Sender, Receiver}; use std::sync::mpsc::{channel, Sender, Receiver};
use style::viewport::ViewportConstraints; use style::viewport::ViewportConstraints;
@ -69,7 +70,7 @@ pub enum KeyState {
} }
//N.B. Based on the glutin key enum //N.B. Based on the glutin key enum
#[derive(Debug, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Deserialize, Serialize, HeapSizeOf)]
pub enum Key { pub enum Key {
Space, Space,
Apostrophe, Apostrophe,

View file

@ -31,6 +31,9 @@ git = "https://github.com/pcwalton/ipc-channel"
version = "0.2" version = "0.2"
features = [ "serde_serialization" ] features = [ "serde_serialization" ]
[dependencies.plugins]
path = "../plugins"
[dependencies] [dependencies]
log = "0.3" log = "0.3"
euclid = "0.1" euclid = "0.1"

View file

@ -51,7 +51,7 @@ pub fn parse_hostsfile(hostsfile_content: &str) -> Box<HashMap<String, String>>
if token.as_bytes()[0] == b'#' { if token.as_bytes()[0] == b'#' {
break; break;
} }
host_table.insert(token.to_owned().to_string(), address.clone()); host_table.insert((*token).to_owned(), address.clone());
} }
} }
} }

View file

@ -6,12 +6,13 @@ use ipc_channel::ipc::IpcSharedMemory;
use png; use png;
use stb_image::image as stb_image2; use stb_image::image as stb_image2;
use std::mem; use std::mem;
use util::mem::HeapSizeOf;
use util::vec::byte_swap; use util::vec::byte_swap;
// FIXME: Images must not be copied every frame. Instead we should atomically // FIXME: Images must not be copied every frame. Instead we should atomically
// reference count them. // reference count them.
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize, HeapSizeOf)]
pub enum PixelFormat { pub enum PixelFormat {
K8, // Luminance channel only K8, // Luminance channel only
KA8, // Luminance + alpha KA8, // Luminance + alpha
@ -19,11 +20,12 @@ pub enum PixelFormat {
RGBA8, // RGB + alpha, 8 bits per channel RGBA8, // RGB + alpha, 8 bits per channel
} }
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize, HeapSizeOf)]
pub struct Image { pub struct Image {
pub width: u32, pub width: u32,
pub height: u32, pub height: u32,
pub format: PixelFormat, pub format: PixelFormat,
#[ignore_heap_size_of = "Defined in ipc-channel"]
pub bytes: IpcSharedMemory, pub bytes: IpcSharedMemory,
} }

View file

@ -6,6 +6,7 @@ use image::base::Image;
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
use url::Url; use url::Url;
use std::sync::Arc; use std::sync::Arc;
use util::mem::HeapSizeOf;
/// This is optionally passed to the image cache when requesting /// This is optionally passed to the image cache when requesting
/// and image, and returned to the specified event loop when the /// and image, and returned to the specified event loop when the
@ -37,7 +38,7 @@ pub enum ImageState {
} }
/// The returned image. /// The returned image.
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
pub enum ImageResponse { pub enum ImageResponse {
/// The requested image was loaded. /// The requested image was loaded.
Loaded(Arc<Image>), Loaded(Arc<Image>),

View file

@ -9,7 +9,8 @@
#![feature(slice_patterns)] #![feature(slice_patterns)]
#![feature(step_by)] #![feature(step_by)]
#![feature(vec_push_all)] #![feature(vec_push_all)]
#![plugin(serde_macros)] #![feature(custom_attribute)]
#![plugin(serde_macros, plugins)]
#![plugin(regex_macros)] #![plugin(regex_macros)]
@ -35,6 +36,7 @@ use msg::constellation_msg::{PipelineId};
use regex::Regex; use regex::Regex;
use serde::{Deserializer, Serializer}; use serde::{Deserializer, Serializer};
use url::Url; use url::Url;
use util::mem::HeapSizeOf;
use std::thread; use std::thread;
@ -56,12 +58,14 @@ pub mod image {
pub mod base; pub mod base;
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
pub struct LoadData { pub struct LoadData {
pub url: Url, pub url: Url,
pub method: Method, pub method: Method,
#[ignore_heap_size_of = "Defined in hyper"]
/// Headers that will apply to the initial request only /// Headers that will apply to the initial request only
pub headers: Headers, pub headers: Headers,
#[ignore_heap_size_of = "Defined in hyper"]
/// Headers that will apply to the initial request and any redirects /// Headers that will apply to the initial request and any redirects
pub preserved_headers: Headers, pub preserved_headers: Headers,
pub data: Option<Vec<u8>>, pub data: Option<Vec<u8>>,
@ -231,7 +235,7 @@ pub struct LoadResponse {
pub progress_port: IpcReceiver<ProgressMsg>, pub progress_port: IpcReceiver<ProgressMsg>,
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
pub struct ResourceCORSData { pub struct ResourceCORSData {
/// CORS Preflight flag /// CORS Preflight flag
pub preflight: bool, pub preflight: bool,
@ -240,7 +244,7 @@ pub struct ResourceCORSData {
} }
/// Metadata about a loaded resource, such as is obtained from HTTP headers. /// Metadata about a loaded resource, such as is obtained from HTTP headers.
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
pub struct Metadata { pub struct Metadata {
/// Final URL after redirects. /// Final URL after redirects.
pub final_url: Url, pub final_url: Url,
@ -251,6 +255,7 @@ pub struct Metadata {
/// Character set. /// Character set.
pub charset: Option<String>, pub charset: Option<String>,
#[ignore_heap_size_of = "Defined in hyper"]
/// Headers /// Headers
pub headers: Option<Headers>, pub headers: Option<Headers>,

View file

@ -7,7 +7,7 @@ use url::Url;
use util::str::DOMString; use util::str::DOMString;
#[derive(Copy, Clone, Deserialize, Serialize)] #[derive(Copy, Clone, Deserialize, Serialize, HeapSizeOf)]
pub enum StorageType { pub enum StorageType {
Session, Session,
Local Local

View file

@ -32,6 +32,7 @@ use hyper::status::StatusClass::Success;
use unicase::UniCase; use unicase::UniCase;
use url::{SchemeData, Url}; use url::{SchemeData, Url};
use util::mem::HeapSizeOf;
use util::task::spawn_named; use util::task::spawn_named;
/// Interface for network listeners concerned with CORS checks. Proper network requests /// Interface for network listeners concerned with CORS checks. Proper network requests
@ -40,12 +41,13 @@ pub trait AsyncCORSResponseListener {
fn response_available(&self, response: CORSResponse); fn response_available(&self, response: CORSResponse);
} }
#[derive(Clone)] #[derive(Clone, HeapSizeOf)]
pub struct CORSRequest { pub struct CORSRequest {
pub origin: Url, pub origin: Url,
pub destination: Url, pub destination: Url,
pub mode: RequestMode, pub mode: RequestMode,
pub method: Method, pub method: Method,
#[ignore_heap_size_of = "Defined in hyper"]
pub headers: Headers, pub headers: Headers,
/// CORS preflight flag (https://fetch.spec.whatwg.org/#concept-http-fetch) /// CORS preflight flag (https://fetch.spec.whatwg.org/#concept-http-fetch)
/// Indicates that a CORS preflight request and/or cache check is to be performed /// Indicates that a CORS preflight request and/or cache check is to be performed
@ -55,7 +57,7 @@ pub struct CORSRequest {
/// https://fetch.spec.whatwg.org/#concept-request-mode /// https://fetch.spec.whatwg.org/#concept-request-mode
/// This only covers some of the request modes. The /// This only covers some of the request modes. The
/// `same-origin` and `no CORS` modes are unnecessary for XHR. /// `same-origin` and `no CORS` modes are unnecessary for XHR.
#[derive(PartialEq, Copy, Clone)] #[derive(PartialEq, Copy, Clone, HeapSizeOf)]
pub enum RequestMode { pub enum RequestMode {
CORS, // CORS CORS, // CORS
ForcedPreflight // CORS-with-forced-preflight ForcedPreflight // CORS-with-forced-preflight

View file

@ -23,12 +23,13 @@ use std::cell::Ref;
use std::mem; use std::mem;
use std::ops::Deref; use std::ops::Deref;
#[derive(HeapSizeOf)]
pub enum AttrSettingType { pub enum AttrSettingType {
FirstSetAttr, FirstSetAttr,
ReplacedAttr, ReplacedAttr,
} }
#[derive(JSTraceable, PartialEq, Clone)] #[derive(JSTraceable, PartialEq, Clone, HeapSizeOf)]
pub enum AttrValue { pub enum AttrValue {
String(DOMString), String(DOMString),
TokenList(DOMString, Vec<Atom>), TokenList(DOMString, Vec<Atom>),
@ -110,6 +111,7 @@ impl Deref for AttrValue {
// https://dom.spec.whatwg.org/#interface-attr // https://dom.spec.whatwg.org/#interface-attr
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct Attr { pub struct Attr {
reflector_: Reflector, reflector_: Reflector,
local_name: Atom, local_name: Atom,

View file

@ -9,6 +9,7 @@ use dom::bindings::conversions::ToJSValConvertible;
use dom::bindings::global::GlobalRef; use dom::bindings::global::GlobalRef;
use dom::domexception::{DOMException, DOMErrorName}; use dom::domexception::{DOMException, DOMErrorName};
use util::mem::HeapSizeOf;
use util::str::DOMString; use util::str::DOMString;
use js::jsapi::{JSContext, JSObject, RootedValue}; use js::jsapi::{JSContext, JSObject, RootedValue};
@ -24,7 +25,7 @@ use std::ptr;
use std::mem; use std::mem;
/// DOM exceptions that can be thrown by a native DOM method. /// DOM exceptions that can be thrown by a native DOM method.
#[derive(Debug, Clone)] #[derive(Debug, Clone, HeapSizeOf)]
pub enum Error { pub enum Error {
/// IndexSizeError DOMException /// IndexSizeError DOMException
IndexSize, IndexSize,

View file

@ -27,6 +27,8 @@ use js::jsapi::{GetGlobalForObjectCrossCompartment};
use js::jsapi::{JSContext, JSObject, JS_GetClass, MutableHandleValue}; use js::jsapi::{JSContext, JSObject, JS_GetClass, MutableHandleValue};
use url::Url; use url::Url;
use util::mem::HeapSizeOf;
/// A freely-copyable reference to a rooted global object. /// A freely-copyable reference to a rooted global object.
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub enum GlobalRef<'a> { pub enum GlobalRef<'a> {
@ -47,7 +49,7 @@ pub enum GlobalRoot {
/// A traced reference to a global object, for use in fields of traced Rust /// A traced reference to a global object, for use in fields of traced Rust
/// structures. /// structures.
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
#[must_root] #[must_root]
pub enum GlobalField { pub enum GlobalField {
/// A field for a `Window` object. /// A field for a `Window` object.

View file

@ -463,4 +463,3 @@ impl<T: Reflectable> Drop for Root<T> {
unsafe { (*self.root_list).unroot(self); } unsafe { (*self.root_list).unroot(self); }
} }
} }

View file

@ -11,8 +11,10 @@ use std::ops;
use std::str; use std::str;
use std::str::FromStr; use std::str::FromStr;
use util::mem::HeapSizeOf;
/// Encapsulates the IDL `ByteString` type. /// Encapsulates the IDL `ByteString` type.
#[derive(JSTraceable,Clone,Eq,PartialEq)] #[derive(JSTraceable, Clone, Eq, PartialEq, HeapSizeOf)]
pub struct ByteString(Vec<u8>); pub struct ByteString(Vec<u8>);
impl ByteString { impl ByteString {

View file

@ -17,7 +17,7 @@ use std::borrow::ToOwned;
use std::cmp::{min, max}; use std::cmp::{min, max};
use std::cell::{Cell}; use std::cell::{Cell};
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
pub enum BlobTypeId { pub enum BlobTypeId {
Blob, Blob,
File, File,
@ -25,6 +25,7 @@ pub enum BlobTypeId {
// http://dev.w3.org/2006/webapi/FileAPI/#blob // http://dev.w3.org/2006/webapi/FileAPI/#blob
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct Blob { pub struct Blob {
reflector_: Reflector, reflector_: Reflector,
type_: BlobTypeId, type_: BlobTypeId,

View file

@ -16,13 +16,14 @@ use dom::canvasrenderingcontext2d::parse_color;
// https://html.spec.whatwg.org/multipage/#canvasgradient // https://html.spec.whatwg.org/multipage/#canvasgradient
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct CanvasGradient { pub struct CanvasGradient {
reflector_: Reflector, reflector_: Reflector,
style: CanvasGradientStyle, style: CanvasGradientStyle,
stops: DOMRefCell<Vec<CanvasGradientStop>>, stops: DOMRefCell<Vec<CanvasGradientStop>>,
} }
#[derive(JSTraceable, Clone)] #[derive(JSTraceable, Clone, HeapSizeOf)]
pub enum CanvasGradientStyle { pub enum CanvasGradientStyle {
Linear(LinearGradientStyle), Linear(LinearGradientStyle),
Radial(RadialGradientStyle), Radial(RadialGradientStyle),

View file

@ -12,6 +12,7 @@ use euclid::size::Size2D;
// https://html.spec.whatwg.org/multipage/#canvaspattern // https://html.spec.whatwg.org/multipage/#canvaspattern
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct CanvasPattern { pub struct CanvasPattern {
reflector_: Reflector, reflector_: Reflector,
surface_data: Vec<u8>, surface_data: Vec<u8>,

View file

@ -51,7 +51,7 @@ use url::Url;
use util::vec::byte_swap; use util::vec::byte_swap;
#[must_root] #[must_root]
#[derive(JSTraceable, Clone)] #[derive(JSTraceable, Clone, HeapSizeOf)]
pub enum CanvasFillOrStrokeStyle { pub enum CanvasFillOrStrokeStyle {
Color(RGBA), Color(RGBA),
Gradient(JS<CanvasGradient>), Gradient(JS<CanvasGradient>),
@ -60,10 +60,12 @@ pub enum CanvasFillOrStrokeStyle {
// https://html.spec.whatwg.org/multipage/#canvasrenderingcontext2d // https://html.spec.whatwg.org/multipage/#canvasrenderingcontext2d
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct CanvasRenderingContext2D { pub struct CanvasRenderingContext2D {
reflector_: Reflector, reflector_: Reflector,
global: GlobalField, global: GlobalField,
renderer_id: usize, renderer_id: usize,
#[ignore_heap_size_of = "Defined in ipc-channel"]
ipc_renderer: IpcSender<CanvasMsg>, ipc_renderer: IpcSender<CanvasMsg>,
canvas: JS<HTMLCanvasElement>, canvas: JS<HTMLCanvasElement>,
state: RefCell<CanvasContextState>, state: RefCell<CanvasContextState>,
@ -71,7 +73,7 @@ pub struct CanvasRenderingContext2D {
} }
#[must_root] #[must_root]
#[derive(JSTraceable, Clone)] #[derive(JSTraceable, Clone, HeapSizeOf)]
struct CanvasContextState { struct CanvasContextState {
global_alpha: f64, global_alpha: f64,
global_composition: CompositionOrBlending, global_composition: CompositionOrBlending,

View file

@ -16,6 +16,7 @@ use script_task::ScriptChan;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct CloseEvent { pub struct CloseEvent {
event: Event, event: Event,
wasClean: bool, wasClean: bool,

View file

@ -16,6 +16,7 @@ use util::str::DOMString;
/// An HTML comment. /// An HTML comment.
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct Comment { pub struct Comment {
characterdata: CharacterData, characterdata: CharacterData,
} }

View file

@ -13,6 +13,7 @@ use util::str::DOMString;
// https://developer.mozilla.org/en-US/docs/Web/API/Console // https://developer.mozilla.org/en-US/docs/Web/API/Console
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct Console { pub struct Console {
reflector_: Reflector, reflector_: Reflector,
global: GlobalField, global: GlobalField,

View file

@ -22,6 +22,7 @@ no_jsmanaged_fields!(OsRng);
// https://developer.mozilla.org/en-US/docs/Web/API/Crypto // https://developer.mozilla.org/en-US/docs/Web/API/Crypto
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct Crypto { pub struct Crypto {
reflector_: Reflector, reflector_: Reflector,
rng: DOMRefCell<OsRng>, rng: DOMRefCell<OsRng>,

View file

@ -10,6 +10,7 @@ use util::str::DOMString;
use cssparser::serialize_identifier; use cssparser::serialize_identifier;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct CSS { pub struct CSS {
reflector_: Reflector, reflector_: Reflector,
} }

View file

@ -25,6 +25,7 @@ use std::cell::Ref;
// http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface // http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct CSSStyleDeclaration { pub struct CSSStyleDeclaration {
reflector_: Reflector, reflector_: Reflector,
owner: JS<HTMLElement>, owner: JS<HTMLElement>,
@ -32,7 +33,7 @@ pub struct CSSStyleDeclaration {
pseudo: Option<PseudoElement>, pseudo: Option<PseudoElement>,
} }
#[derive(PartialEq)] #[derive(PartialEq, HeapSizeOf)]
pub enum CSSModificationAccess { pub enum CSSModificationAccess {
ReadWrite, ReadWrite,
Readonly Readonly

View file

@ -17,8 +17,10 @@ use util::str::DOMString;
// https://dom.spec.whatwg.org/#interface-customevent // https://dom.spec.whatwg.org/#interface-customevent
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct CustomEvent { pub struct CustomEvent {
event: Event, event: Event,
#[ignore_heap_size_of = "Defined in rust-mozjs"]
detail: MutHeapJSVal, detail: MutHeapJSVal,
} }

View file

@ -98,12 +98,17 @@ enum MixedMessage {
// https://html.spec.whatwg.org/multipage/#dedicatedworkerglobalscope // https://html.spec.whatwg.org/multipage/#dedicatedworkerglobalscope
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct DedicatedWorkerGlobalScope { pub struct DedicatedWorkerGlobalScope {
workerglobalscope: WorkerGlobalScope, workerglobalscope: WorkerGlobalScope,
id: PipelineId, id: PipelineId,
#[ignore_heap_size_of = "Defined in std"]
receiver: Receiver<(TrustedWorkerAddress, ScriptMsg)>, receiver: Receiver<(TrustedWorkerAddress, ScriptMsg)>,
#[ignore_heap_size_of = "Defined in std"]
own_sender: Sender<(TrustedWorkerAddress, ScriptMsg)>, own_sender: Sender<(TrustedWorkerAddress, ScriptMsg)>,
#[ignore_heap_size_of = "Trusted<T> has unclear ownership like JS<T>"]
worker: DOMRefCell<Option<TrustedWorkerAddress>>, worker: DOMRefCell<Option<TrustedWorkerAddress>>,
#[ignore_heap_size_of = "Can't measure trait objects"]
/// Sender to the parent thread. /// Sender to the parent thread.
parent_sender: Box<ScriptChan+Send>, parent_sender: Box<ScriptChan+Send>,
} }

View file

@ -104,7 +104,7 @@ use std::sync::mpsc::channel;
use std::rc::Rc; use std::rc::Rc;
use time; use time;
#[derive(JSTraceable, PartialEq)] #[derive(JSTraceable, PartialEq, HeapSizeOf)]
pub enum IsHTMLDocument { pub enum IsHTMLDocument {
HTMLDocument, HTMLDocument,
NonHTMLDocument, NonHTMLDocument,
@ -171,7 +171,7 @@ impl DocumentDerived for EventTarget {
} }
} }
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct ImagesFilter; struct ImagesFilter;
impl CollectionFilter for ImagesFilter { impl CollectionFilter for ImagesFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {
@ -179,7 +179,7 @@ impl CollectionFilter for ImagesFilter {
} }
} }
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct EmbedsFilter; struct EmbedsFilter;
impl CollectionFilter for EmbedsFilter { impl CollectionFilter for EmbedsFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {
@ -187,7 +187,7 @@ impl CollectionFilter for EmbedsFilter {
} }
} }
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct LinksFilter; struct LinksFilter;
impl CollectionFilter for LinksFilter { impl CollectionFilter for LinksFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {
@ -196,7 +196,7 @@ impl CollectionFilter for LinksFilter {
} }
} }
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct FormsFilter; struct FormsFilter;
impl CollectionFilter for FormsFilter { impl CollectionFilter for FormsFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {
@ -204,7 +204,7 @@ impl CollectionFilter for FormsFilter {
} }
} }
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct ScriptsFilter; struct ScriptsFilter;
impl CollectionFilter for ScriptsFilter { impl CollectionFilter for ScriptsFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {
@ -212,7 +212,7 @@ impl CollectionFilter for ScriptsFilter {
} }
} }
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct AnchorsFilter; struct AnchorsFilter;
impl CollectionFilter for AnchorsFilter { impl CollectionFilter for AnchorsFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {
@ -220,7 +220,7 @@ impl CollectionFilter for AnchorsFilter {
} }
} }
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct AppletsFilter; struct AppletsFilter;
impl CollectionFilter for AppletsFilter { impl CollectionFilter for AppletsFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {
@ -1053,6 +1053,7 @@ impl<'a> DocumentHelpers<'a> for &'a Document {
} }
} }
#[derive(HeapSizeOf)]
pub enum MouseEventType { pub enum MouseEventType {
Click, Click,
MouseDown, MouseDown,
@ -1060,7 +1061,7 @@ pub enum MouseEventType {
} }
#[derive(PartialEq)] #[derive(PartialEq, HeapSizeOf)]
pub enum DocumentSource { pub enum DocumentSource {
FromParser, FromParser,
NotFromParser, NotFromParser,
@ -1827,7 +1828,7 @@ impl<'a> DocumentMethods for &'a Document {
// https://html.spec.whatwg.org/multipage/#dom-tree-accessors:dom-document-nameditem-filter // https://html.spec.whatwg.org/multipage/#dom-tree-accessors:dom-document-nameditem-filter
fn NamedGetter(self, _cx: *mut JSContext, name: DOMString, found: &mut bool) fn NamedGetter(self, _cx: *mut JSContext, name: DOMString, found: &mut bool)
-> *mut JSObject { -> *mut JSObject {
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct NamedElementFilter { struct NamedElementFilter {
name: Atom, name: Atom,
} }
@ -1918,6 +1919,7 @@ fn is_scheme_host_port_tuple(url: &Url) -> bool {
url.host().is_some() && url.port_or_default().is_some() url.host().is_some() && url.port_or_default().is_some()
} }
#[derive(HeapSizeOf)]
pub enum DocumentProgressTask { pub enum DocumentProgressTask {
DOMContentLoaded, DOMContentLoaded,
Load, Load,

View file

@ -21,6 +21,7 @@ use util::str::DOMString;
// https://dom.spec.whatwg.org/#documentfragment // https://dom.spec.whatwg.org/#documentfragment
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct DocumentFragment { pub struct DocumentFragment {
node: Node, node: Node,
} }

View file

@ -18,6 +18,7 @@ use std::borrow::ToOwned;
// https://dom.spec.whatwg.org/#documenttype // https://dom.spec.whatwg.org/#documenttype
/// The `DOCTYPE` tag. /// The `DOCTYPE` tag.
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct DocumentType { pub struct DocumentType {
node: Node, node: Node,
name: DOMString, name: DOMString,

View file

@ -13,7 +13,7 @@ use util::str::DOMString;
use std::borrow::ToOwned; use std::borrow::ToOwned;
#[repr(u16)] #[repr(u16)]
#[derive(JSTraceable, Copy, Clone, Debug)] #[derive(JSTraceable, Copy, Clone, Debug, HeapSizeOf)]
pub enum DOMErrorName { pub enum DOMErrorName {
IndexSizeError = DOMExceptionConstants::INDEX_SIZE_ERR, IndexSizeError = DOMExceptionConstants::INDEX_SIZE_ERR,
HierarchyRequestError = DOMExceptionConstants::HIERARCHY_REQUEST_ERR, HierarchyRequestError = DOMExceptionConstants::HIERARCHY_REQUEST_ERR,
@ -41,6 +41,7 @@ pub enum DOMErrorName {
} }
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct DOMException { pub struct DOMException {
reflector_: Reflector, reflector_: Reflector,
code: DOMErrorName, code: DOMErrorName,

View file

@ -27,6 +27,7 @@ use std::borrow::ToOwned;
// https://dom.spec.whatwg.org/#domimplementation // https://dom.spec.whatwg.org/#domimplementation
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct DOMImplementation { pub struct DOMImplementation {
reflector_: Reflector, reflector_: Reflector,
document: JS<Document>, document: JS<Document>,

View file

@ -21,6 +21,7 @@ use util::str::DOMString;
use std::borrow::ToOwned; use std::borrow::ToOwned;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct DOMParser { pub struct DOMParser {
reflector_: Reflector, reflector_: Reflector,
window: JS<Window>, //XXXjdm Document instead? window: JS<Window>, //XXXjdm Document instead?

View file

@ -12,6 +12,7 @@ use dom::dompointreadonly::{DOMPointReadOnly, DOMPointWriteMethods};
// http://dev.w3.org/fxtf/geometry/Overview.html#dompoint // http://dev.w3.org/fxtf/geometry/Overview.html#dompoint
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct DOMPoint { pub struct DOMPoint {
point: DOMPointReadOnly point: DOMPointReadOnly
} }

View file

@ -11,6 +11,7 @@ use std::cell::Cell;
// http://dev.w3.org/fxtf/geometry/Overview.html#dompointreadonly // http://dev.w3.org/fxtf/geometry/Overview.html#dompointreadonly
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct DOMPointReadOnly { pub struct DOMPointReadOnly {
reflector_: Reflector, reflector_: Reflector,
x: Cell<f64>, x: Cell<f64>,

View file

@ -12,6 +12,7 @@ use dom::window::Window;
use util::geometry::Au; use util::geometry::Au;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct DOMRect { pub struct DOMRect {
reflector_: Reflector, reflector_: Reflector,
top: f32, top: f32,

View file

@ -11,6 +11,7 @@ use dom::domrect::DOMRect;
use dom::window::Window; use dom::window::Window;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct DOMRectList { pub struct DOMRectList {
reflector_: Reflector, reflector_: Reflector,
rects: Vec<JS<DOMRect>>, rects: Vec<JS<DOMRect>>,

View file

@ -13,6 +13,7 @@ use dom::htmlelement::{HTMLElement, HTMLElementCustomAttributeHelpers};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct DOMStringMap { pub struct DOMStringMap {
reflector_: Reflector, reflector_: Reflector,
element: JS<HTMLElement>, element: JS<HTMLElement>,

View file

@ -19,6 +19,7 @@ use string_cache::Atom;
use std::borrow::ToOwned; use std::borrow::ToOwned;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct DOMTokenList { pub struct DOMTokenList {
reflector_: Reflector, reflector_: Reflector,
element: JS<Element>, element: JS<Element>,

View file

@ -92,6 +92,7 @@ use std::mem;
use std::sync::Arc; use std::sync::Arc;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct Element { pub struct Element {
node: Node, node: Node,
local_name: Atom, local_name: Atom,
@ -125,7 +126,7 @@ pub enum ElementTypeId {
Element, Element,
} }
#[derive(PartialEq)] #[derive(PartialEq, HeapSizeOf)]
pub enum ElementCreator { pub enum ElementCreator {
ParserCreated, ParserCreated,
ScriptCreated, ScriptCreated,
@ -562,7 +563,7 @@ impl LayoutElementHelpers for LayoutJS<Element> {
} }
} }
#[derive(PartialEq, Eq, Copy, Clone)] #[derive(PartialEq, Eq, Copy, Clone, HeapSizeOf)]
pub enum StylePriority { pub enum StylePriority {
Important, Important,
Normal, Normal,

View file

@ -22,12 +22,14 @@ use std::cell::Cell;
use js::jsval::JSVal; use js::jsval::JSVal;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct ErrorEvent { pub struct ErrorEvent {
event: Event, event: Event,
message: DOMRefCell<DOMString>, message: DOMRefCell<DOMString>,
filename: DOMRefCell<DOMString>, filename: DOMRefCell<DOMString>,
lineno: Cell<u32>, lineno: Cell<u32>,
colno: Cell<u32>, colno: Cell<u32>,
#[ignore_heap_size_of = "Defined in rust-mozjs"]
error: MutHeapJSVal, error: MutHeapJSVal,
} }

View file

@ -20,6 +20,7 @@ use time;
#[derive(JSTraceable, Copy, Clone)] #[derive(JSTraceable, Copy, Clone)]
#[repr(u16)] #[repr(u16)]
#[derive(HeapSizeOf)]
pub enum EventPhase { pub enum EventPhase {
None = EventConstants::NONE, None = EventConstants::NONE,
Capturing = EventConstants::CAPTURING_PHASE, Capturing = EventConstants::CAPTURING_PHASE,
@ -27,7 +28,7 @@ pub enum EventPhase {
Bubbling = EventConstants::BUBBLING_PHASE, Bubbling = EventConstants::BUBBLING_PHASE,
} }
#[derive(JSTraceable, PartialEq)] #[derive(JSTraceable, PartialEq, HeapSizeOf)]
pub enum EventTypeId { pub enum EventTypeId {
CustomEvent, CustomEvent,
HTMLEvent, HTMLEvent,
@ -41,19 +42,20 @@ pub enum EventTypeId {
CloseEvent CloseEvent
} }
#[derive(PartialEq)] #[derive(PartialEq, HeapSizeOf)]
pub enum EventBubbles { pub enum EventBubbles {
Bubbles, Bubbles,
DoesNotBubble DoesNotBubble
} }
#[derive(PartialEq)] #[derive(PartialEq, HeapSizeOf)]
pub enum EventCancelable { pub enum EventCancelable {
Cancelable, Cancelable,
NotCancelable NotCancelable
} }
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct Event { pub struct Event {
reflector_: Reflector, reflector_: Reflector,
type_id: EventTypeId, type_id: EventTypeId,

View file

@ -11,6 +11,7 @@ use dom::blob::{Blob, BlobTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct File { pub struct File {
blob: Blob, blob: Blob,
name: DOMString, name: DOMString,

View file

@ -12,6 +12,7 @@ use dom::window::Window;
// https://w3c.github.io/FileAPI/#dfn-filelist // https://w3c.github.io/FileAPI/#dfn-filelist
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct FileList { pub struct FileList {
reflector_: Reflector, reflector_: Reflector,
list: Vec<JS<File>> list: Vec<JS<File>>

View file

@ -29,7 +29,7 @@ use util::str::DOMString;
use util::task::spawn_named; use util::task::spawn_named;
use rustc_serialize::base64::{Config, ToBase64, CharacterSet, Newline}; use rustc_serialize::base64::{Config, ToBase64, CharacterSet, Newline};
#[derive(PartialEq, Clone, Copy, JSTraceable)] #[derive(PartialEq, Clone, Copy, JSTraceable, HeapSizeOf)]
pub enum FileReaderFunction { pub enum FileReaderFunction {
ReadAsText, ReadAsText,
ReadAsDataUrl, ReadAsDataUrl,
@ -37,7 +37,7 @@ pub enum FileReaderFunction {
pub type TrustedFileReader = Trusted<FileReader>; pub type TrustedFileReader = Trusted<FileReader>;
#[derive(Clone)] #[derive(Clone, HeapSizeOf)]
pub struct ReadMetaData { pub struct ReadMetaData {
pub blobtype: DOMString, pub blobtype: DOMString,
pub label: Option<DOMString>, pub label: Option<DOMString>,
@ -55,11 +55,11 @@ impl ReadMetaData {
} }
} }
#[derive(PartialEq, Clone, Copy, JSTraceable)] #[derive(PartialEq, Clone, Copy, JSTraceable, HeapSizeOf)]
pub struct GenerationId(u32); pub struct GenerationId(u32);
#[repr(u16)] #[repr(u16)]
#[derive(Copy, Clone, Debug, PartialEq, JSTraceable)] #[derive(Copy, Clone, Debug, PartialEq, JSTraceable, HeapSizeOf)]
pub enum FileReaderReadyState { pub enum FileReaderReadyState {
Empty = FileReaderConstants::EMPTY, Empty = FileReaderConstants::EMPTY,
Loading = FileReaderConstants::LOADING, Loading = FileReaderConstants::LOADING,
@ -67,6 +67,7 @@ pub enum FileReaderReadyState {
} }
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct FileReader { pub struct FileReader {
eventtarget: EventTarget, eventtarget: EventTarget,
global: GlobalField, global: GlobalField,

View file

@ -23,12 +23,14 @@ use std::collections::hash_map::Entry::{Occupied, Vacant};
#[derive(JSTraceable, Clone)] #[derive(JSTraceable, Clone)]
#[must_root] #[must_root]
#[derive(HeapSizeOf)]
pub enum FormDatum { pub enum FormDatum {
StringData(DOMString), StringData(DOMString),
FileData(JS<File>) FileData(JS<File>)
} }
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct FormData { pub struct FormData {
reflector_: Reflector, reflector_: Reflector,
data: DOMRefCell<HashMap<DOMString, Vec<FormDatum>>>, data: DOMRefCell<HashMap<DOMString, Vec<FormDatum>>>,

View file

@ -33,6 +33,7 @@ use url::UrlParser;
use std::default::Default; use std::default::Default;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLAnchorElement { pub struct HTMLAnchorElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
rel_list: MutNullableHeap<JS<DOMTokenList>>, rel_list: MutNullableHeap<JS<DOMTokenList>>,

View file

@ -20,6 +20,7 @@ use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLAppletElement { pub struct HTMLAppletElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -22,6 +22,7 @@ use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLAreaElement { pub struct HTMLAreaElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
rel_list: MutNullableHeap<JS<DOMTokenList>>, rel_list: MutNullableHeap<JS<DOMTokenList>>,

View file

@ -14,6 +14,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLAudioElement { pub struct HTMLAudioElement {
htmlmediaelement: HTMLMediaElement htmlmediaelement: HTMLMediaElement
} }

View file

@ -19,6 +19,7 @@ use util::str::DOMString;
use url::{Url, UrlParser}; use url::{Url, UrlParser};
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLBaseElement { pub struct HTMLBaseElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -35,6 +35,7 @@ use time;
const INITIAL_REFLOW_DELAY: u64 = 200_000_000; const INITIAL_REFLOW_DELAY: u64 = 200_000_000;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLBodyElement { pub struct HTMLBodyElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
background_color: Cell<Option<RGBA>>, background_color: Cell<Option<RGBA>>,

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLBRElement { pub struct HTMLBRElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }

View file

@ -29,6 +29,7 @@ use std::cell::Cell;
#[derive(JSTraceable, PartialEq, Copy, Clone)] #[derive(JSTraceable, PartialEq, Copy, Clone)]
#[allow(dead_code)] #[allow(dead_code)]
#[derive(HeapSizeOf)]
enum ButtonType { enum ButtonType {
ButtonSubmit, ButtonSubmit,
ButtonReset, ButtonReset,
@ -37,6 +38,7 @@ enum ButtonType {
} }
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLButtonElement { pub struct HTMLButtonElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
button_type: Cell<ButtonType> button_type: Cell<ButtonType>

View file

@ -38,7 +38,7 @@ const DEFAULT_WIDTH: u32 = 300;
const DEFAULT_HEIGHT: u32 = 150; const DEFAULT_HEIGHT: u32 = 150;
#[must_root] #[must_root]
#[derive(JSTraceable, Clone, Copy)] #[derive(JSTraceable, Clone, Copy, HeapSizeOf)]
pub enum CanvasContext { pub enum CanvasContext {
Context2d(JS<CanvasRenderingContext2D>), Context2d(JS<CanvasRenderingContext2D>),
WebGL(JS<WebGLRenderingContext>), WebGL(JS<WebGLRenderingContext>),
@ -47,6 +47,7 @@ pub enum CanvasContext {
impl HeapGCValue for CanvasContext {} impl HeapGCValue for CanvasContext {}
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLCanvasElement { pub struct HTMLCanvasElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
context: MutNullableHeap<CanvasContext>, context: MutNullableHeap<CanvasContext>,

View file

@ -30,8 +30,10 @@ pub enum CollectionTypeId {
} }
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLCollection { pub struct HTMLCollection {
reflector_: Reflector, reflector_: Reflector,
#[ignore_heap_size_of = "Contains a trait object; can't measure due to #6870"]
collection: CollectionTypeId, collection: CollectionTypeId,
} }
@ -57,7 +59,7 @@ impl HTMLCollection {
fn all_elements(window: &Window, root: &Node, fn all_elements(window: &Window, root: &Node,
namespace_filter: Option<Namespace>) -> Root<HTMLCollection> { namespace_filter: Option<Namespace>) -> Root<HTMLCollection> {
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct AllElementFilter { struct AllElementFilter {
namespace_filter: Option<Namespace> namespace_filter: Option<Namespace>
} }
@ -79,7 +81,7 @@ impl HTMLCollection {
return HTMLCollection::all_elements(window, root, None); return HTMLCollection::all_elements(window, root, None);
} }
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct TagNameFilter { struct TagNameFilter {
tag: Atom, tag: Atom,
ascii_lower_tag: Atom, ascii_lower_tag: Atom,
@ -110,7 +112,7 @@ impl HTMLCollection {
if tag == "*" { if tag == "*" {
return HTMLCollection::all_elements(window, root, namespace_filter); return HTMLCollection::all_elements(window, root, namespace_filter);
} }
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct TagNameNSFilter { struct TagNameNSFilter {
tag: Atom, tag: Atom,
namespace_filter: Option<Namespace> namespace_filter: Option<Namespace>
@ -135,7 +137,7 @@ impl HTMLCollection {
pub fn by_class_name(window: &Window, root: &Node, classes: DOMString) pub fn by_class_name(window: &Window, root: &Node, classes: DOMString)
-> Root<HTMLCollection> { -> Root<HTMLCollection> {
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct ClassNameFilter { struct ClassNameFilter {
classes: Vec<Atom> classes: Vec<Atom>
} }
@ -153,7 +155,7 @@ impl HTMLCollection {
} }
pub fn children(window: &Window, root: &Node) -> Root<HTMLCollection> { pub fn children(window: &Window, root: &Node) -> Root<HTMLCollection> {
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct ElementChildFilter; struct ElementChildFilter;
impl CollectionFilter for ElementChildFilter { impl CollectionFilter for ElementChildFilter {
fn filter(&self, elem: &Element, root: &Node) -> bool { fn filter(&self, elem: &Element, root: &Node) -> bool {

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLDataElement { pub struct HTMLDataElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -17,6 +17,7 @@ use dom::node::{Node, NodeTypeId, window_from_node};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLDataListElement { pub struct HTMLDataListElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
@ -51,7 +52,7 @@ impl HTMLDataListElement {
impl<'a> HTMLDataListElementMethods for &'a HTMLDataListElement { impl<'a> HTMLDataListElementMethods for &'a HTMLDataListElement {
// https://html.spec.whatwg.org/multipage/#dom-datalist-options // https://html.spec.whatwg.org/multipage/#dom-datalist-options
fn Options(self) -> Root<HTMLCollection> { fn Options(self) -> Root<HTMLCollection> {
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct HTMLDataListOptionsFilter; struct HTMLDataListOptionsFilter;
impl CollectionFilter for HTMLDataListOptionsFilter { impl CollectionFilter for HTMLDataListOptionsFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {

View file

@ -18,6 +18,7 @@ use util::str::DOMString;
use std::borrow::ToOwned; use std::borrow::ToOwned;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLDialogElement { pub struct HTMLDialogElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
return_value: DOMRefCell<DOMString>, return_value: DOMRefCell<DOMString>,

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLDirectoryElement { pub struct HTMLDirectoryElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLDivElement { pub struct HTMLDivElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLDListElement { pub struct HTMLDListElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -40,6 +40,7 @@ use std::intrinsics;
use std::rc::Rc; use std::rc::Rc;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLElement { pub struct HTMLElement {
element: Element, element: Element,
style_decl: MutNullableHeap<JS<CSSStyleDeclaration>>, style_decl: MutNullableHeap<JS<CSSStyleDeclaration>>,

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLEmbedElement { pub struct HTMLEmbedElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -22,6 +22,7 @@ use dom::virtualmethods::VirtualMethods;
use util::str::{DOMString, StaticStringVec}; use util::str::{DOMString, StaticStringVec};
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLFieldSetElement { pub struct HTMLFieldSetElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
@ -56,7 +57,7 @@ impl HTMLFieldSetElement {
impl<'a> HTMLFieldSetElementMethods for &'a HTMLFieldSetElement { impl<'a> HTMLFieldSetElementMethods for &'a HTMLFieldSetElement {
// https://www.whatwg.org/html/#dom-fieldset-elements // https://www.whatwg.org/html/#dom-fieldset-elements
fn Elements(self) -> Root<HTMLCollection> { fn Elements(self) -> Root<HTMLCollection> {
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
struct ElementsFilter; struct ElementsFilter;
impl CollectionFilter for ElementsFilter { impl CollectionFilter for ElementsFilter {
fn filter<'a>(&self, elem: &'a Element, _root: &'a Node) -> bool { fn filter<'a>(&self, elem: &'a Element, _root: &'a Node) -> bool {

View file

@ -19,6 +19,7 @@ use cssparser::RGBA;
use std::cell::Cell; use std::cell::Cell;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLFontElement { pub struct HTMLFontElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
color: Cell<Option<RGBA>>, color: Cell<Option<RGBA>>,

View file

@ -43,6 +43,7 @@ use std::borrow::ToOwned;
use std::cell::Cell; use std::cell::Cell;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLFormElement { pub struct HTMLFormElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
marked_for_reset: Cell<bool>, marked_for_reset: Cell<bool>,
@ -149,13 +150,13 @@ impl<'a> HTMLFormElementMethods for &'a HTMLFormElement {
} }
} }
#[derive(Copy, Clone)] #[derive(Copy, Clone, HeapSizeOf)]
pub enum SubmittedFrom { pub enum SubmittedFrom {
FromFormSubmitMethod, FromFormSubmitMethod,
NotFromFormSubmitMethod NotFromFormSubmitMethod
} }
#[derive(Copy, Clone)] #[derive(Copy, Clone, HeapSizeOf)]
pub enum ResetFrom { pub enum ResetFrom {
FromFormResetMethod, FromFormResetMethod,
NotFromFormResetMethod NotFromFormResetMethod
@ -415,27 +416,28 @@ impl<'a> HTMLFormElementHelpers for &'a HTMLFormElement {
} }
// TODO: add file support // TODO: add file support
#[derive(HeapSizeOf)]
pub struct FormDatum { pub struct FormDatum {
pub ty: DOMString, pub ty: DOMString,
pub name: DOMString, pub name: DOMString,
pub value: DOMString pub value: DOMString
} }
#[derive(Copy, Clone)] #[derive(Copy, Clone, HeapSizeOf)]
pub enum FormEncType { pub enum FormEncType {
TextPlainEncoded, TextPlainEncoded,
UrlEncoded, UrlEncoded,
FormDataEncoded FormDataEncoded
} }
#[derive(Copy, Clone)] #[derive(Copy, Clone, HeapSizeOf)]
pub enum FormMethod { pub enum FormMethod {
FormGet, FormGet,
FormPost, FormPost,
FormDialog FormDialog
} }
#[derive(Copy, Clone)] #[derive(Copy, Clone, HeapSizeOf)]
pub enum FormSubmitter<'a> { pub enum FormSubmitter<'a> {
FormElement(&'a HTMLFormElement), FormElement(&'a HTMLFormElement),
InputElement(&'a HTMLInputElement), InputElement(&'a HTMLInputElement),

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLFrameElement { pub struct HTMLFrameElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLFrameSetElement { pub struct HTMLFrameSetElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -15,6 +15,7 @@ use dom::virtualmethods::VirtualMethods;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLHeadElement { pub struct HTMLHeadElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -12,7 +12,7 @@ use dom::htmlelement::{HTMLElement, HTMLElementTypeId};
use dom::node::{Node, NodeTypeId}; use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[derive(JSTraceable)] #[derive(JSTraceable, HeapSizeOf)]
pub enum HeadingLevel { pub enum HeadingLevel {
Heading1, Heading1,
Heading2, Heading2,
@ -23,6 +23,7 @@ pub enum HeadingLevel {
} }
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLHeadingElement { pub struct HTMLHeadingElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
level: HeadingLevel, level: HeadingLevel,

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLHRElement { pub struct HTMLHRElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLHtmlElement { pub struct HTMLHtmlElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -43,6 +43,7 @@ use util::str::{self, LengthOrPercentageOrAuto};
use js::jsapi::{RootedValue, JSAutoRequest, JSAutoCompartment}; use js::jsapi::{RootedValue, JSAutoRequest, JSAutoCompartment};
use js::jsval::UndefinedValue; use js::jsval::UndefinedValue;
#[derive(HeapSizeOf)]
enum SandboxAllowance { enum SandboxAllowance {
AllowNothing = 0x00, AllowNothing = 0x00,
AllowSameOrigin = 0x01, AllowSameOrigin = 0x01,
@ -54,6 +55,7 @@ enum SandboxAllowance {
} }
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLIFrameElement { pub struct HTMLIFrameElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
subpage_id: Cell<Option<SubpageId>>, subpage_id: Cell<Option<SubpageId>>,

View file

@ -37,6 +37,7 @@ use std::borrow::ToOwned;
use std::sync::Arc; use std::sync::Arc;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLImageElement { pub struct HTMLImageElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
url: DOMRefCell<Option<Url>>, url: DOMRefCell<Option<Url>>,

View file

@ -46,6 +46,7 @@ const DEFAULT_RESET_VALUE: &'static str = "Reset";
#[derive(JSTraceable, PartialEq, Copy, Clone)] #[derive(JSTraceable, PartialEq, Copy, Clone)]
#[allow(dead_code)] #[allow(dead_code)]
#[derive(HeapSizeOf)]
enum InputType { enum InputType {
InputSubmit, InputSubmit,
InputReset, InputReset,
@ -59,6 +60,7 @@ enum InputType {
} }
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLInputElement { pub struct HTMLInputElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
input_type: Cell<InputType>, input_type: Cell<InputType>,
@ -68,6 +70,7 @@ pub struct HTMLInputElement {
indeterminate: Cell<bool>, indeterminate: Cell<bool>,
value_changed: Cell<bool>, value_changed: Cell<bool>,
size: Cell<u32>, size: Cell<u32>,
#[ignore_heap_size_of = "#7193"]
textinput: DOMRefCell<TextInput<ConstellationChan>>, textinput: DOMRefCell<TextInput<ConstellationChan>>,
activation_state: DOMRefCell<InputActivationState>, activation_state: DOMRefCell<InputActivationState>,
} }
@ -80,6 +83,7 @@ impl PartialEq for HTMLInputElement {
#[derive(JSTraceable)] #[derive(JSTraceable)]
#[must_root] #[must_root]
#[derive(HeapSizeOf)]
struct InputActivationState { struct InputActivationState {
indeterminate: bool, indeterminate: bool,
checked: bool, checked: bool,

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLLabelElement { pub struct HTMLLabelElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLLegendElement { pub struct HTMLLegendElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLLIElement { pub struct HTMLLIElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }

View file

@ -39,6 +39,7 @@ use url::UrlParser;
use string_cache::Atom; use string_cache::Atom;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLLinkElement { pub struct HTMLLinkElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
rel_list: MutNullableHeap<JS<DOMTokenList>>, rel_list: MutNullableHeap<JS<DOMTokenList>>,

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLMapElement { pub struct HTMLMapElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -11,6 +11,7 @@ use dom::node::NodeTypeId;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLMediaElement { pub struct HTMLMediaElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }

View file

@ -14,6 +14,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLMetaElement { pub struct HTMLMetaElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLMeterElement { pub struct HTMLMeterElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLModElement { pub struct HTMLModElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -25,6 +25,7 @@ use util::str::DOMString;
use std::sync::Arc; use std::sync::Arc;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLObjectElement { pub struct HTMLObjectElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
image: DOMRefCell<Option<Arc<Image>>>, image: DOMRefCell<Option<Arc<Image>>>,

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLOListElement { pub struct HTMLOListElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }

View file

@ -20,6 +20,7 @@ use dom::virtualmethods::VirtualMethods;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLOptGroupElement { pub struct HTMLOptGroupElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -23,6 +23,7 @@ use dom::virtualmethods::VirtualMethods;
use util::str::{DOMString, split_html_space_chars}; use util::str::{DOMString, split_html_space_chars};
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLOptionElement { pub struct HTMLOptionElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -15,6 +15,7 @@ use dom::validitystate::ValidityState;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLOutputElement { pub struct HTMLOutputElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLParagraphElement { pub struct HTMLParagraphElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLParamElement { pub struct HTMLParamElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLPreElement { pub struct HTMLPreElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLProgressElement { pub struct HTMLProgressElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLQuoteElement { pub struct HTMLQuoteElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }

View file

@ -52,6 +52,7 @@ use string_cache::Atom;
use url::{Url, UrlParser}; use url::{Url, UrlParser};
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLScriptElement { pub struct HTMLScriptElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
@ -74,6 +75,7 @@ pub struct HTMLScriptElement {
/// Document of the parser that created this element /// Document of the parser that created this element
parser_document: JS<Document>, parser_document: JS<Document>,
#[ignore_heap_size_of = "Defined in rust-encoding"]
/// https://html.spec.whatwg.org/multipage/#concept-script-encoding /// https://html.spec.whatwg.org/multipage/#concept-script-encoding
block_character_encoding: DOMRefCell<EncodingRef>, block_character_encoding: DOMRefCell<EncodingRef>,
} }
@ -160,6 +162,7 @@ static SCRIPT_JS_MIMES: StaticStringVec = &[
"text/x-javascript", "text/x-javascript",
]; ];
#[derive(HeapSizeOf)]
pub enum ScriptOrigin { pub enum ScriptOrigin {
Internal(String, Url), Internal(String, Url),
External(Result<(Metadata, Vec<u8>), String>), External(Result<(Metadata, Vec<u8>), String>),

View file

@ -25,6 +25,7 @@ use string_cache::Atom;
use std::borrow::ToOwned; use std::borrow::ToOwned;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLSelectElement { pub struct HTMLSelectElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

View file

@ -13,6 +13,7 @@ use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
#[derive(HeapSizeOf)]
pub struct HTMLSourceElement { pub struct HTMLSourceElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }

Some files were not shown because too many files have changed in this diff Show more