mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibWeb+LibJS+Tests: Fix typos - act I
This commit is contained in:
parent
e8213bb86b
commit
b4b8d85251
Notes:
github-actions[bot]
2025-04-07 10:23:14 +00:00
Author: https://github.com/szepeviktor 🔰 Commit: https://github.com/LadybirdBrowser/ladybird/commit/b4b8d85251d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3859 Reviewed-by: https://github.com/AtkinsSJ ✅
9 changed files with 47 additions and 47 deletions
|
@ -926,14 +926,14 @@ static Optional<String> expression_identifier(Expression const& expression)
|
|||
auto const& member_expression = static_cast<MemberExpression const&>(expression);
|
||||
StringBuilder builder;
|
||||
|
||||
if (auto identifer = expression_identifier(member_expression.object()); identifer.has_value())
|
||||
builder.append(*identifer);
|
||||
if (auto identifier = expression_identifier(member_expression.object()); identifier.has_value())
|
||||
builder.append(*identifier);
|
||||
|
||||
if (auto identifer = expression_identifier(member_expression.property()); identifer.has_value()) {
|
||||
if (auto identifier = expression_identifier(member_expression.property()); identifier.has_value()) {
|
||||
if (member_expression.is_computed())
|
||||
builder.appendff("[{}]", *identifer);
|
||||
builder.appendff("[{}]", *identifier);
|
||||
else
|
||||
builder.appendff(".{}", *identifer);
|
||||
builder.appendff(".{}", *identifier);
|
||||
}
|
||||
|
||||
return builder.to_string_without_validation();
|
||||
|
@ -944,8 +944,8 @@ static Optional<String> expression_identifier(Expression const& expression)
|
|||
|
||||
Optional<IdentifierTableIndex> Generator::intern_identifier_for_expression(Expression const& expression)
|
||||
{
|
||||
if (auto identifer = expression_identifier(expression); identifer.has_value())
|
||||
return intern_identifier(identifer.release_value());
|
||||
if (auto identifier = expression_identifier(expression); identifier.has_value())
|
||||
return intern_identifier(identifier.release_value());
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
|
@ -2319,7 +2319,7 @@ void Node::queue_mutation_record(FlyString const& type, Optional<FlyString> cons
|
|||
if (interested_observers.is_empty() && !page.listen_for_dom_mutations())
|
||||
return;
|
||||
|
||||
// FIXME: The MutationRecord constructor shuld take an Optional<FlyString> attribute name and namespace
|
||||
// FIXME: The MutationRecord constructor should take an Optional<FlyString> attribute name and namespace
|
||||
Optional<String> string_attribute_name;
|
||||
if (attribute_name.has_value())
|
||||
string_attribute_name = attribute_name->to_string();
|
||||
|
|
|
@ -39,14 +39,14 @@ NavigationAPIMethodTracker::NavigationAPIMethodTracker(GC::Ref<Navigation> navig
|
|||
Optional<String> key,
|
||||
JS::Value info,
|
||||
Optional<SerializationRecord> serialized_state,
|
||||
GC::Ptr<NavigationHistoryEntry> commited_to_entry,
|
||||
GC::Ptr<NavigationHistoryEntry> committed_to_entry,
|
||||
GC::Ref<WebIDL::Promise> committed_promise,
|
||||
GC::Ref<WebIDL::Promise> finished_promise)
|
||||
: navigation(navigation)
|
||||
, key(move(key))
|
||||
, info(info)
|
||||
, serialized_state(move(serialized_state))
|
||||
, commited_to_entry(commited_to_entry)
|
||||
, committed_to_entry(committed_to_entry)
|
||||
, committed_promise(committed_promise)
|
||||
, finished_promise(finished_promise)
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ void NavigationAPIMethodTracker::visit_edges(Cell::Visitor& visitor)
|
|||
Base::visit_edges(visitor);
|
||||
visitor.visit(navigation);
|
||||
visitor.visit(info);
|
||||
visitor.visit(commited_to_entry);
|
||||
visitor.visit(committed_to_entry);
|
||||
visitor.visit(committed_promise);
|
||||
visitor.visit(finished_promise);
|
||||
}
|
||||
|
@ -544,15 +544,15 @@ GC::Ref<NavigationAPIMethodTracker> Navigation::maybe_set_the_upcoming_non_trave
|
|||
// key: null
|
||||
// info: info
|
||||
// serialized state: serializedState
|
||||
// comitted-to entry: null
|
||||
// comitted promise: committedPromise
|
||||
// committed-to entry: null
|
||||
// committed promise: committedPromise
|
||||
// finished promise: finishedPromise
|
||||
auto api_method_tracker = vm.heap().allocate<NavigationAPIMethodTracker>(
|
||||
/* .navigation = */ *this,
|
||||
/* .key = */ OptionalNone {},
|
||||
/* .info = */ info,
|
||||
/* .serialized_state = */ move(serialized_state),
|
||||
/* .commited_to_entry = */ nullptr,
|
||||
/* .committed_to_entry = */ nullptr,
|
||||
/* .committed_promise = */ committed_promise,
|
||||
/* .finished_promise = */ finished_promise);
|
||||
|
||||
|
@ -593,15 +593,15 @@ GC::Ref<NavigationAPIMethodTracker> Navigation::add_an_upcoming_traverse_api_met
|
|||
// key: destinationKey
|
||||
// info: info
|
||||
// serialized state: null
|
||||
// comitted-to entry: null
|
||||
// comitted promise: committedPromise
|
||||
// committed-to entry: null
|
||||
// committed promise: committedPromise
|
||||
// finished promise: finishedPromise
|
||||
auto api_method_tracker = vm.heap().allocate<NavigationAPIMethodTracker>(
|
||||
/* .navigation = */ *this,
|
||||
/* .key = */ destination_key,
|
||||
/* .info = */ info,
|
||||
/* .serialized_state = */ OptionalNone {},
|
||||
/* .commited_to_entry = */ nullptr,
|
||||
/* .committed_to_entry = */ nullptr,
|
||||
/* .committed_promise = */ committed_promise,
|
||||
/* .finished_promise = */ finished_promise);
|
||||
|
||||
|
@ -855,10 +855,10 @@ void Navigation::resolve_the_finished_promise(GC::Ref<NavigationAPIMethodTracker
|
|||
auto& realm = this->realm();
|
||||
|
||||
// 1. Assert: apiMethodTracker's committed-to entry is not null.
|
||||
VERIFY(api_method_tracker->commited_to_entry != nullptr);
|
||||
VERIFY(api_method_tracker->committed_to_entry != nullptr);
|
||||
|
||||
// 2. Resolve apiMethodTracker's finished promise with its committed-to entry.
|
||||
WebIDL::resolve_promise(realm, api_method_tracker->finished_promise, api_method_tracker->commited_to_entry);
|
||||
WebIDL::resolve_promise(realm, api_method_tracker->finished_promise, api_method_tracker->committed_to_entry);
|
||||
|
||||
// 3. Clean up apiMethodTracker.
|
||||
clean_up(api_method_tracker);
|
||||
|
@ -887,7 +887,7 @@ void Navigation::notify_about_the_committed_to_entry(GC::Ref<NavigationAPIMethod
|
|||
auto& realm = this->realm();
|
||||
|
||||
// 1. Set apiMethodTracker's committed-to entry to nhe.
|
||||
api_method_tracker->commited_to_entry = nhe;
|
||||
api_method_tracker->committed_to_entry = nhe;
|
||||
|
||||
// 2. If apiMethodTracker's serialized state is not null, then set nhe's session history entry's navigation API state to apiMethodTracker's serialized state.'
|
||||
// NOTE: If it's null, then we're traversing to nhe via navigation.traverseTo(), which does not allow changing the state.
|
||||
|
|
|
@ -52,7 +52,7 @@ struct NavigationAPIMethodTracker final : public JS::Cell {
|
|||
Optional<String> key,
|
||||
JS::Value info,
|
||||
Optional<SerializationRecord> serialized_state,
|
||||
GC::Ptr<NavigationHistoryEntry> commited_to_entry,
|
||||
GC::Ptr<NavigationHistoryEntry> committed_to_entry,
|
||||
GC::Ref<WebIDL::Promise> committed_promise,
|
||||
GC::Ref<WebIDL::Promise> finished_promise);
|
||||
|
||||
|
@ -62,7 +62,7 @@ struct NavigationAPIMethodTracker final : public JS::Cell {
|
|||
Optional<String> key;
|
||||
JS::Value info;
|
||||
Optional<SerializationRecord> serialized_state;
|
||||
GC::Ptr<NavigationHistoryEntry> commited_to_entry;
|
||||
GC::Ptr<NavigationHistoryEntry> committed_to_entry;
|
||||
GC::Ref<WebIDL::Promise> committed_promise;
|
||||
GC::Ref<WebIDL::Promise> finished_promise;
|
||||
};
|
||||
|
|
|
@ -15,21 +15,21 @@ TEST_CASE(locale_mappings_en)
|
|||
EXPECT(language.has_value());
|
||||
EXPECT_EQ(*language, "English"sv);
|
||||
|
||||
language = Unicode::language_display_name("en"sv, "i-defintely-don't-exist"sv, Unicode::LanguageDisplay::Standard);
|
||||
language = Unicode::language_display_name("en"sv, "i-definitely-don't-exist"sv, Unicode::LanguageDisplay::Standard);
|
||||
EXPECT(!language.has_value());
|
||||
|
||||
auto territory = Unicode::region_display_name("en"sv, "US"sv);
|
||||
EXPECT(territory.has_value());
|
||||
EXPECT_EQ(*territory, "United States"sv);
|
||||
|
||||
territory = Unicode::region_display_name("en"sv, "i-defintely-don't-exist"sv);
|
||||
territory = Unicode::region_display_name("en"sv, "i-definitely-don't-exist"sv);
|
||||
EXPECT(!territory.has_value());
|
||||
|
||||
auto script = Unicode::script_display_name("en"sv, "Latn"sv);
|
||||
EXPECT(script.has_value());
|
||||
EXPECT_EQ(*script, "Latin"sv);
|
||||
|
||||
script = Unicode::script_display_name("en"sv, "i-defintely-don't-exist"sv);
|
||||
script = Unicode::script_display_name("en"sv, "i-definitely-don't-exist"sv);
|
||||
EXPECT(!script.has_value());
|
||||
}
|
||||
|
||||
|
@ -39,21 +39,21 @@ TEST_CASE(locale_mappings_fr)
|
|||
EXPECT(language.has_value());
|
||||
EXPECT_EQ(*language, "anglais"sv);
|
||||
|
||||
language = Unicode::language_display_name("fr"sv, "i-defintely-don't-exist"sv, Unicode::LanguageDisplay::Standard);
|
||||
language = Unicode::language_display_name("fr"sv, "i-definitely-don't-exist"sv, Unicode::LanguageDisplay::Standard);
|
||||
EXPECT(!language.has_value());
|
||||
|
||||
auto territory = Unicode::region_display_name("fr"sv, "US"sv);
|
||||
EXPECT(territory.has_value());
|
||||
EXPECT_EQ(*territory, "États-Unis"sv);
|
||||
|
||||
territory = Unicode::region_display_name("fr"sv, "i-defintely-don't-exist"sv);
|
||||
territory = Unicode::region_display_name("fr"sv, "i-definitely-don't-exist"sv);
|
||||
EXPECT(!territory.has_value());
|
||||
|
||||
auto script = Unicode::script_display_name("fr"sv, "Latn"sv);
|
||||
EXPECT(script.has_value());
|
||||
EXPECT_EQ(*script, "latin"sv);
|
||||
|
||||
script = Unicode::script_display_name("fr"sv, "i-defintely-don't-exist"sv);
|
||||
script = Unicode::script_display_name("fr"sv, "i-definitely-don't-exist"sv);
|
||||
EXPECT(!script.has_value());
|
||||
}
|
||||
|
||||
|
@ -63,20 +63,20 @@ TEST_CASE(locale_mappings_root)
|
|||
EXPECT(language.has_value());
|
||||
EXPECT_EQ(*language, "en"sv);
|
||||
|
||||
language = Unicode::language_display_name("und"sv, "i-defintely-don't-exist"sv, Unicode::LanguageDisplay::Standard);
|
||||
language = Unicode::language_display_name("und"sv, "i-definitely-don't-exist"sv, Unicode::LanguageDisplay::Standard);
|
||||
EXPECT(!language.has_value());
|
||||
|
||||
auto territory = Unicode::region_display_name("und"sv, "US"sv);
|
||||
EXPECT(territory.has_value());
|
||||
EXPECT_EQ(*territory, "US"sv);
|
||||
|
||||
territory = Unicode::region_display_name("und"sv, "i-defintely-don't-exist"sv);
|
||||
territory = Unicode::region_display_name("und"sv, "i-definitely-don't-exist"sv);
|
||||
EXPECT(!territory.has_value());
|
||||
|
||||
auto script = Unicode::script_display_name("und"sv, "Latn"sv);
|
||||
EXPECT(script.has_value());
|
||||
EXPECT_EQ(*script, "Latn"sv);
|
||||
|
||||
script = Unicode::script_display_name("und"sv, "i-defintely-don't-exist"sv);
|
||||
script = Unicode::script_display_name("und"sv, "i-definitely-don't-exist"sv);
|
||||
EXPECT(!script.has_value());
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
beforeinput data=(r) intputType=(insertText)
|
||||
beforeinput data=(a) intputType=(insertText)
|
||||
beforeinput data=(e) intputType=(insertText)
|
||||
beforeinput data=(b) intputType=(insertText)
|
||||
beforeinput data=(e) intputType=(insertText)
|
||||
beforeinput data=(c) intputType=(insertText)
|
||||
beforeinput data=(e) intputType=(insertText)
|
||||
beforeinput data=(null) intputType=(insertParagraph)
|
||||
beforeinput data=(r) inputType=(insertText)
|
||||
beforeinput data=(a) inputType=(insertText)
|
||||
beforeinput data=(e) inputType=(insertText)
|
||||
beforeinput data=(b) inputType=(insertText)
|
||||
beforeinput data=(e) inputType=(insertText)
|
||||
beforeinput data=(c) inputType=(insertText)
|
||||
beforeinput data=(e) inputType=(insertText)
|
||||
beforeinput data=(null) inputType=(insertParagraph)
|
||||
Text in input: reee
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
input data=(h) intputType=(insertText)
|
||||
input data=(e) intputType=(insertText)
|
||||
input data=(l) intputType=(insertText)
|
||||
input data=(l) intputType=(insertText)
|
||||
input data=(o) intputType=(insertText)
|
||||
input data=(null) intputType=(insertParagraph)
|
||||
input data=(h) inputType=(insertText)
|
||||
input data=(e) inputType=(insertText)
|
||||
input data=(l) inputType=(insertText)
|
||||
input data=(l) inputType=(insertText)
|
||||
input data=(o) inputType=(insertText)
|
||||
input data=(null) inputType=(insertParagraph)
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
test(() => {
|
||||
const input = document.getElementById("input");
|
||||
input.addEventListener("beforeinput", (e) => {
|
||||
println(`beforeinput data=(${e.data}) intputType=(${e.inputType})`);
|
||||
println(`beforeinput data=(${e.data}) inputType=(${e.inputType})`);
|
||||
if (e.data !== 'r' && e.data !== 'e') {
|
||||
e.preventDefault();
|
||||
return;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
test(() => {
|
||||
const input = document.getElementById("input");
|
||||
input.addEventListener("input", (e) => {
|
||||
println(`input data=(${e.data}) intputType=(${e.inputType})`);
|
||||
println(`input data=(${e.data}) inputType=(${e.inputType})`);
|
||||
});
|
||||
internals.sendText(input, "hello");
|
||||
internals.commitText();
|
||||
|
|
Loading…
Add table
Reference in a new issue