Index: Source/core/html/HTMLElement.cpp |
diff --git a/Source/core/html/HTMLElement.cpp b/Source/core/html/HTMLElement.cpp |
index 79c7fa1955ea9e3cc27646c6989a28a0f7526df3..a4be1d4b9476077ceb7694ee0f42e4aa93d18c5f 100644 |
--- a/Source/core/html/HTMLElement.cpp |
+++ b/Source/core/html/HTMLElement.cpp |
@@ -929,6 +929,26 @@ void HTMLElement::defaultEventHandler(Event* event) |
Element::defaultEventHandler(event); |
} |
+bool HTMLElement::matchesReadOnlyPseudoClass() const |
+{ |
+ return !matchesReadWritePseudoClass(); |
+} |
+ |
+bool HTMLElement::matchesReadWritePseudoClass() const |
+{ |
+ if (fastHasAttribute(contenteditableAttr)) { |
+ const AtomicString& value = fastGetAttribute(contenteditableAttr); |
+ |
+ if (value.isEmpty() || equalIgnoringCase(value, "true") || equalIgnoringCase(value, "plaintext-only")) |
+ return true; |
+ if (equalIgnoringCase(value, "false")) |
+ return false; |
+ // All other values should be treated as "inherit". |
+ } |
+ |
+ return parentElement() && parentElement()->rendererIsEditable(); |
+} |
+ |
void HTMLElement::handleKeypressEvent(KeyboardEvent* event) |
{ |
if (!document().settings() || !document().settings()->spatialNavigationEnabled() || !supportsFocus()) |