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

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

Issue 2628943009: Introduce EditingStyleUtilities.{cpp,h} (Closed)
Patch Set: add STATIC_ONLY Created 3 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
Index: third_party/WebKit/Source/core/editing/Editor.cpp
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp
index 811144a416ed2cd759e9481cb96c5f0c51d9be2a..d3aa0653c169fdb294bb5e3276fa97b2ac31557e 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -41,6 +41,7 @@
#include "core/dom/NodeTraversal.h"
#include "core/dom/ParserContentPolicy.h"
#include "core/dom/Text.h"
+#include "core/editing/EditingStyleUtilities.h"
#include "core/editing/EditingUtilities.h"
#include "core/editing/InputMethodController.h"
#include "core/editing/RenderedPosition.h"
@@ -795,9 +796,10 @@ void Editor::applyParagraphStyleToSelection(StylePropertySet* style,
bool Editor::selectionStartHasStyle(CSSPropertyID propertyID,
const String& value) const {
EditingStyle* styleToCheck = EditingStyle::create(propertyID, value);
- EditingStyle* styleAtStart = EditingStyle::styleAtSelectionStart(
- frame().selection().selection(), propertyID == CSSPropertyBackgroundColor,
- styleToCheck->style());
+ EditingStyle* styleAtStart =
+ EditingStyleUtilities::createStyleAtSelectionStart(
+ frame().selection().selection(),
+ propertyID == CSSPropertyBackgroundColor, styleToCheck->style());
return styleToCheck->triStateOfStyle(styleAtStart);
}
@@ -808,9 +810,10 @@ TriState Editor::selectionHasStyle(CSSPropertyID propertyID,
}
String Editor::selectionStartCSSPropertyValue(CSSPropertyID propertyID) {
- EditingStyle* selectionStyle = EditingStyle::styleAtSelectionStart(
- frame().selection().selection(),
- propertyID == CSSPropertyBackgroundColor);
+ EditingStyle* selectionStyle =
+ EditingStyleUtilities::createStyleAtSelectionStart(
+ frame().selection().selection(),
+ propertyID == CSSPropertyBackgroundColor);
if (!selectionStyle || !selectionStyle->style())
return String();

Powered by Google App Engine
This is Rietveld 408576698