summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorTheFightingCatfish <seekingblues@gmail.com>2021-07-31 18:14:58 +0800
committerAndreas Kling <kling@serenityos.org>2021-07-31 17:39:28 +0200
commit08359ba578d1de6f25dcb4e2b55783ab6067fea9 (patch)
treec3890ae65769d9eec89043ab216a4592cf689e11 /Userland/Libraries/LibWeb
parent95331ea86475d2d2131ef42e8bf9f07803425676 (diff)
downloadserenity-08359ba578d1de6f25dcb4e2b55783ab6067fea9.zip
LibWeb: Fix regression of "contenteditable" attribute
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLElement.cpp4
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
index c3144b5649..c6d5ba6205 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
@@ -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;
}
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h
index 0b5ec1edf1..19077fb367 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h
+++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h
@@ -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;