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

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

Issue 2687243002: Rename the methods in EditingStyleUtilities class and make them used in editing (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditingStyleUtilities.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/EditingStyle.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingStyle.cpp b/third_party/WebKit/Source/core/editing/EditingStyle.cpp
index 06d63b05c640061024fabd0192ae1dc5a499dc62..7ec4bbcac104dd37a26ee592e489017e8fb99027 100644
--- a/third_party/WebKit/Source/core/editing/EditingStyle.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingStyle.cpp
@@ -48,6 +48,7 @@
#include "core/dom/NodeComputedStyle.h"
#include "core/dom/NodeTraversal.h"
#include "core/dom/QualifiedName.h"
+#include "core/editing/EditingStyleUtilities.h"
#include "core/editing/EditingUtilities.h"
#include "core/editing/Editor.h"
#include "core/editing/FrameSelection.h"
@@ -433,7 +434,8 @@ static inline Color getBackgroundColor(StylePropertySet* style) {
}
static inline Color backgroundColorInEffect(Node* node) {
- return cssValueToColor(backgroundColorValueInEffect(node));
+ return cssValueToColor(
+ EditingStyleUtilities::backgroundColorValueInEffect(node));
}
static int textAlignResolvingStartAndEnd(int textAlign, int direction) {
@@ -478,7 +480,8 @@ void EditingStyle::init(Node* node, PropertiesToInclude propertiesToInclude) {
: editingStyleFromComputedStyle(computedStyleAtPosition);
if (propertiesToInclude == EditingPropertiesInEffect) {
- if (const CSSValue* value = backgroundColorValueInEffect(node))
+ if (const CSSValue* value =
+ EditingStyleUtilities::backgroundColorValueInEffect(node))
m_mutableStyle->setProperty(CSSPropertyBackgroundColor, value->cssText());
if (const CSSValue* value = computedStyleAtPosition->getPropertyCSSValue(
CSSPropertyWebkitTextDecorationsInEffect))
@@ -571,7 +574,7 @@ bool EditingStyle::textDirection(WritingDirection& writingDirection) const {
return false;
CSSValueID unicodeBidiValue = toCSSIdentifierValue(unicodeBidi)->getValueID();
- if (isEmbedOrIsolate(unicodeBidiValue)) {
+ if (EditingStyleUtilities::isEmbedOrIsolate(unicodeBidiValue)) {
const CSSValue* direction =
m_mutableStyle->getPropertyCSSValue(CSSPropertyDirection);
if (!direction || !direction->isIdentifierValue())
@@ -789,8 +792,10 @@ TriState EditingStyle::triStateOfStyle(
if (selection.isNone())
return FalseTriState;
- if (selection.isCaret())
- return triStateOfStyle(EditingStyle::styleAtSelectionStart(selection));
+ if (selection.isCaret()) {
+ return triStateOfStyle(
+ EditingStyleUtilities::createStyleAtSelectionStart(selection));
+ }
TriState state = FalseTriState;
bool nodeIsStart = true;
@@ -808,7 +813,8 @@ TriState EditingStyle::triStateOfStyle(
CSSValueBaseline) {
const CSSIdentifierValue* verticalAlign = toCSSIdentifierValue(
m_mutableStyle->getPropertyCSSValue(CSSPropertyVerticalAlign));
- if (hasAncestorVerticalAlignStyle(node, verticalAlign->getValueID()))
+ if (EditingStyleUtilities::hasAncestorVerticalAlignStyle(
+ node, verticalAlign->getValueID()))
node.mutableComputedStyle()->setVerticalAlign(
verticalAlign->convertTo<EVerticalAlign>());
}
@@ -1131,7 +1137,8 @@ void EditingStyle::prepareToApplyAt(
if (getFontColor(m_mutableStyle.get()) == getFontColor(styleAtPosition))
m_mutableStyle->removeProperty(CSSPropertyColor);
- if (hasTransparentBackgroundColor(m_mutableStyle.get()) ||
+ if (EditingStyleUtilities::hasTransparentBackgroundColor(
+ m_mutableStyle.get()) ||
cssValueToColor(
m_mutableStyle->getPropertyCSSValue(CSSPropertyBackgroundColor)) ==
backgroundColorInEffect(position.computeContainerNode()))
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditingStyleUtilities.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698