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

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

Issue 18859010: Move colorFromPrimitiveValue from StyleResolverState to TextLinkColors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/TextLinkColors.cpp ('k') | Source/core/rendering/style/RenderStyle.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 && _page_break_before == other._page_break_before 208 && _page_break_before == other._page_break_before
209 && _page_break_after == other._page_break_after 209 && _page_break_after == other._page_break_after
210 && _page_break_inside == other._page_break_inside 210 && _page_break_inside == other._page_break_inside
211 && _styleType == other._styleType 211 && _styleType == other._styleType
212 && _affectedByHover == other._affectedByHover 212 && _affectedByHover == other._affectedByHover
213 && _affectedByActive == other._affectedByActive 213 && _affectedByActive == other._affectedByActive
214 && _affectedByDrag == other._affectedByDrag 214 && _affectedByDrag == other._affectedByDrag
215 && _pseudoBits == other._pseudoBits 215 && _pseudoBits == other._pseudoBits
216 && _unicodeBidi == other._unicodeBidi 216 && _unicodeBidi == other._unicodeBidi
217 && explicitInheritance == other.explicitInheritance 217 && explicitInheritance == other.explicitInheritance
218 && currentColor == other.currentColor
218 && unique == other.unique 219 && unique == other.unique
219 && emptyState == other.emptyState 220 && emptyState == other.emptyState
220 && firstChildState == other.firstChildState 221 && firstChildState == other.firstChildState
221 && lastChildState == other.lastChildState 222 && lastChildState == other.lastChildState
222 && _isLink == other._isLink; 223 && _isLink == other._isLink;
223 } 224 }
224 225
225 bool operator!=(const NonInheritedFlags& other) const { return !(*this = = other); } 226 bool operator!=(const NonInheritedFlags& other) const { return !(*this = = other); }
226 227
227 unsigned _effectiveDisplay : 5; // EDisplay 228 unsigned _effectiveDisplay : 5; // EDisplay
228 unsigned _originalDisplay : 5; // EDisplay 229 unsigned _originalDisplay : 5; // EDisplay
229 unsigned _overflowX : 3; // EOverflow 230 unsigned _overflowX : 3; // EOverflow
230 unsigned _overflowY : 3; // EOverflow 231 unsigned _overflowY : 3; // EOverflow
231 unsigned _vertical_align : 4; // EVerticalAlign 232 unsigned _vertical_align : 4; // EVerticalAlign
232 unsigned _clear : 2; // EClear 233 unsigned _clear : 2; // EClear
233 unsigned _position : 3; // EPosition 234 unsigned _position : 3; // EPosition
234 unsigned _floating : 2; // EFloat 235 unsigned _floating : 2; // EFloat
235 unsigned _table_layout : 1; // ETableLayout 236 unsigned _table_layout : 1; // ETableLayout
236 237
237 unsigned _unicodeBidi : 3; // EUnicodeBidi 238 unsigned _unicodeBidi : 3; // EUnicodeBidi
238 // 31 bits 239 // 31 bits
239 unsigned _page_break_before : 2; // EPageBreak 240 unsigned _page_break_before : 2; // EPageBreak
240 unsigned _page_break_after : 2; // EPageBreak 241 unsigned _page_break_after : 2; // EPageBreak
241 unsigned _page_break_inside : 2; // EPageBreak 242 unsigned _page_break_inside : 2; // EPageBreak
242 243
243 unsigned _styleType : 6; // PseudoId 244 unsigned _styleType : 6; // PseudoId
244 unsigned _pseudoBits : 8; 245 unsigned _pseudoBits : 8;
245 unsigned explicitInheritance : 1; // Explicitly inherits a non-inherited property 246 unsigned explicitInheritance : 1; // Explicitly inherits a non-inherited property
247 unsigned currentColor : 1; // At least one color has the value 'currentC olor'
246 unsigned unique : 1; // Style can not be shared. 248 unsigned unique : 1; // Style can not be shared.
247 unsigned emptyState : 1; 249 unsigned emptyState : 1;
248 unsigned firstChildState : 1; 250 unsigned firstChildState : 1;
249 unsigned lastChildState : 1; 251 unsigned lastChildState : 1;
250 252
251 bool affectedByHover() const { return _affectedByHover; } 253 bool affectedByHover() const { return _affectedByHover; }
252 void setAffectedByHover(bool value) { _affectedByHover = value; } 254 void setAffectedByHover(bool value) { _affectedByHover = value; }
253 bool affectedByActive() const { return _affectedByActive; } 255 bool affectedByActive() const { return _affectedByActive; }
254 void setAffectedByActive(bool value) { _affectedByActive = value; } 256 void setAffectedByActive(bool value) { _affectedByActive = value; }
255 bool affectedByDrag() const { return _affectedByDrag; } 257 bool affectedByDrag() const { return _affectedByDrag; }
256 void setAffectedByDrag(bool value) { _affectedByDrag = value; } 258 void setAffectedByDrag(bool value) { _affectedByDrag = value; }
257 bool isLink() const { return _isLink; } 259 bool isLink() const { return _isLink; }
258 void setIsLink(bool value) { _isLink = value; } 260 void setIsLink(bool value) { _isLink = value; }
259 private: 261 private:
260 unsigned _affectedByHover : 1; 262 unsigned _affectedByHover : 1;
261 unsigned _affectedByActive : 1; 263 unsigned _affectedByActive : 1;
262 unsigned _affectedByDrag : 1; 264 unsigned _affectedByDrag : 1;
263 unsigned _isLink : 1; 265 unsigned _isLink : 1;
264 // If you add more style bits here, you will also need to update RenderS tyle::copyNonInheritedFrom() 266 // If you add more style bits here, you will also need to update RenderS tyle::copyNonInheritedFrom()
265 // 60 bits 267 // 61 bits
266 } noninherited_flags; 268 } noninherited_flags;
267 269
268 // !END SYNC! 270 // !END SYNC!
269 271
270 protected: 272 protected:
271 void setBitDefaults() 273 void setBitDefaults()
272 { 274 {
273 inherited_flags._empty_cells = initialEmptyCells(); 275 inherited_flags._empty_cells = initialEmptyCells();
274 inherited_flags._caption_side = initialCaptionSide(); 276 inherited_flags._caption_side = initialCaptionSide();
275 inherited_flags._list_style_type = initialListStyleType(); 277 inherited_flags._list_style_type = initialListStyleType();
(...skipping 21 matching lines...) Expand all
297 noninherited_flags._position = initialPosition(); 299 noninherited_flags._position = initialPosition();
298 noninherited_flags._floating = initialFloating(); 300 noninherited_flags._floating = initialFloating();
299 noninherited_flags._table_layout = initialTableLayout(); 301 noninherited_flags._table_layout = initialTableLayout();
300 noninherited_flags._unicodeBidi = initialUnicodeBidi(); 302 noninherited_flags._unicodeBidi = initialUnicodeBidi();
301 noninherited_flags._page_break_before = initialPageBreak(); 303 noninherited_flags._page_break_before = initialPageBreak();
302 noninherited_flags._page_break_after = initialPageBreak(); 304 noninherited_flags._page_break_after = initialPageBreak();
303 noninherited_flags._page_break_inside = initialPageBreak(); 305 noninherited_flags._page_break_inside = initialPageBreak();
304 noninherited_flags._styleType = NOPSEUDO; 306 noninherited_flags._styleType = NOPSEUDO;
305 noninherited_flags._pseudoBits = 0; 307 noninherited_flags._pseudoBits = 0;
306 noninherited_flags.explicitInheritance = false; 308 noninherited_flags.explicitInheritance = false;
309 noninherited_flags.currentColor = false;
307 noninherited_flags.unique = false; 310 noninherited_flags.unique = false;
308 noninherited_flags.emptyState = false; 311 noninherited_flags.emptyState = false;
309 noninherited_flags.firstChildState = false; 312 noninherited_flags.firstChildState = false;
310 noninherited_flags.lastChildState = false; 313 noninherited_flags.lastChildState = false;
311 noninherited_flags.setAffectedByHover(false); 314 noninherited_flags.setAffectedByHover(false);
312 noninherited_flags.setAffectedByActive(false); 315 noninherited_flags.setAffectedByActive(false);
313 noninherited_flags.setAffectedByDrag(false); 316 noninherited_flags.setAffectedByDrag(false);
314 noninherited_flags.setIsLink(false); 317 noninherited_flags.setIsLink(false);
315 } 318 }
316 319
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 bool firstChildState() const { return noninherited_flags.firstChildState; } 1446 bool firstChildState() const { return noninherited_flags.firstChildState; }
1444 void setFirstChildState() { setUnique(); noninherited_flags.firstChildState = true; } 1447 void setFirstChildState() { setUnique(); noninherited_flags.firstChildState = true; }
1445 bool lastChildState() const { return noninherited_flags.lastChildState; } 1448 bool lastChildState() const { return noninherited_flags.lastChildState; }
1446 void setLastChildState() { setUnique(); noninherited_flags.lastChildState = true; } 1449 void setLastChildState() { setUnique(); noninherited_flags.lastChildState = true; }
1447 1450
1448 Color visitedDependentColor(int colorProperty) const; 1451 Color visitedDependentColor(int colorProperty) const;
1449 1452
1450 void setHasExplicitlyInheritedProperties() { noninherited_flags.explicitInhe ritance = true; } 1453 void setHasExplicitlyInheritedProperties() { noninherited_flags.explicitInhe ritance = true; }
1451 bool hasExplicitlyInheritedProperties() const { return noninherited_flags.ex plicitInheritance; } 1454 bool hasExplicitlyInheritedProperties() const { return noninherited_flags.ex plicitInheritance; }
1452 1455
1456 void setHasCurrentColor() { noninherited_flags.currentColor = true; }
1457 bool hasCurrentColor() const { return noninherited_flags.currentColor; }
1458
1453 void reportMemoryUsage(MemoryObjectInfo*) const; 1459 void reportMemoryUsage(MemoryObjectInfo*) const;
1454 1460
1455 // Initial values for all the properties 1461 // Initial values for all the properties
1456 static EBorderCollapse initialBorderCollapse() { return BSEPARATE; } 1462 static EBorderCollapse initialBorderCollapse() { return BSEPARATE; }
1457 static EBorderStyle initialBorderStyle() { return BNONE; } 1463 static EBorderStyle initialBorderStyle() { return BNONE; }
1458 static OutlineIsAuto initialOutlineStyleIsAuto() { return AUTO_OFF; } 1464 static OutlineIsAuto initialOutlineStyleIsAuto() { return AUTO_OFF; }
1459 static NinePieceImage initialNinePieceImage() { return NinePieceImage(); } 1465 static NinePieceImage initialNinePieceImage() { return NinePieceImage(); }
1460 static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed) , Length(0, Fixed)); } 1466 static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed) , Length(0, Fixed)); }
1461 static ECaptionSide initialCaptionSide() { return CAPTOP; } 1467 static ECaptionSide initialCaptionSide() { return CAPTOP; }
1462 static EClear initialClear() { return CNONE; } 1468 static EClear initialClear() { return CNONE; }
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1757 if (compareEqual(rareInheritedData->m_textOrientation, textOrientation)) 1763 if (compareEqual(rareInheritedData->m_textOrientation, textOrientation))
1758 return false; 1764 return false;
1759 1765
1760 rareInheritedData.access()->m_textOrientation = textOrientation; 1766 rareInheritedData.access()->m_textOrientation = textOrientation;
1761 return true; 1767 return true;
1762 } 1768 }
1763 1769
1764 } // namespace WebCore 1770 } // namespace WebCore
1765 1771
1766 #endif // RenderStyle_h 1772 #endif // RenderStyle_h
OLDNEW
« no previous file with comments | « Source/core/dom/TextLinkColors.cpp ('k') | Source/core/rendering/style/RenderStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698