pub trait LayoutRPC {
    // Required methods
    fn content_box(&self) -> ContentBoxResponse;
    fn content_boxes(&self) -> ContentBoxesResponse;
    fn node_geometry(&self) -> NodeGeometryResponse;
    fn scrolling_area(&self) -> NodeGeometryResponse;
    fn node_scroll_id(&self) -> NodeScrollIdResponse;
    fn resolved_style(&self) -> ResolvedStyleResponse;
    fn resolved_font_style(&self) -> Option<Arc<Font>>;
    fn offset_parent(&self) -> OffsetParentResponse;
    fn text_index(&self) -> TextIndexResponse;
    fn nodes_from_point_response(&self) -> Vec<UntrustedNodeAddress> ;
    fn element_inner_text(&self) -> String;
    fn inner_window_dimensions(&self) -> Option<Size2D<f32, CSSPixel>>;
}
Expand description

Synchronous messages that script can send to layout.

In general, you should use messages to talk to Layout. Use the RPC interface if and only if the work is

  1. read-only with respect to LayoutThreadData,
  2. small,
  3. and really needs to be fast.

Required Methods§

source

fn content_box(&self) -> ContentBoxResponse

Requests the dimensions of the content box, as in the getBoundingClientRect() call.

source

fn content_boxes(&self) -> ContentBoxesResponse

Requests the dimensions of all the content boxes, as in the getClientRects() call.

source

fn node_geometry(&self) -> NodeGeometryResponse

Requests the geometry of this node. Used by APIs such as clientTop.

source

fn scrolling_area(&self) -> NodeGeometryResponse

Requests the scroll geometry of this node. Used by APIs such as scrollTop.

source

fn node_scroll_id(&self) -> NodeScrollIdResponse

Requests the scroll id of this node. Used by APIs such as scrollTop

source

fn resolved_style(&self) -> ResolvedStyleResponse

Query layout for the resolved value of a given CSS property

source

fn resolved_font_style(&self) -> Option<Arc<Font>>

Query layout to get the resolved font style for canvas.

source

fn offset_parent(&self) -> OffsetParentResponse

source

fn text_index(&self) -> TextIndexResponse

source

fn nodes_from_point_response(&self) -> Vec<UntrustedNodeAddress>

Requests the list of nodes from the given point.

source

fn element_inner_text(&self) -> String

Query layout to get the inner text for a given element.

source

fn inner_window_dimensions(&self) -> Option<Size2D<f32, CSSPixel>>

Get the dimensions of an iframe’s inner window.

Implementors§