Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(611)

Unified Diff: Source/core/html/HTMLElement.cpp

Issue 148223004: Improve support for :read-only and :read-write pseudoclasses. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLElement.h ('k') | Source/core/rendering/RenderTheme.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLElement.cpp
diff --git a/Source/core/html/HTMLElement.cpp b/Source/core/html/HTMLElement.cpp
index 51b0a8cf0bf2415e0a3bd0a0dcc0aff9b9e2e3f6..f617e6a623d1c7f23ee87ddc66d8cab5f77593f9 100644
--- a/Source/core/html/HTMLElement.cpp
+++ b/Source/core/html/HTMLElement.cpp
@@ -970,6 +970,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 rendererIsEditable();
rune 2014/01/27 12:36:44 rendererIsEditable() says that it should have an a
andersr 2014/01/30 12:27:59 Yes, you are right, of course. Checking the paren
+}
+
void HTMLElement::handleKeypressEvent(KeyboardEvent* event)
{
if (!document().settings() || !document().settings()->spatialNavigationEnabled() || !supportsFocus())
« no previous file with comments | « Source/core/html/HTMLElement.h ('k') | Source/core/rendering/RenderTheme.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698