mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
WebContent: Ignore invalid attributes set via the Inspector
Rather than crash, just ignore these values for now. We should invent a mechanism to send feedback to the user (perhaps via the JS console).
This commit is contained in:
parent
93f2af38b1
commit
4f5604c7db
Notes:
github-actions[bot]
2024-07-30 07:42:24 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/4f5604c7db9 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/894
1 changed files with 6 additions and 3 deletions
|
@ -650,8 +650,10 @@ void ConnectionFromClient::add_dom_node_attributes(u64 page_id, i32 node_id, Vec
|
|||
|
||||
auto& element = static_cast<Web::DOM::Element&>(*dom_node);
|
||||
|
||||
for (auto const& attribute : attributes)
|
||||
element.set_attribute(attribute.name, attribute.value).release_value_but_fixme_should_propagate_errors();
|
||||
for (auto const& attribute : attributes) {
|
||||
// NOTE: We ignore invalid attributes for now, but we may want to send feedback to the user that this failed.
|
||||
(void)element.set_attribute(attribute.name, attribute.value);
|
||||
}
|
||||
|
||||
async_did_finish_editing_dom_node(page_id, element.unique_id());
|
||||
}
|
||||
|
@ -671,7 +673,8 @@ void ConnectionFromClient::replace_dom_node_attribute(u64 page_id, i32 node_id,
|
|||
if (should_remove_attribute && Web::Infra::is_ascii_case_insensitive_match(name, attribute.name))
|
||||
should_remove_attribute = false;
|
||||
|
||||
element.set_attribute(attribute.name, attribute.value).release_value_but_fixme_should_propagate_errors();
|
||||
// NOTE: We ignore invalid attributes for now, but we may want to send feedback to the user that this failed.
|
||||
(void)element.set_attribute(attribute.name, attribute.value);
|
||||
}
|
||||
|
||||
if (should_remove_attribute)
|
||||
|
|
Loading…
Reference in a new issue