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

Unified Diff: third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp

Issue 2669213002: Remove spelling markers in disabled and readonly form elements
Patch Set: Using idle task to remove the markers Created 3 years, 10 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
Index: third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
index b46e742c2e33dbb443ce2d3856c22bb16242dc8d..87f42e6cbf9014d3b0bcde3fab18ccf1790a03fb 100644
--- a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
@@ -5,9 +5,11 @@
#include "core/paint/InlineTextBoxPainter.h"
#include "core/editing/CompositionUnderline.h"
+#include "core/editing/EditingUtilities.h"
#include "core/editing/Editor.h"
#include "core/editing/markers/DocumentMarkerController.h"
#include "core/frame/LocalFrame.h"
+#include "core/html/HTMLFormControlElement.h"
#include "core/layout/LayoutTextCombine.h"
#include "core/layout/LayoutTheme.h"
#include "core/layout/api/LineLayoutAPIShim.h"
@@ -801,7 +803,13 @@ void InlineTextBoxPainter::paintDocumentMarkers(
const ComputedStyle& style,
const Font& font,
DocumentMarkerPaintPhase markerPaintPhase) {
- if (!m_inlineTextBox.getLineLayoutItem().node())
+ const Node* node = m_inlineTextBox.getLineLayoutItem().node();
+ if (!node)
+ return;
+
+ if (!hasEditableStyle(*node) &&
Xiaocheng 2017/03/03 18:24:06 This breaks the rendering of non-spelling markers,
+ (!isHTMLFormControlElement(*node) ||
+ toHTMLFormControlElement(*node).isDisabledOrReadOnly()))
return;
DCHECK(m_inlineTextBox.truncation() != cFullTruncation);

Powered by Google App Engine
This is Rietveld 408576698