Trait script_layout_interface::Layout
source · pub trait Layout {
Show 24 methods
// Required methods
fn handle_constellation_msg(&mut self, msg: LayoutControlMsg);
fn handle_font_cache_msg(&mut self);
fn device(&self) -> &Device;
fn waiting_for_web_fonts_to_load(&self) -> bool;
fn current_epoch(&self) -> Epoch;
fn load_web_fonts_from_stylesheet(&self, stylesheet: ServoArc<Stylesheet>);
fn add_stylesheet(
&mut self,
stylesheet: ServoArc<Stylesheet>,
before_stylsheet: Option<ServoArc<Stylesheet>>
);
fn exit_now(&mut self);
fn collect_reports(&self, reports_chan: ReportsChan);
fn set_quirks_mode(&mut self, quirks_mode: QuirksMode);
fn remove_stylesheet(&mut self, stylesheet: ServoArc<Stylesheet>);
fn reflow(&mut self, script_reflow: ScriptReflow);
fn register_paint_worklet_modules(
&mut self,
name: Atom,
properties: Vec<Atom>,
painter: Box<dyn Painter>
);
fn query_content_box(&self, node: OpaqueNode) -> Option<Rect<Au>>;
fn query_content_boxes(&self, node: OpaqueNode) -> Vec<Rect<Au>>;
fn query_client_rect(&self, node: OpaqueNode) -> Rect<i32>;
fn query_element_inner_text(&self, node: TrustedNodeAddress) -> String;
fn query_inner_window_dimension(
&self,
context: BrowsingContextId
) -> Option<Size2D<f32, CSSPixel>>;
fn query_nodes_from_point(
&self,
point: Point2D<f32>,
query_type: NodesFromPointQueryType
) -> Vec<UntrustedNodeAddress>;
fn query_offset_parent(&self, node: OpaqueNode) -> OffsetParentResponse;
fn query_resolved_style(
&self,
node: TrustedNodeAddress,
pseudo: Option<PseudoElement>,
property_id: PropertyId,
animations: DocumentAnimationSet,
animation_timeline_value: f64
) -> String;
fn query_resolved_font_style(
&self,
node: TrustedNodeAddress,
value: &str,
animations: DocumentAnimationSet,
animation_timeline_value: f64
) -> Option<ServoArc<Font>>;
fn query_scrolling_area(&self, node: Option<OpaqueNode>) -> Rect<i32>;
fn query_text_indext(
&self,
node: OpaqueNode,
point: Point2D<f32>
) -> Option<usize>;
}
Required Methods§
sourcefn handle_constellation_msg(&mut self, msg: LayoutControlMsg)
fn handle_constellation_msg(&mut self, msg: LayoutControlMsg)
Handle a single message from the Constellation.
sourcefn handle_font_cache_msg(&mut self)
fn handle_font_cache_msg(&mut self)
Handle a a single mesasge from the FontCacheThread.
sourcefn device(&self) -> &Device
fn device(&self) -> &Device
Get a reference to this Layout’s Stylo Device
used to handle media queries and
resolve font metrics.
sourcefn waiting_for_web_fonts_to_load(&self) -> bool
fn waiting_for_web_fonts_to_load(&self) -> bool
Whether or not this layout is waiting for fonts from loaded stylesheets to finish loading.
sourcefn current_epoch(&self) -> Epoch
fn current_epoch(&self) -> Epoch
The currently laid out Epoch that this Layout has finished.
sourcefn load_web_fonts_from_stylesheet(&self, stylesheet: ServoArc<Stylesheet>)
fn load_web_fonts_from_stylesheet(&self, stylesheet: ServoArc<Stylesheet>)
Load all fonts from the given stylesheet, returning the number of fonts that need to be loaded.
sourcefn add_stylesheet(
&mut self,
stylesheet: ServoArc<Stylesheet>,
before_stylsheet: Option<ServoArc<Stylesheet>>
)
fn add_stylesheet( &mut self, stylesheet: ServoArc<Stylesheet>, before_stylsheet: Option<ServoArc<Stylesheet>> )
Add a stylesheet to this Layout. This will add it to the Layout’s Stylist
as well as
loading all web fonts defined in the stylesheet. The second stylesheet is the insertion
point (if it exists, the sheet needs to be inserted before it).
sourcefn collect_reports(&self, reports_chan: ReportsChan)
fn collect_reports(&self, reports_chan: ReportsChan)
Requests that layout measure its memory usage. The resulting reports are sent back via the supplied channel.
sourcefn set_quirks_mode(&mut self, quirks_mode: QuirksMode)
fn set_quirks_mode(&mut self, quirks_mode: QuirksMode)
Sets quirks mode for the document, causing the quirks mode stylesheet to be used.
sourcefn remove_stylesheet(&mut self, stylesheet: ServoArc<Stylesheet>)
fn remove_stylesheet(&mut self, stylesheet: ServoArc<Stylesheet>)
Removes a stylesheet from the Layout.
sourcefn reflow(&mut self, script_reflow: ScriptReflow)
fn reflow(&mut self, script_reflow: ScriptReflow)
Requests a reflow.
sourcefn register_paint_worklet_modules(
&mut self,
name: Atom,
properties: Vec<Atom>,
painter: Box<dyn Painter>
)
fn register_paint_worklet_modules( &mut self, name: Atom, properties: Vec<Atom>, painter: Box<dyn Painter> )
Tells layout that script has added some paint worklet modules.