Trait script_layout_interface::rpc::LayoutRPC
source · 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
- read-only with respect to LayoutThreadData,
- small,
- and really needs to be fast.
Required Methods§
sourcefn content_box(&self) -> ContentBoxResponse
fn content_box(&self) -> ContentBoxResponse
Requests the dimensions of the content box, as in the getBoundingClientRect()
call.
sourcefn content_boxes(&self) -> ContentBoxesResponse
fn content_boxes(&self) -> ContentBoxesResponse
Requests the dimensions of all the content boxes, as in the getClientRects()
call.
sourcefn node_geometry(&self) -> NodeGeometryResponse
fn node_geometry(&self) -> NodeGeometryResponse
Requests the geometry of this node. Used by APIs such as clientTop
.
sourcefn scrolling_area(&self) -> NodeGeometryResponse
fn scrolling_area(&self) -> NodeGeometryResponse
Requests the scroll geometry of this node. Used by APIs such as scrollTop
.
sourcefn node_scroll_id(&self) -> NodeScrollIdResponse
fn node_scroll_id(&self) -> NodeScrollIdResponse
Requests the scroll id of this node. Used by APIs such as scrollTop
sourcefn resolved_style(&self) -> ResolvedStyleResponse
fn resolved_style(&self) -> ResolvedStyleResponse
Query layout for the resolved value of a given CSS property
sourcefn resolved_font_style(&self) -> Option<Arc<Font>>
fn resolved_font_style(&self) -> Option<Arc<Font>>
Query layout to get the resolved font style for canvas.
fn offset_parent(&self) -> OffsetParentResponse
fn text_index(&self) -> TextIndexResponse
sourcefn nodes_from_point_response(&self) -> Vec<UntrustedNodeAddress> ⓘ
fn nodes_from_point_response(&self) -> Vec<UntrustedNodeAddress> ⓘ
Requests the list of nodes from the given point.
sourcefn element_inner_text(&self) -> String
fn element_inner_text(&self) -> String
Query layout to get the inner text for a given element.