mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibWeb: Fix regression of "contenteditable" attribute
This commit is contained in:
parent
95331ea864
commit
08359ba578
Notes:
sideshowbarker
2024-07-18 07:40:57 +09:00
Author: https://github.com/SeekingBlues Commit: https://github.com/SerenityOS/serenity/commit/08359ba578d Pull-request: https://github.com/SerenityOS/serenity/pull/9125 Reviewed-by: https://github.com/awesomekling
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html contenteditable="true">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Welcome!</title>
|
||||
|
@ -34,12 +34,12 @@ HTMLElement::ContentEditableState HTMLElement::content_editable_state() const
|
||||
{
|
||||
auto contenteditable = attribute(HTML::AttributeNames::contenteditable);
|
||||
// "true", an empty string or a missing value map to the "true" state.
|
||||
if (contenteditable.is_empty() || contenteditable.equals_ignoring_case("true"))
|
||||
if ((!contenteditable.is_null() && contenteditable.is_empty()) || contenteditable.equals_ignoring_case("true"))
|
||||
return ContentEditableState::True;
|
||||
// "false" maps to the "false" state.
|
||||
if (contenteditable.equals_ignoring_case("false"))
|
||||
return ContentEditableState::False;
|
||||
// An invalid value maps to the "inherit" state.
|
||||
// Having no such attribute or an invalid value maps to the "inherit" state.
|
||||
return ContentEditableState::Inherit;
|
||||
}
|
||||
|
||||
|
@ -40,9 +40,9 @@ public:
|
||||
|
||||
struct Attribute {
|
||||
String prefix;
|
||||
String local_name;
|
||||
String local_name { "" };
|
||||
String namespace_;
|
||||
String value;
|
||||
String value { "" };
|
||||
Position name_start_position;
|
||||
Position value_start_position;
|
||||
Position name_end_position;
|
||||
|
Loading…
Reference in New Issue
Block a user