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

Unified Diff: third_party/WebKit/Source/core/editing/SelectionController.cpp

Issue 2171493003: [Editing][DOM][CodeHealth] Make Node::hasEditableStyle global functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/editing/SelectionController.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp
index 2278ead918f8a85157197f8c055510e3153ff41c..c1e68547039fc4ca718dc6907479a62c9c002b67 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -323,7 +323,7 @@ void SelectionController::selectClosestWordFromHitTestResult(const HitTestResult
// If node doesn't have text except space, tab or line break, do not
// select that 'empty' area.
EphemeralRangeInFlatTree range(newSelection.start(), newSelection.end());
- const String& str = plainText(range, innerNode->hasEditableStyle() ? TextIteratorEmitsObjectReplacementCharacter : TextIteratorDefaultBehavior);
+ const String& str = plainText(range, hasEditableStyle(*innerNode) ? TextIteratorEmitsObjectReplacementCharacter : TextIteratorDefaultBehavior);
if (str.isEmpty() || str.simplifyWhiteSpace().containsOnlyWhitespace())
return;
@@ -522,7 +522,7 @@ bool SelectionController::handleMouseReleaseEvent(const MouseEventWithHitTestRes
VisibleSelectionInFlatTree newSelection;
Node* node = event.innerNode();
bool caretBrowsing = m_frame->settings() && m_frame->settings()->caretBrowsingEnabled();
- if (node && node->layoutObject() && (caretBrowsing || node->hasEditableStyle())) {
+ if (node && node->layoutObject() && (caretBrowsing || hasEditableStyle(*node))) {
const VisiblePositionInFlatTree pos = visiblePositionOfHitTestResult(event.hitTestResult());
newSelection = VisibleSelectionInFlatTree(pos);
}

Powered by Google App Engine
This is Rietveld 408576698