summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorSeekingBlues <51911626+SeekingBlues@users.noreply.github.com>2021-07-28 22:07:58 +0800
committerAndreas Kling <kling@serenityos.org>2021-07-28 23:47:58 +0200
commita13a5315a5bb3fd8509283480001f295e67caa57 (patch)
treeca920e163aa53cb28ca71841a1940daa4ef0818e /Userland/Libraries/LibWeb
parent3cfb1787b82345491ec49c376c179f3258d7aa0e (diff)
downloadserenity-a13a5315a5bb3fd8509283480001f295e67caa57.zip
LibWeb: Fix incompatibility of attribute "contenteditable"
The previous behavior of mapping a missing value to the "inherit" state is incompatible. Now, a missing value maps to the "true" state, which is the expected behavior.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLElement.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
index 599515d41f..c3144b5649 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
@@ -33,13 +33,13 @@ HTMLElement::~HTMLElement()
HTMLElement::ContentEditableState HTMLElement::content_editable_state() const
{
auto contenteditable = attribute(HTML::AttributeNames::contenteditable);
- // "true" and the empty string map to the "true" state.
- if ((!contenteditable.is_null() && contenteditable.is_empty()) || contenteditable.equals_ignoring_case("true"))
+ // "true", an empty string or a missing value map to the "true" state.
+ if (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;
- // "inherit", an invalid value, and a missing value all map to the "inherit" state.
+ // An invalid value maps to the "inherit" state.
return ContentEditableState::Inherit;
}