Layout: Implement innerText/outerText (#33312)

* Implement outerText on HtmlElement

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* Fixed some innerText/outerText bugs

Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>

* Unified innerText/outerText handling outside of Layout

Before these 2 were treated separately and only within
Layout would they end up calling the same method, now
they are already unified within HTMLElement

Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>

* Address a few nits

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

* Added innerText support for `inline-flex`

Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>

---------

Signed-off-by: Shane Handley <shanehandley@fastmail.com>
Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Shane Handley <shanehandley@fastmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Ben 2024-09-24 11:45:33 +02:00 committed by GitHub
parent 88ffe9f7a5
commit dbd1666b17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 617 additions and 1625 deletions

View file

@ -30,7 +30,7 @@ use ipc_channel::ipc::IpcSender;
use layout::context::LayoutContext;
use layout::display_list::{DisplayList, WebRenderImageInfo};
use layout::query::{
process_content_box_request, process_content_boxes_request, process_element_inner_text_query,
get_the_text_steps, process_content_box_request, process_content_boxes_request,
process_node_geometry_request, process_node_scroll_area_request, process_offset_parent_query,
process_resolved_font_style_query, process_resolved_style_request, process_text_index_request,
};
@ -299,12 +299,12 @@ impl Layout for LayoutThread {
}
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
fn query_element_inner_text(
fn query_element_inner_outer_text(
&self,
node: script_layout_interface::TrustedNodeAddress,
) -> String {
let node = unsafe { ServoLayoutNode::new(&node) };
process_element_inner_text_query(node)
get_the_text_steps(node)
}
fn query_inner_window_dimension(