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

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

Issue 2755053002: Generate the storage of pseudoBits and styleType in ComputedStyleBase. (Closed)
Patch Set: Rebase Created 3 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
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 7ec9c51f4b883e324eb9c95b7648f71c4b11c2e2..65afdcc7dd31586aaeda91eb2474fe57d64b08bf 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -233,8 +233,6 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
m_originalDisplay(static_cast<unsigned>(initialDisplay())),
m_verticalAlign(static_cast<unsigned>(initialVerticalAlign())),
m_hasViewportUnits(false),
- m_styleType(PseudoIdNone),
- m_pseudoBits(0),
m_hasRemUnits(false) {}
// Compare computed styles, differences in inherited bits or other flags
@@ -272,13 +270,6 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
// lengths.
mutable unsigned m_hasViewportUnits : 1;
- // 32 bits
-
- unsigned m_styleType : 6; // PseudoId
- unsigned m_pseudoBits : 8;
-
- // 64 bits
-
mutable unsigned m_hasRemUnits : 1;
// If you add more style bits here, you will also need to update
@@ -344,12 +335,8 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
IsAtShadowBoundary = NotAtShadowBoundary);
void copyNonInheritedFromCached(const ComputedStyle&);
- PseudoId styleType() const {
- return static_cast<PseudoId>(m_nonInheritedData.m_styleType);
- }
- void setStyleType(PseudoId styleType) {
- m_nonInheritedData.m_styleType = styleType;
- }
+ PseudoId styleType() const { return static_cast<PseudoId>(m_styleType); }
+ void setStyleType(PseudoId styleType) { m_styleType = styleType; }
ComputedStyle* getCachedPseudoStyle(PseudoId) const;
ComputedStyle* addCachedPseudoStyle(PassRefPtr<ComputedStyle>);
@@ -3768,24 +3755,23 @@ inline bool ComputedStyle::setTextOrientation(TextOrientation textOrientation) {
}
inline bool ComputedStyle::hasAnyPublicPseudoStyles() const {
- return m_nonInheritedData.m_pseudoBits;
+ return m_pseudoBits;
}
inline bool ComputedStyle::hasPseudoStyle(PseudoId pseudo) const {
DCHECK(pseudo >= FirstPublicPseudoId);
DCHECK(pseudo < FirstInternalPseudoId);
- return (1 << (pseudo - FirstPublicPseudoId)) &
- m_nonInheritedData.m_pseudoBits;
+ return (1 << (pseudo - FirstPublicPseudoId)) & m_pseudoBits;
}
inline void ComputedStyle::setHasPseudoStyle(PseudoId pseudo) {
DCHECK(pseudo >= FirstPublicPseudoId);
DCHECK(pseudo < FirstInternalPseudoId);
- m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId);
+ m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId);
}
inline bool ComputedStyle::hasPseudoElementStyle() const {
- return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
+ return m_pseudoBits & ElementPseudoIdMask;
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698