pub struct BoxModel {
pub content: ElementQuad,
pub padding: ElementQuad,
pub border: ElementQuad,
pub margin: ElementQuad,
pub width: f64,
pub height: f64,
}
Fields§
§content: ElementQuad
§padding: ElementQuad
§border: ElementQuad
§margin: ElementQuad
§width: f64
§height: f64
Implementations§
source§impl BoxModel
impl BoxModel
sourcepub fn content_viewport(&self) -> Viewport
pub fn content_viewport(&self) -> Viewport
Create a page::Viewport
equal to the content-box, using a scale of 1.0
Examples found in repository?
src/browser/tab/element/mod.rs (line 449)
441 442 443 444 445 446 447 448 449 450 451 452
pub fn capture_screenshot(
&self,
format: Page::CaptureScreenshotFormatOption,
) -> Result<Vec<u8>> {
self.scroll_into_view()?;
self.parent.capture_screenshot(
format,
Some(90),
Some(self.get_box_model()?.content_viewport()),
true,
)
}
sourcepub fn padding_viewport(&self) -> Viewport
pub fn padding_viewport(&self) -> Viewport
Create a page::Viewport
equal to the padding-box, using a scale of 1.0
sourcepub fn border_viewport(&self) -> Viewport
pub fn border_viewport(&self) -> Viewport
Create a page::Viewport
equal to the border-box, using a scale of 1.0
sourcepub fn margin_viewport(&self) -> Viewport
pub fn margin_viewport(&self) -> Viewport
Create a page::Viewport
equal to the margin-box, using a scale of 1.0