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

Side by Side Diff: Source/core/rendering/style/RenderStyle.h

Issue 758523002: Store :last/first-child state as restyle flags. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed assert Created 6 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 && styleType == other.styleType 222 && styleType == other.styleType
223 && affectedByFocus == other.affectedByFocus 223 && affectedByFocus == other.affectedByFocus
224 && affectedByHover == other.affectedByHover 224 && affectedByHover == other.affectedByHover
225 && affectedByActive == other.affectedByActive 225 && affectedByActive == other.affectedByActive
226 && affectedByDrag == other.affectedByDrag 226 && affectedByDrag == other.affectedByDrag
227 && pseudoBits == other.pseudoBits 227 && pseudoBits == other.pseudoBits
228 && unicodeBidi == other.unicodeBidi 228 && unicodeBidi == other.unicodeBidi
229 && explicitInheritance == other.explicitInheritance 229 && explicitInheritance == other.explicitInheritance
230 && unique == other.unique 230 && unique == other.unique
231 && emptyState == other.emptyState 231 && emptyState == other.emptyState
232 && firstChildState == other.firstChildState
233 && lastChildState == other.lastChildState
234 && isLink == other.isLink; 232 && isLink == other.isLink;
235 } 233 }
236 234
237 bool operator!=(const NonInheritedFlags& other) const { return !(*this = = other); } 235 bool operator!=(const NonInheritedFlags& other) const { return !(*this = = other); }
238 236
239 unsigned effectiveDisplay : 5; // EDisplay 237 unsigned effectiveDisplay : 5; // EDisplay
240 unsigned originalDisplay : 5; // EDisplay 238 unsigned originalDisplay : 5; // EDisplay
241 unsigned overflowX : 3; // EOverflow 239 unsigned overflowX : 3; // EOverflow
242 unsigned overflowY : 3; // EOverflow 240 unsigned overflowY : 3; // EOverflow
243 unsigned verticalAlign : 4; // EVerticalAlign 241 unsigned verticalAlign : 4; // EVerticalAlign
(...skipping 12 matching lines...) Expand all
256 unsigned pageBreakBefore : 2; // EPageBreak 254 unsigned pageBreakBefore : 2; // EPageBreak
257 unsigned pageBreakAfter : 2; // EPageBreak 255 unsigned pageBreakAfter : 2; // EPageBreak
258 unsigned pageBreakInside : 2; // EPageBreak 256 unsigned pageBreakInside : 2; // EPageBreak
259 257
260 unsigned styleType : 6; // PseudoId 258 unsigned styleType : 6; // PseudoId
261 unsigned pseudoBits : 8; 259 unsigned pseudoBits : 8;
262 unsigned explicitInheritance : 1; // Explicitly inherits a non-inherited property 260 unsigned explicitInheritance : 1; // Explicitly inherits a non-inherited property
263 unsigned unique : 1; // Style can not be shared. 261 unsigned unique : 1; // Style can not be shared.
264 262
265 unsigned emptyState : 1; 263 unsigned emptyState : 1;
266 unsigned firstChildState : 1;
267 unsigned lastChildState : 1;
268 264
269 unsigned affectedByFocus : 1; 265 unsigned affectedByFocus : 1;
270 unsigned affectedByHover : 1; 266 unsigned affectedByHover : 1;
271 unsigned affectedByActive : 1; 267 unsigned affectedByActive : 1;
272 unsigned affectedByDrag : 1; 268 unsigned affectedByDrag : 1;
273 269
274 unsigned isLink : 1; 270 unsigned isLink : 1;
275 // If you add more style bits here, you will also need to update RenderS tyle::copyNonInheritedFrom() 271 // If you add more style bits here, you will also need to update RenderS tyle::copyNonInheritedFrom()
276 // 62 bits 272 // 62 bits
277 } noninherited_flags; 273 } noninherited_flags;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 noninherited_flags.tableLayout = initialTableLayout(); 306 noninherited_flags.tableLayout = initialTableLayout();
311 noninherited_flags.unicodeBidi = initialUnicodeBidi(); 307 noninherited_flags.unicodeBidi = initialUnicodeBidi();
312 noninherited_flags.pageBreakBefore = initialPageBreak(); 308 noninherited_flags.pageBreakBefore = initialPageBreak();
313 noninherited_flags.pageBreakAfter = initialPageBreak(); 309 noninherited_flags.pageBreakAfter = initialPageBreak();
314 noninherited_flags.pageBreakInside = initialPageBreak(); 310 noninherited_flags.pageBreakInside = initialPageBreak();
315 noninherited_flags.styleType = NOPSEUDO; 311 noninherited_flags.styleType = NOPSEUDO;
316 noninherited_flags.pseudoBits = 0; 312 noninherited_flags.pseudoBits = 0;
317 noninherited_flags.explicitInheritance = false; 313 noninherited_flags.explicitInheritance = false;
318 noninherited_flags.unique = false; 314 noninherited_flags.unique = false;
319 noninherited_flags.emptyState = false; 315 noninherited_flags.emptyState = false;
320 noninherited_flags.firstChildState = false;
321 noninherited_flags.lastChildState = false;
322 noninherited_flags.hasViewportUnits = false; 316 noninherited_flags.hasViewportUnits = false;
323 noninherited_flags.affectedByFocus = false; 317 noninherited_flags.affectedByFocus = false;
324 noninherited_flags.affectedByHover = false; 318 noninherited_flags.affectedByHover = false;
325 noninherited_flags.affectedByActive = false; 319 noninherited_flags.affectedByActive = false;
326 noninherited_flags.affectedByDrag = false; 320 noninherited_flags.affectedByDrag = false;
327 noninherited_flags.isLink = false; 321 noninherited_flags.isLink = false;
328 } 322 }
329 323
330 private: 324 private:
331 ALWAYS_INLINE RenderStyle(); 325 ALWAYS_INLINE RenderStyle();
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1491 } 1485 }
1492 1486
1493 // A unique style is one that has matches something that makes it impossible to share. 1487 // A unique style is one that has matches something that makes it impossible to share.
1494 bool unique() const { return noninherited_flags.unique; } 1488 bool unique() const { return noninherited_flags.unique; }
1495 void setUnique() { noninherited_flags.unique = true; } 1489 void setUnique() { noninherited_flags.unique = true; }
1496 1490
1497 bool isSharable() const; 1491 bool isSharable() const;
1498 1492
1499 bool emptyState() const { return noninherited_flags.emptyState; } 1493 bool emptyState() const { return noninherited_flags.emptyState; }
1500 void setEmptyState(bool b) { setUnique(); noninherited_flags.emptyState = b; } 1494 void setEmptyState(bool b) { setUnique(); noninherited_flags.emptyState = b; }
1501 bool firstChildState() const { return noninherited_flags.firstChildState; }
1502 void setFirstChildState() { setUnique(); noninherited_flags.firstChildState = true; }
1503 bool lastChildState() const { return noninherited_flags.lastChildState; }
1504 void setLastChildState() { setUnique(); noninherited_flags.lastChildState = true; }
1505 1495
1506 StyleColor visitedDependentDecorationStyleColor() const; 1496 StyleColor visitedDependentDecorationStyleColor() const;
1507 Color visitedDependentDecorationColor() const; 1497 Color visitedDependentDecorationColor() const;
1508 Color visitedDependentColor(int colorProperty) const; 1498 Color visitedDependentColor(int colorProperty) const;
1509 1499
1510 void setHasExplicitlyInheritedProperties() { noninherited_flags.explicitInhe ritance = true; } 1500 void setHasExplicitlyInheritedProperties() { noninherited_flags.explicitInhe ritance = true; }
1511 bool hasExplicitlyInheritedProperties() const { return noninherited_flags.ex plicitInheritance; } 1501 bool hasExplicitlyInheritedProperties() const { return noninherited_flags.ex plicitInheritance; }
1512 1502
1513 bool hasBoxDecorations() const { return hasBorder() || hasBorderRadius() || hasOutline() || hasAppearance() || boxShadow() || hasFilter(); } 1503 bool hasBoxDecorations() const { return hasBorder() || hasBorderRadius() || hasOutline() || hasAppearance() || boxShadow() || hasFilter(); }
1514 1504
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1897 inline bool RenderStyle::hasPseudoElementStyle() const 1887 inline bool RenderStyle::hasPseudoElementStyle() const
1898 { 1888 {
1899 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK; 1889 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK;
1900 } 1890 }
1901 1891
1902 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect ::Radii&); 1892 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect ::Radii&);
1903 1893
1904 } // namespace blink 1894 } // namespace blink
1905 1895
1906 #endif // RenderStyle_h 1896 #endif // RenderStyle_h
OLDNEW
« Source/core/dom/ContainerNode.cpp ('K') | « Source/core/dom/ContainerNode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698