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

Unified Diff: Source/core/layout/style/LayoutStyle.h

Issue 921843004: Stop explicit inheritance if LayoutStyle doesn't change. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Corrected and documented flag copying/comparisons Created 5 years, 10 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/resolver/StyleResolver.cpp ('k') | Source/core/layout/style/LayoutStyle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/style/LayoutStyle.h
diff --git a/Source/core/layout/style/LayoutStyle.h b/Source/core/layout/style/LayoutStyle.h
index 22991f87966e85da69a4d1f3773f36932d0bef70..87670fe0d351147eb38409615bab65a2402fab1e 100644
--- a/Source/core/layout/style/LayoutStyle.h
+++ b/Source/core/layout/style/LayoutStyle.h
@@ -206,6 +206,7 @@ protected:
// don't inherit
struct NonInheritedFlags {
+ // Compare computed styles, differences in other flags should not cause an inequality.
bool operator==(const NonInheritedFlags& other) const
{
return effectiveDisplay == other.effectiveDisplay
@@ -217,20 +218,21 @@ protected:
&& position == other.position
&& floating == other.floating
&& tableLayout == other.tableLayout
+ && unicodeBidi == other.unicodeBidi
+ // hasViewportUnits
&& pageBreakBefore == other.pageBreakBefore
&& pageBreakAfter == other.pageBreakAfter
- && pageBreakInside == other.pageBreakInside
- && styleType == other.styleType
- && affectedByFocus == other.affectedByFocus
- && affectedByHover == other.affectedByHover
- && affectedByActive == other.affectedByActive
- && affectedByDrag == other.affectedByDrag
- && pseudoBits == other.pseudoBits
- && unicodeBidi == other.unicodeBidi
- && explicitInheritance == other.explicitInheritance
- && unique == other.unique
- && emptyState == other.emptyState
- && isLink == other.isLink;
+ && pageBreakInside == other.pageBreakInside;
+ // styleType
+ // pseudoBits
+ // explicitInheritance
+ // unique
+ // emptyState
+ // affectedByFocus
+ // affectedByHover
+ // affectedByActive
+ // affectedByDrag
+ // isLink
}
bool operator!=(const NonInheritedFlags& other) const { return !(*this == other); }
@@ -269,7 +271,7 @@ protected:
unsigned affectedByDrag : 1;
unsigned isLink : 1;
- // If you add more style bits here, you will also need to update LayoutStyle::copyNonInheritedFrom()
+ // If you add more style bits here, you will also need to update LayoutStyle::copyNonInheritedFromCached()
// 62 bits
} noninherited_flags;
@@ -351,7 +353,7 @@ public:
};
void inheritFrom(const LayoutStyle& inheritParent, IsAtShadowBoundary = NotAtShadowBoundary);
- void copyNonInheritedFrom(const LayoutStyle&);
+ void copyNonInheritedFromCached(const LayoutStyle&);
PseudoId styleType() const { return static_cast<PseudoId>(noninherited_flags.styleType); }
void setStyleType(PseudoId styleType) { noninherited_flags.styleType = styleType; }
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/layout/style/LayoutStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698