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

Unified Diff: Source/core/css/CSSPrimitiveValue.h

Issue 1316153003: Removed m_isQuirkValue and used CSSPrimitiveValue::QuirkyEms instead (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: g clt Created 5 years, 3 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 | Source/core/css/CSSPrimitiveValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSPrimitiveValue.h
diff --git a/Source/core/css/CSSPrimitiveValue.h b/Source/core/css/CSSPrimitiveValue.h
index e17640e80ff619559fb69865c03262298119d478..2e04de4259675d3ec0172b7126ef6b2bc8468d31 100644
--- a/Source/core/css/CSSPrimitiveValue.h
+++ b/Source/core/css/CSSPrimitiveValue.h
@@ -108,6 +108,12 @@ public:
String,
PropertyID,
ValueID,
+
+ // This value is used to handle quirky margins in reflow roots (body, td, and th) like WinIE.
+ // The basic idea is that a stylesheet can use the value __qem (for quirky em) instead of em.
+ // When the quirky value is used, if you're in quirks mode, the margin will collapse away
+ // inside a table cell. This quirk is specified in the HTML spec but our impl is different.
+ // TODO: Remove this. crbug.com/443952
QuirkyEms,
};
@@ -160,16 +166,18 @@ public:
bool isCustomIdent() const { return type() == UnitType::CustomIdentifier; }
bool isFontRelativeLength() const
{
- return type() == UnitType::Ems
+ return type() == UnitType::QuirkyEms
+ || type() == UnitType::Ems
|| type() == UnitType::Exs
|| type() == UnitType::Rems
|| type() == UnitType::Chs;
}
+ bool isQuirkyEms() const { return type() == UnitType::QuirkyEms; }
bool isViewportPercentageLength() const { return isViewportPercentageLength(type()); }
static bool isViewportPercentageLength(UnitType type) { return type >= UnitType::ViewportWidth && type <= UnitType::ViewportMax; }
static bool isLength(UnitType type)
{
- return (type >= UnitType::Ems && type <= UnitType::Picas) || type == UnitType::Rems || type == UnitType::Chs || isViewportPercentageLength(type);
+ return (type >= UnitType::Ems && type <= UnitType::Picas) || type == UnitType::QuirkyEms || type == UnitType::Rems || type == UnitType::Chs || isViewportPercentageLength(type);
}
bool isLength() const { return isLength(typeWithCalcResolved()); }
bool isNumber() const { return typeWithCalcResolved() == UnitType::Number || typeWithCalcResolved() == UnitType::Integer; }
@@ -221,17 +229,6 @@ public:
return adoptRefWillBeNoop(new CSSPrimitiveValue(value));
}
- // This value is used to handle quirky margins in reflow roots (body, td, and th) like WinIE.
- // The basic idea is that a stylesheet can use the value __qem (for quirky em) instead of em.
- // When the quirky value is used, if you're in quirks mode, the margin will collapse away
- // inside a table cell.
- static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createAllowingMarginQuirk(double value, UnitType type)
- {
- CSSPrimitiveValue* quirkValue = new CSSPrimitiveValue(value, type);
- quirkValue->m_isQuirkValue = true;
- return adoptRefWillBeNoop(quirkValue);
- }
-
~CSSPrimitiveValue();
void cleanup();
@@ -266,8 +263,6 @@ public:
static const char* unitTypeToString(UnitType);
String customCSSText() const;
- bool isQuirkValue() const { return m_isQuirkValue; }
-
bool equals(const CSSPrimitiveValue&) const;
DECLARE_TRACE_AFTER_DISPATCH();
« no previous file with comments | « no previous file | Source/core/css/CSSPrimitiveValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698