Hi, We have a follow up question from our post here: https://groups.google.com/forum/#!topic/mozilla.dev.servo/-rCycXAE52Q
We've tweaked the above to include the struct (ImageRequest) in HTMLImageElement as an inner struct, however we're just having an issue with JSTraceable and HeapSizeOf. For reference here is the HTMLImageElement struct definition right now (including our changes): ``` pub struct HTMLImageElement { htmlelement: HTMLElement, url: DOMRefCell<Option<Url>>, image: DOMRefCell<Option<Arc<Image>>>, currentRequest: DOMRefCell<Option<ImageRequest>>, pendingRequest: DOMRefCell<Option<ImageRequest>>, } ``` The current error is as follows: ``` ./mach build --dev error: no method named `trace` found for type `dom::bindings::cell::DOMRefCell<core::option::Option<dom::htmlimageelement::ImageRequest>>` in the current scope /Users/niall/Desktop/projects/College/Software-Engineering/servo/components/script/dom/htmlimageelement.rs:41 currentRequest: DOMRefCell<Option<ImageRequest>>, note: in this expansion of #[derive_JSTraceable] the method `trace` exists but the following trait bounds were not satisfied: `core::option::Option<dom::htmlimageelement::ImageRequest> : dom::bindings::trace::JSTraceable` ``` We can see that Url and Image are included in bindings/trace.rs like this: no_jsmanaged_fields!(bool, f32, f64, String, Url, AtomicBool); Which we think handles ensuring that they do not need the trace method to be implemented, and while we can add ImageRequest to this file, our feeling is that this is not correct as there does not seem to be any other custom types in this file. It's similar for the HeapSizeOf issue. Our question is: How do we handle our custom type with JSTraceable and HeapSizeOf? Can anyone shed light on this issue? Thanks, Tomas. _______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo