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

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

Issue 2838513002: DO NOT LAND. Revert of https://codereview.chromium.org/2797963002 (Closed)
Patch Set: Created 3 years, 8 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/style/ComputedStyle.h
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index 840807efafc28841032b7312a96c91a507dffabf..10b4d7b92000f500531fc0eb25548b22ebec2c48 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -200,6 +200,20 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
DataRef<SVGComputedStyle> svg_style_;
+ // !START SYNC!: Keep this in sync with the copy constructor in
+ // ComputedStyle.cpp.
+
+ // don't inherit
+ struct NonInheritedData {
+ NonInheritedData() : m_hasRemUnits(false), m_hasViewportUnits(false) {}
+
+ // These are set if we used viewport or rem units when resolving a length.
+ unsigned m_hasRemUnits : 1;
+ unsigned m_hasViewportUnits : 1;
+ } m_nonInheritedData;
+
+ // !END SYNC!
+
private:
// TODO(sashab): Move these private members to the bottom of ComputedStyle.
ALWAYS_INLINE ComputedStyle();
@@ -2305,6 +2319,19 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
void AddCallbackSelector(const String& selector);
// Non-property flags.
+ bool HasViewportUnits() const {
+ return m_nonInheritedData.m_hasViewportUnits;
+ }
+ // TODO(shend): This function should take no arguments.
+ void SetHasViewportUnits(bool hasViewportUnits) {
+ m_nonInheritedData.m_hasViewportUnits = hasViewportUnits;
+ }
+
+ bool HasRemUnits() const { return m_nonInheritedData.m_hasRemUnits; }
+ void SetHasRemUnits() {
+ m_nonInheritedData.m_hasRemUnits = static_cast<unsigned>(true);
+ }
+
bool EmptyState() const { return EmptyStateInternal(); }
void SetEmptyState(bool b) {
SetUnique();

Powered by Google App Engine
This is Rietveld 408576698