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

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

Issue 1033943002: Rename LayoutStyle to papayawhip (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ensureComputedStyle Created 5 years, 9 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 | « Source/core/editing/EditingStyle.h ('k') | Source/core/editing/EditorCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/EditingStyle.cpp
diff --git a/Source/core/editing/EditingStyle.cpp b/Source/core/editing/EditingStyle.cpp
index d59c235b8b16d3e15b866e94eb06da8f11f26de6..6491644a6e70facfb3056669e9d6fb37869832d7 100644
--- a/Source/core/editing/EditingStyle.cpp
+++ b/Source/core/editing/EditingStyle.cpp
@@ -56,7 +56,7 @@
#include "core/html/HTMLSpanElement.h"
#include "core/layout/LayoutBox.h"
#include "core/layout/LayoutObject.h"
-#include "core/layout/style/LayoutStyle.h"
+#include "core/layout/style/ComputedStyle.h"
namespace blink {
@@ -471,24 +471,24 @@ void EditingStyle::init(Node* node, PropertiesToInclude propertiesToInclude)
m_mutableStyle->setProperty(CSSPropertyTextDecoration, value->cssText());
}
- if (node && node->computedStyle()) {
- const LayoutStyle* layoutStyle = node->computedStyle();
- removeTextFillAndStrokeColorsIfNeeded(layoutStyle);
- replaceFontSizeByKeywordIfPossible(layoutStyle, computedStyleAtPosition.get());
+ if (node && node->ensureComputedStyle()) {
+ const ComputedStyle* computedStyle = node->ensureComputedStyle();
+ removeTextFillAndStrokeColorsIfNeeded(computedStyle);
+ replaceFontSizeByKeywordIfPossible(computedStyle, computedStyleAtPosition.get());
}
m_fixedPitchFontType = computedStyleAtPosition->fixedPitchFontType();
extractFontSizeDelta();
}
-void EditingStyle::removeTextFillAndStrokeColorsIfNeeded(const LayoutStyle* layoutStyle)
+void EditingStyle::removeTextFillAndStrokeColorsIfNeeded(const ComputedStyle* computedStyle)
{
// If a node's text fill color is currentColor, then its children use
// their font-color as their text fill color (they don't
// inherit it). Likewise for stroke color.
- if (layoutStyle->textFillColor().isCurrentColor())
+ if (computedStyle->textFillColor().isCurrentColor())
m_mutableStyle->removeProperty(CSSPropertyWebkitTextFillColor);
- if (layoutStyle->textStrokeColor().isCurrentColor())
+ if (computedStyle->textStrokeColor().isCurrentColor())
m_mutableStyle->removeProperty(CSSPropertyWebkitTextStrokeColor);
}
@@ -500,11 +500,11 @@ void EditingStyle::setProperty(CSSPropertyID propertyID, const String& value, bo
m_mutableStyle->setProperty(propertyID, value, important);
}
-void EditingStyle::replaceFontSizeByKeywordIfPossible(const LayoutStyle* layoutStyle, CSSComputedStyleDeclaration* computedStyle)
+void EditingStyle::replaceFontSizeByKeywordIfPossible(const ComputedStyle* computedStyle, CSSComputedStyleDeclaration* cssComputedStyle)
{
- ASSERT(layoutStyle);
- if (layoutStyle->fontDescription().keywordSize())
- m_mutableStyle->setProperty(CSSPropertyFontSize, computedStyle->getFontSizeCSSValuePreferringKeyword()->cssText());
+ ASSERT(computedStyle);
+ if (computedStyle->fontDescription().keywordSize())
+ m_mutableStyle->setProperty(CSSPropertyFontSize, cssComputedStyle->getFontSizeCSSValuePreferringKeyword()->cssText());
}
void EditingStyle::extractFontSizeDelta()
@@ -1428,7 +1428,7 @@ StyleChange::StyleChange(EditingStyle* style, const Position& position)
if (!style || !style->style() || !document || !document->frame() || !position.element())
return;
- RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyle = position.computedStyle();
+ RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyle = position.ensureComputedStyle();
// FIXME: take care of background-color in effect
RefPtrWillBeRawPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotIn(style->style(), computedStyle.get());
ASSERT(mutableStyle);
« no previous file with comments | « Source/core/editing/EditingStyle.h ('k') | Source/core/editing/EditorCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698