diff options
author | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2018-01-09 13:27:32 +0100 |
---|---|---|
committer | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2018-02-13 09:12:00 +0100 |
commit | 2a4535f43e5566a9773ed9a31931e8ec9523a22b (patch) | |
tree | 96d8d6ff0e9361a6f26b375f1843cbf8c42b1a17 /components/script_layout_interface | |
parent | 0d7c2271c284bcc2d4bd005bd0e89f9a87eba636 (diff) | |
download | servo-2a4535f43e5566a9773ed9a31931e8ec9523a22b.tar.gz servo-2a4535f43e5566a9773ed9a31931e8ec9523a22b.zip |
Implement element.innerText getter
Diffstat (limited to 'components/script_layout_interface')
-rw-r--r-- | components/script_layout_interface/lib.rs | 2 | ||||
-rw-r--r-- | components/script_layout_interface/message.rs | 7 | ||||
-rw-r--r-- | components/script_layout_interface/rpc.rs | 3 |
3 files changed, 9 insertions, 3 deletions
diff --git a/components/script_layout_interface/lib.rs b/components/script_layout_interface/lib.rs index 45c82ee1089..dc2c6f515a7 100644 --- a/components/script_layout_interface/lib.rs +++ b/components/script_layout_interface/lib.rs @@ -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, diff --git a/components/script_layout_interface/message.rs b/components/script_layout_interface/message.rs index f53022d5286..ef408600270 100644 --- a/components/script_layout_interface/message.rs +++ b/components/script_layout_interface/message.rs @@ -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, } } diff --git a/components/script_layout_interface/rpc.rs b/components/script_layout_interface/rpc.rs index 8902c7d0466..8bdb285ed8e 100644 --- a/components/script_layout_interface/rpc.rs +++ b/components/script_layout_interface/rpc.rs @@ -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>>); |