mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Implement element.innerText getter
This commit is contained in:
parent
0d7c2271c2
commit
2a4535f43e
16 changed files with 844 additions and 16 deletions
|
@ -108,11 +108,13 @@ pub enum LayoutNodeType {
|
|||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum LayoutElementType {
|
||||
Element,
|
||||
HTMLBRElement,
|
||||
HTMLCanvasElement,
|
||||
HTMLIFrameElement,
|
||||
HTMLImageElement,
|
||||
HTMLInputElement,
|
||||
HTMLObjectElement,
|
||||
HTMLParagraphElement,
|
||||
HTMLTableCellElement,
|
||||
HTMLTableColElement,
|
||||
HTMLTableElement,
|
||||
|
|
|
@ -121,6 +121,7 @@ pub enum ReflowGoal {
|
|||
StyleQuery(TrustedNodeAddress),
|
||||
TextIndexQuery(TrustedNodeAddress, Point2D<f32>),
|
||||
NodesFromPointQuery(Point2D<f32>, NodesFromPointQueryType),
|
||||
ElementInnerTextQuery(TrustedNodeAddress),
|
||||
}
|
||||
|
||||
impl ReflowGoal {
|
||||
|
@ -129,12 +130,13 @@ impl ReflowGoal {
|
|||
pub fn needs_display_list(&self) -> bool {
|
||||
match *self {
|
||||
ReflowGoal::NodesFromPointQuery(..) | ReflowGoal::TextIndexQuery(..) |
|
||||
ReflowGoal::TickAnimations | ReflowGoal::Full => true,
|
||||
ReflowGoal::TickAnimations | ReflowGoal::ElementInnerTextQuery(_) |
|
||||
ReflowGoal::Full => true,
|
||||
ReflowGoal::ContentBoxQuery(_) | ReflowGoal::ContentBoxesQuery(_) |
|
||||
ReflowGoal::NodeGeometryQuery(_) | ReflowGoal::NodeScrollGeometryQuery(_) |
|
||||
ReflowGoal::NodeScrollIdQuery(_) |
|
||||
ReflowGoal::ResolvedStyleQuery(..) | ReflowGoal::OffsetParentQuery(_) |
|
||||
ReflowGoal::StyleQuery(_) => false,
|
||||
ReflowGoal::StyleQuery(_) => false,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,6 +150,7 @@ impl ReflowGoal {
|
|||
ReflowGoal::NodeScrollIdQuery(_) | ReflowGoal::ResolvedStyleQuery(..) |
|
||||
ReflowGoal::OffsetParentQuery(_) => false,
|
||||
ReflowGoal::NodesFromPointQuery(..) | ReflowGoal::Full |
|
||||
ReflowGoal::ElementInnerTextQuery(_) |
|
||||
ReflowGoal::TickAnimations => true,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,8 @@ pub trait LayoutRPC {
|
|||
fn text_index(&self) -> TextIndexResponse;
|
||||
/// Requests the list of nodes from the given point.
|
||||
fn nodes_from_point_response(&self) -> Vec<UntrustedNodeAddress>;
|
||||
|
||||
/// Query layout to get the inner text for a given element.
|
||||
fn element_inner_text(&self) -> String;
|
||||
}
|
||||
|
||||
pub struct ContentBoxResponse(pub Option<Rect<Au>>);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue