LibWeb: Fix typos - act II

This commit is contained in:
Viktor Szépe 2025-04-07 10:46:22 +00:00 committed by Sam Atkins
parent 86be8abfbf
commit 5cc371d54c
Notes: github-actions[bot] 2025-04-09 14:06:24 +00:00
30 changed files with 69 additions and 69 deletions

View file

@ -81,7 +81,7 @@ void CanvasPath::bezier_curve_to(double cp1x, double cp1y, double cp2x, double c
// 2. Ensure there is a subpath for (cp1x, cp1y)
ensure_subpath(cp1x, cp1y);
// 3. Connect the last point in the subpath to the given point (x, y) using a cubic Bézier curve with control poits (cp1x, cp1y) and (cp2x, cp2y).
// 3. Connect the last point in the subpath to the given point (x, y) using a cubic Bézier curve with control points (cp1x, cp1y) and (cp2x, cp2y).
// 4. Add the point (x, y) to the subpath.
m_path.cubic_bezier_curve_to(
Gfx::FloatPoint { cp1x, cp1y }, Gfx::FloatPoint { cp2x, cp2y }, Gfx::FloatPoint { x, y });

View file

@ -263,10 +263,10 @@ Gfx::Path CanvasRenderingContext2D::text_path(StringView text, float x, float y,
}
// Apply text baseline
// FIXME: Implement CanvasTextBasline::Hanging, Bindings::CanvasTextAlign::Alphabetic and Bindings::CanvasTextAlign::Ideographic for real
// FIXME: Implement CanvasTextBaseline::Hanging, Bindings::CanvasTextAlign::Alphabetic and Bindings::CanvasTextAlign::Ideographic for real
// right now they are just handled as textBaseline = top or bottom.
// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-textbaseline-hanging
// Default baseline of draw_text is top so do nothing by CanvasTextBaseline::Top and CanvasTextBasline::Hanging
// Default baseline of draw_text is top so do nothing by CanvasTextBaseline::Top and CanvasTextBaseline::Hanging
if (drawing_state.text_baseline == Bindings::CanvasTextBaseline::Middle) {
transform = Gfx::AffineTransform {}.set_translation({ 0, font->pixel_size() / 2 }).multiply(transform);
}

View file

@ -1121,7 +1121,7 @@ WebIDL::ExceptionOr<bool> HTMLElement::check_popover_validity(ExpectedToBeShowin
// - ignoreDomState is false and element is not connected;
// - element's node document is not fully active;
// - ignoreDomState is false and expectedDocument is not null and element's node document is not expectedDocument;
// - element is a dialog element and its is modal flage is set to true; or
// - element is a dialog element and its is modal flag is set to true; or
// - FIXME: element's fullscreen flag is set,
// then:
// 3.1 If throwExceptions is true, then throw an "InvalidStateError" DOMException.

View file

@ -145,7 +145,7 @@ void HTMLInputElement::adjust_computed_style(CSS::ComputedProperties& style)
style.set_property(CSS::PropertyID::Width, CSS::LengthStyleValue::create(CSS::Length(size(), CSS::Length::Type::Ch)));
}
// NOTE: The following line-height check is done for web compatability and usability reasons.
// NOTE: The following line-height check is done for web compatibility and usability reasons.
// FIXME: The "normal" line-height value should be calculated but assume 1.0 for now.
double normal_line_height = 1.0;
double current_line_height = style.line_height().to_double();
@ -2404,7 +2404,7 @@ WebIDL::ExceptionOr<GC::Ptr<JS::Date>> HTMLInputElement::convert_string_to_date(
}
// https://html.spec.whatwg.org/multipage/input.html#concept-input-value-date-string
String HTMLInputElement::covert_date_to_string(GC::Ref<JS::Date> input) const
String HTMLInputElement::convert_date_to_string(GC::Ref<JS::Date> input) const
{
// https://html.spec.whatwg.org/multipage/input.html#date-state-(type=date):concept-input-value-date-string
if (type_state() == TypeAttributeState::Date) {
@ -2420,7 +2420,7 @@ String HTMLInputElement::covert_date_to_string(GC::Ref<JS::Date> input) const
return convert_number_to_time_string(input->date_value());
}
dbgln("HTMLInputElement::covert_date_to_string() not implemented for input type {}", type());
dbgln("HTMLInputElement::convert_date_to_string() not implemented for input type {}", type());
return {};
}
@ -2589,7 +2589,7 @@ WebIDL::ExceptionOr<void> HTMLInputElement::set_value_as_date(Optional<GC::Root<
}
// otherwise, run the algorithm to convert a Date object to a string, as defined for that state, on the new value, and set the value of the element to the resulting string.
TRY(set_value(covert_date_to_string(date)));
TRY(set_value(convert_date_to_string(date)));
return {};
}

View file

@ -289,7 +289,7 @@ private:
String convert_number_to_string(double input) const;
WebIDL::ExceptionOr<GC::Ptr<JS::Date>> convert_string_to_date(StringView input) const;
String covert_date_to_string(GC::Ref<JS::Date> input) const;
String convert_date_to_string(GC::Ref<JS::Date> input) const;
Optional<double> min() const;
Optional<double> max() const;

View file

@ -637,11 +637,11 @@ public:
{
// 2. ⌛ Process candidate: If candidate does not have a src attribute, or if its src attribute's value is the
// empty string, then end the synchronous section, and jump down to the failed with elements step below.
String candiate_src;
String candidate_src;
if (auto maybe_src = m_candidate->get_attribute(HTML::AttributeNames::src); maybe_src.has_value())
candiate_src = *maybe_src;
candidate_src = *maybe_src;
if (candiate_src.is_empty()) {
if (candidate_src.is_empty()) {
TRY(failed_with_elements());
return {};
}
@ -649,7 +649,7 @@ public:
// 3. ⌛ Let urlString and urlRecord be the resulting URL string and the resulting URL record, respectively, that
// would have resulted from parsing the URL specified by candidate's src attribute's value relative to the
// candidate's node document when the src attribute was last changed.
auto url_record = m_candidate->document().parse_url(candiate_src);
auto url_record = m_candidate->document().parse_url(candidate_src);
// 4. ⌛ If urlString was not obtained successfully, then end the synchronous section, and jump down to the failed
// with elements step below.

View file

@ -103,7 +103,7 @@ WebIDL::ExceptionOr<void> NavigateEvent::intercept(NavigationInterceptOptions co
if (m_focus_reset_behavior.has_value() && *m_focus_reset_behavior != *options.focus_reset) {
auto& console = realm.intrinsics().console_object()->console();
console.output_debug_message(JS::Console::LogLevel::Warn,
TRY_OR_THROW_OOM(vm, String::formatted("focusReset behavior on NavigationEvent overriden (was: {}, now: {})", *m_focus_reset_behavior, *options.focus_reset)));
TRY_OR_THROW_OOM(vm, String::formatted("focusReset behavior on NavigationEvent overridden (was: {}, now: {})", *m_focus_reset_behavior, *options.focus_reset)));
}
// 2. Set this's focus reset behavior to options["focusReset"].
@ -118,7 +118,7 @@ WebIDL::ExceptionOr<void> NavigateEvent::intercept(NavigationInterceptOptions co
if (m_scroll_behavior.has_value() && *m_scroll_behavior != *options.scroll) {
auto& console = realm.intrinsics().console_object()->console();
console.output_debug_message(JS::Console::LogLevel::Warn,
TRY_OR_THROW_OOM(vm, String::formatted("scroll option on NavigationEvent overriden (was: {}, now: {})", *m_scroll_behavior, *options.scroll)));
TRY_OR_THROW_OOM(vm, String::formatted("scroll option on NavigationEvent overridden (was: {}, now: {})", *m_scroll_behavior, *options.scroll)));
}
// 2. Set this's scroll behavior to options["scroll"].

View file

@ -18,7 +18,7 @@ public:
WebIDL::Double device_memory() const
{
// The value is calculated by using the actual device memory in MiB then rounding it to the
// nearest number where only the most signicant bit can be set and the rest are zeros
// nearest number where only the most significant bit can be set and the rest are zeros
// (nearest power of two).
auto memory_in_bytes = Core::System::physical_memory_bytes();
auto memory_in_mib = memory_in_bytes / MiB;

View file

@ -658,7 +658,7 @@ WebIDL::ExceptionOr<void> serialize_viewed_array_buffer(JS::VM& vm, Vector<u32>&
auto buffer_serialized = TRY(structured_serialize_internal(vm, buffer, for_storage, memory));
// 4. Assert: bufferSerialized.[[Type]] is "ArrayBuffer", "ResizableArrayBuffer", "SharedArrayBuffer", or "GrowableSharedArrayBuffer".
// NOTE: Object reference + memory check is required when ArrayBuffer is transfered.
// NOTE: Object reference + memory check is required when ArrayBuffer is transferred.
auto tag = buffer_serialized[0];
VERIFY(tag == ValueTag::ArrayBuffer
|| tag == ValueTag::ResizeableArrayBuffer