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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 2508743002: Changed EWhiteSpace to an enum class and renamed its members to keywords (Closed)
Patch Set: Small mac fix Created 4 years, 1 month 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/style/ComputedStyle.h
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index 14cc888aeb622d8f99b86ca5243f4f686ef8a2f4..d9a69a9224130fea2efbbde109b72ef032e1c5f8 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -373,7 +373,7 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
m_inheritedData.m_hasSimpleUnderline = false;
m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor());
m_inheritedData.m_direction = initialDirection();
- m_inheritedData.m_whiteSpace = initialWhiteSpace();
+ m_inheritedData.m_whiteSpace = static_cast<unsigned>(initialWhiteSpace());
m_inheritedData.m_borderCollapse = initialBorderCollapse();
m_inheritedData.m_rtlOrdering = initialRTLOrdering();
m_inheritedData.m_boxDirection = initialBoxDirection();
@@ -2312,11 +2312,13 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
}
// white-space inherited
- static EWhiteSpace initialWhiteSpace() { return NORMAL; }
+ static EWhiteSpace initialWhiteSpace() { return EWhiteSpace::Normal; }
EWhiteSpace whiteSpace() const {
return static_cast<EWhiteSpace>(m_inheritedData.m_whiteSpace);
}
- void setWhiteSpace(EWhiteSpace v) { m_inheritedData.m_whiteSpace = v; }
+ void setWhiteSpace(EWhiteSpace v) {
+ m_inheritedData.m_whiteSpace = static_cast<unsigned>(v);
+ }
// word-break inherited (aka -epub-word-break)
static EWordBreak initialWordBreak() { return NormalWordBreak; }
@@ -3738,21 +3740,21 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
// Whitespace utility functions.
static bool autoWrap(EWhiteSpace ws) {
// Nowrap and pre don't automatically wrap.
- return ws != NOWRAP && ws != PRE;
+ return ws != EWhiteSpace::Nowrap && ws != EWhiteSpace::Pre;
}
bool autoWrap() const { return autoWrap(whiteSpace()); }
static bool preserveNewline(EWhiteSpace ws) {
// Normal and nowrap do not preserve newlines.
- return ws != NORMAL && ws != NOWRAP;
+ return ws != EWhiteSpace::Normal && ws != EWhiteSpace::Nowrap;
}
bool preserveNewline() const { return preserveNewline(whiteSpace()); }
static bool collapseWhiteSpace(EWhiteSpace ws) {
// Pre and prewrap do not collapse whitespace.
- return ws != PRE && ws != PRE_WRAP;
+ return ws != EWhiteSpace::Pre && ws != EWhiteSpace::PreWrap;
}
bool collapseWhiteSpace() const { return collapseWhiteSpace(whiteSpace()); }
@@ -3768,14 +3770,15 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
return false;
}
bool breakOnlyAfterWhiteSpace() const {
- return whiteSpace() == PRE_WRAP ||
+ return whiteSpace() == EWhiteSpace::PreWrap ||
getLineBreak() == LineBreakAfterWhiteSpace;
}
bool breakWords() const {
return (wordBreak() == BreakWordBreak ||
overflowWrap() == BreakOverflowWrap) &&
- whiteSpace() != PRE && whiteSpace() != NOWRAP;
+ whiteSpace() != EWhiteSpace::Pre &&
+ whiteSpace() != EWhiteSpace::Nowrap;
}
// Text direction utility functions.

Powered by Google App Engine
This is Rietveld 408576698