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

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

Issue 16161005: Reduce CSSProperty's StylePropertyMetadata memory footprint by half when used inside a ImmutableSty… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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/css/StylePropertySet.cpp ('k') | Source/core/css/StylePropertyShorthand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/StylePropertyShorthand.h
diff --git a/Source/core/css/StylePropertyShorthand.h b/Source/core/css/StylePropertyShorthand.h
index 5cdfec13e64dd8a13273d4d630d1b0dfb7b8630d..6992e890773a232966dee276939ddd8904acd7db 100644
--- a/Source/core/css/StylePropertyShorthand.h
+++ b/Source/core/css/StylePropertyShorthand.h
@@ -1,6 +1,7 @@
/*
* (C) 1999-2003 Lars Knoll (knoll@kde.org)
* Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -22,6 +23,7 @@
#define StylePropertyShorthand_h
#include "CSSPropertyNames.h"
+#include "wtf/Vector.h"
namespace WebCore {
@@ -32,31 +34,36 @@ public:
: m_properties(0)
, m_propertiesForInitialization(0)
, m_length(0)
+ , m_shorthandID(CSSPropertyInvalid)
{
}
- StylePropertyShorthand(const CSSPropertyID* properties, unsigned numProperties)
+ StylePropertyShorthand(CSSPropertyID id, const CSSPropertyID* properties, unsigned numProperties)
: m_properties(properties)
, m_propertiesForInitialization(0)
, m_length(numProperties)
+ , m_shorthandID(id)
{
}
- StylePropertyShorthand(const CSSPropertyID* properties, const StylePropertyShorthand** propertiesForInitialization, unsigned numProperties)
+ StylePropertyShorthand(CSSPropertyID id, const CSSPropertyID* properties, const StylePropertyShorthand** propertiesForInitialization, unsigned numProperties)
: m_properties(properties)
, m_propertiesForInitialization(propertiesForInitialization)
, m_length(numProperties)
+ , m_shorthandID(id)
{
}
const CSSPropertyID* properties() const { return m_properties; }
const StylePropertyShorthand** propertiesForInitialization() const { return m_propertiesForInitialization; }
unsigned length() const { return m_length; }
+ CSSPropertyID id() const { return m_shorthandID; }
private:
const CSSPropertyID* m_properties;
const StylePropertyShorthand** m_propertiesForInitialization;
unsigned m_length;
+ CSSPropertyID m_shorthandID;
};
const StylePropertyShorthand& backgroundShorthand();
@@ -104,9 +111,13 @@ const StylePropertyShorthand& webkitTextStrokeShorthand();
const StylePropertyShorthand& webkitTransitionShorthand();
const StylePropertyShorthand& webkitTransformOriginShorthand();
-// Returns an empty list if the property is not a shorthand
+// Returns an empty list if the property is not a shorthand.
const StylePropertyShorthand& shorthandForProperty(CSSPropertyID);
+// Return the list of shorthands for a given longhand.
+const Vector<StylePropertyShorthand> matchingShorthandsForLonghand(CSSPropertyID);
+unsigned indexOfShorthandForLonghand(CSSPropertyID, const Vector<StylePropertyShorthand>&);
+
bool isExpandedShorthand(CSSPropertyID);
} // namespace WebCore
« no previous file with comments | « Source/core/css/StylePropertySet.cpp ('k') | Source/core/css/StylePropertyShorthand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698