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

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

Issue 2187493004: Add a generated ComputedStyleBase class that ComputedStyle extends (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_make_visibility_enum_class_rebase
Patch Set: Created 4 years, 5 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.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index da4cc75741e47d00bff9a773f805ee10efdc7ec8..10d4fa84384bc883b4e4576ca413649b42f221ac 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -64,7 +64,12 @@ struct SameSizeAsBorderValue {
static_assert(sizeof(BorderValue) == sizeof(SameSizeAsBorderValue), "BorderValue should stay small");
+// struct SameSizeAsComputedStyle : public BaseComputedStyle {
struct SameSizeAsComputedStyle : public RefCounted<SameSizeAsComputedStyle> {
+ // The size of ComputedStyle increases by 1 pointer since we are now
+ // inheriting from the generated parent class. This change is temporary and
+ // will go away once BaseComputedStyle becomes ComputedStyle.
+ void* parentClass[1];
void* dataRefs[7];
void* ownPtrs[1];
void* dataRefSvgStyle;
@@ -149,7 +154,7 @@ ALWAYS_INLINE ComputedStyle::ComputedStyle(InitialStyleTag)
}
ALWAYS_INLINE ComputedStyle::ComputedStyle(const ComputedStyle& o)
- : RefCounted<ComputedStyle>()
+ : BaseComputedStyle(o)
, m_box(o.m_box)
, m_visual(o.m_visual)
, m_background(o.m_background)
@@ -268,6 +273,7 @@ ContentDistributionType ComputedStyle::resolvedAlignContentDistribution(const St
void ComputedStyle::inheritFrom(const ComputedStyle& inheritParent, IsAtShadowBoundary isAtShadowBoundary)
{
+ BaseComputedStyle::inheritFrom(inheritParent, isAtShadowBoundary);
if (isAtShadowBoundary == AtShadowBoundary) {
// Even if surrounding content is user-editable, shadow DOM should act as a single unit, and not necessarily be editable
EUserModify currentUserModify = userModify();
@@ -421,7 +427,8 @@ void ComputedStyle::removeCachedPseudoStyle(PseudoId pid)
bool ComputedStyle::inheritedEqual(const ComputedStyle& other) const
{
- return m_inheritedData == other.m_inheritedData
+ return BaseComputedStyle::inheritedEqual(other)
+ && m_inheritedData == other.m_inheritedData
&& m_styleInheritedData == other.m_styleInheritedData
&& m_svgStyle->inheritedEqual(*other.m_svgStyle)
&& m_rareInheritedData == other.m_rareInheritedData;
@@ -447,7 +454,8 @@ bool ComputedStyle::nonInheritedEqual(const ComputedStyle& other) const
bool ComputedStyle::inheritedDataShared(const ComputedStyle& other) const
{
// This is a fast check that only looks if the data structures are shared.
- return m_inheritedData == other.m_inheritedData
+ return BaseComputedStyle::inheritedEqual(other)
+ && m_inheritedData == other.m_inheritedData
&& m_styleInheritedData.get() == other.m_styleInheritedData.get()
&& m_svgStyle.get() == other.m_svgStyle.get()
&& m_rareInheritedData.get() == other.m_rareInheritedData.get();
@@ -747,7 +755,7 @@ bool ComputedStyle::diffNeedsPaintInvalidationObject(const ComputedStyle& other)
if (!m_background->outline().visuallyEqual(other.m_background->outline()))
return true;
- if (m_inheritedData.m_visibility != other.m_inheritedData.m_visibility
+ if (visibility() != other.visibility()
|| m_inheritedData.m_printColorAdjust != other.m_inheritedData.m_printColorAdjust
|| m_inheritedData.m_insideLink != other.m_inheritedData.m_insideLink
|| !m_surround->border.visuallyEqual(other.m_surround->border)

Powered by Google App Engine
This is Rietveld 408576698