mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
LibWeb+WebContent: Do not embed attributes as data in the Inspector HTML
Attribute values may contain HTML, and may contain invalid HTML at that. If the latter occurs, let's not generate invalid Inspector HTML when we embed the attribute values as data attributes. Instead, cache the values in the InspectorClient, and embed just a lookup index into the HTML. This also nicely reduces the size of the generated HTML. The Inspector on https://github.com/SerenityOS/serenity reduces from 2.3MB to 1.9MB (about 318KB, or 13.8%).
This commit is contained in:
parent
939779cad3
commit
f07f5a2622
13 changed files with 60 additions and 52 deletions
|
@ -87,8 +87,8 @@ endpoint WebContentClient
|
|||
inspector_did_set_dom_node_text(u64 page_id, i32 node_id, String text) =|
|
||||
inspector_did_set_dom_node_tag(u64 page_id, i32 node_id, String tag) =|
|
||||
inspector_did_add_dom_node_attributes(u64 page_id, i32 node_id, Vector<WebView::Attribute> attributes) =|
|
||||
inspector_did_replace_dom_node_attribute(u64 page_id, i32 node_id, String name, Vector<WebView::Attribute> replacement_attributes) =|
|
||||
inspector_did_request_dom_tree_context_menu(u64 page_id, i32 node_id, Gfx::IntPoint position, String type, Optional<String> tag, Optional<WebView::Attribute> attribute) =|
|
||||
inspector_did_replace_dom_node_attribute(u64 page_id, i32 node_id, size_t attribute_index, Vector<WebView::Attribute> replacement_attributes) =|
|
||||
inspector_did_request_dom_tree_context_menu(u64 page_id, i32 node_id, Gfx::IntPoint position, String type, Optional<String> tag, Optional<size_t> attribute_index) =|
|
||||
inspector_did_execute_console_script(u64 page_id, String script) =|
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue