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

Unified Diff: Source/core/rendering/HitTestResult.cpp

Issue 246203004: Fixed unnecessary Paste Popup showing issue when long press on ReadOnly/Disabled elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed the typo in Layout test. Created 6 years, 2 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 | « LayoutTests/editing/selection/readonly-disabled-hittest-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/HitTestResult.cpp
diff --git a/Source/core/rendering/HitTestResult.cpp b/Source/core/rendering/HitTestResult.cpp
index cf5316427df867774fbe854bff10e323791591f5..2e112287ed8d5d3050c65a42f7bf6c225216acbf 100644
--- a/Source/core/rendering/HitTestResult.cpp
+++ b/Source/core/rendering/HitTestResult.cpp
@@ -33,6 +33,7 @@
#include "core/html/HTMLImageElement.h"
#include "core/html/HTMLInputElement.h"
#include "core/html/HTMLMediaElement.h"
+#include "core/html/HTMLTextAreaElement.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/page/FrameTree.h"
#include "core/rendering/RenderImage.h"
@@ -371,10 +372,12 @@ bool HitTestResult::isContentEditable() const
return false;
if (isHTMLTextAreaElement(*m_innerNonSharedNode))
- return true;
+ return !toHTMLTextAreaElement(*m_innerNonSharedNode).isDisabledOrReadOnly();
- if (isHTMLInputElement(*m_innerNonSharedNode))
- return toHTMLInputElement(*m_innerNonSharedNode).isTextField();
+ if (isHTMLInputElement(*m_innerNonSharedNode)) {
+ HTMLInputElement& inputElement = toHTMLInputElement(*m_innerNonSharedNode);
+ return !inputElement.isDisabledOrReadOnly() && inputElement.isTextField();
+ }
return m_innerNonSharedNode->hasEditableStyle();
}
« no previous file with comments | « LayoutTests/editing/selection/readonly-disabled-hittest-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698