Open Bug 1057093 Opened 10 years ago Updated 2 years ago

JS::ubi::Node should expose the buffers held by <img> tags.

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

People

(Reporter: jimb, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

Because images, compressed but especially uncompressed, are major contributors to pages' memory consumption, it would be especially valuable to teach JS::ubi::Node about img's buffer types, so it could report their sizes to our memory analysis tools. This depends on bug 1057507, which would let JS::ubi::Node point to nsINode, the DOM node base type. Some mechanism similar to that described in bug 1056992 would allow us to specialize JS::ubi::Node for image elements. I understand that image elements have a rather complex internal structure: HTMLImageElement inherits from nsImageLoadingContent points to imgRequestProxy points to ProxyBehavior is implemented by RequestBehavior points to imgRequest points to either mozilla::image::Image, whose subclasses can get an imgStatusTracker or imgStatusTracker directly, which points to mozilla::image::Image, subclassed by mozilla::image::RasterImage which points to mozilla::image::FrameBlender which points to mozilla::image::FrameSequence which points to mozilla::image::FrameDataPair which points to mozilla::image::imgFrame which points to mozilla::gfx::DataSourceSurface whose subclass mozilla::gfx::DataSourceSurfaceCairo points to cairo_surface_t at which point I got a little bored. *This entire structure does not need to be represented by distinct JS::ubi::Node specializations.* In fact, it could all be a single ubi::Node, as long as the size reported includes all this internal structure. If there is sharing going on (it wasn't clear to me from skimming the types), that shared data should get its own ubi::Node specialization, which its users have edges to.
Blocks: 1059139
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.