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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 2673533002: Moved overflow-x and overflow-y to be generated in ComputedStyleBase. (Closed)
Patch Set: Rebase Created 3 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 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 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 unsigned m_insideLink : 2; // EInsideLink 215 unsigned m_insideLink : 2; // EInsideLink
216 } m_inheritedData; 216 } m_inheritedData;
217 217
218 // don't inherit 218 // don't inherit
219 struct NonInheritedData { 219 struct NonInheritedData {
220 // Compare computed styles, differences in inherited bits or other flags 220 // Compare computed styles, differences in inherited bits or other flags
221 // should not cause an inequality. 221 // should not cause an inequality.
222 bool operator==(const NonInheritedData& other) const { 222 bool operator==(const NonInheritedData& other) const {
223 return m_effectiveDisplay == other.m_effectiveDisplay && 223 return m_effectiveDisplay == other.m_effectiveDisplay &&
224 m_originalDisplay == other.m_originalDisplay && 224 m_originalDisplay == other.m_originalDisplay &&
225 m_overflowX == other.m_overflowX &&
226 m_overflowY == other.m_overflowY &&
227 m_verticalAlign == other.m_verticalAlign && 225 m_verticalAlign == other.m_verticalAlign &&
228 m_position == other.m_position && 226 m_position == other.m_position &&
229 m_tableLayout == other.m_tableLayout && 227 m_tableLayout == other.m_tableLayout &&
230 // hasViewportUnits 228 // hasViewportUnits
231 m_breakBefore == other.m_breakBefore && 229 m_breakBefore == other.m_breakBefore &&
232 m_breakAfter == other.m_breakAfter && 230 m_breakAfter == other.m_breakAfter &&
233 m_breakInside == other.m_breakInside; 231 m_breakInside == other.m_breakInside;
234 // styleType 232 // styleType
235 // pseudoBits 233 // pseudoBits
236 // explicitInheritance 234 // explicitInheritance
237 // unique 235 // unique
238 // emptyState 236 // emptyState
239 // affectedByFocus 237 // affectedByFocus
240 // affectedByHover 238 // affectedByHover
241 // affectedByActive 239 // affectedByActive
242 // affectedByDrag 240 // affectedByDrag
243 // isLink 241 // isLink
244 // isInherited flags 242 // isInherited flags
245 } 243 }
246 244
247 bool operator!=(const NonInheritedData& other) const { 245 bool operator!=(const NonInheritedData& other) const {
248 return !(*this == other); 246 return !(*this == other);
249 } 247 }
250 248
251 unsigned m_effectiveDisplay : 5; // EDisplay 249 unsigned m_effectiveDisplay : 5; // EDisplay
252 unsigned m_originalDisplay : 5; // EDisplay 250 unsigned m_originalDisplay : 5; // EDisplay
253 unsigned m_overflowX : 3; // EOverflow
254 unsigned m_overflowY : 3; // EOverflow
255 unsigned m_verticalAlign : 4; // EVerticalAlign 251 unsigned m_verticalAlign : 4; // EVerticalAlign
256 unsigned m_position : 3; // EPosition 252 unsigned m_position : 3; // EPosition
257 unsigned m_tableLayout : 1; // ETableLayout 253 unsigned m_tableLayout : 1; // ETableLayout
258 254
259 // This is set if we used viewport units when resolving a length. 255 // This is set if we used viewport units when resolving a length.
260 // It is mutable so we can pass around const ComputedStyles to resolve 256 // It is mutable so we can pass around const ComputedStyles to resolve
261 // lengths. 257 // lengths.
262 mutable unsigned m_hasViewportUnits : 1; 258 mutable unsigned m_hasViewportUnits : 1;
263 259
264 // 32 bits 260 // 32 bits
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 void setBitDefaults() { 293 void setBitDefaults() {
298 ComputedStyleBase::setBitDefaults(); 294 ComputedStyleBase::setBitDefaults();
299 m_inheritedData.m_hasSimpleUnderline = false; 295 m_inheritedData.m_hasSimpleUnderline = false;
300 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); 296 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor());
301 m_inheritedData.m_insideLink = 297 m_inheritedData.m_insideLink =
302 static_cast<unsigned>(EInsideLink::kNotInsideLink); 298 static_cast<unsigned>(EInsideLink::kNotInsideLink);
303 299
304 m_nonInheritedData.m_effectiveDisplay = 300 m_nonInheritedData.m_effectiveDisplay =
305 m_nonInheritedData.m_originalDisplay = 301 m_nonInheritedData.m_originalDisplay =
306 static_cast<unsigned>(initialDisplay()); 302 static_cast<unsigned>(initialDisplay());
307 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX());
308 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY());
309 m_nonInheritedData.m_verticalAlign = 303 m_nonInheritedData.m_verticalAlign =
310 static_cast<unsigned>(initialVerticalAlign()); 304 static_cast<unsigned>(initialVerticalAlign());
311 m_nonInheritedData.m_position = initialPosition(); 305 m_nonInheritedData.m_position = initialPosition();
312 m_nonInheritedData.m_tableLayout = 306 m_nonInheritedData.m_tableLayout =
313 static_cast<unsigned>(initialTableLayout()); 307 static_cast<unsigned>(initialTableLayout());
314 m_nonInheritedData.m_breakBefore = initialBreakBefore(); 308 m_nonInheritedData.m_breakBefore = initialBreakBefore();
315 m_nonInheritedData.m_breakAfter = initialBreakAfter(); 309 m_nonInheritedData.m_breakAfter = initialBreakAfter();
316 m_nonInheritedData.m_breakInside = initialBreakInside(); 310 m_nonInheritedData.m_breakInside = initialBreakInside();
317 m_nonInheritedData.m_styleType = PseudoIdNone; 311 m_nonInheritedData.m_styleType = PseudoIdNone;
318 m_nonInheritedData.m_pseudoBits = 0; 312 m_nonInheritedData.m_pseudoBits = 0;
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 static int initialOutlineOffset() { return 0; } 1451 static int initialOutlineOffset() { return 0; }
1458 int outlineOffset() const { 1452 int outlineOffset() const {
1459 if (m_rareNonInheritedData->m_outline.style() == BorderStyleNone) 1453 if (m_rareNonInheritedData->m_outline.style() == BorderStyleNone)
1460 return 0; 1454 return 0;
1461 return m_rareNonInheritedData->m_outline.offset(); 1455 return m_rareNonInheritedData->m_outline.offset();
1462 } 1456 }
1463 void setOutlineOffset(int v) { 1457 void setOutlineOffset(int v) {
1464 SET_VAR(m_rareNonInheritedData, m_outline.m_offset, v); 1458 SET_VAR(m_rareNonInheritedData, m_outline.m_offset, v);
1465 } 1459 }
1466 1460
1467 // overflow-x
1468 static EOverflow initialOverflowX() { return EOverflow::kVisible; }
1469 EOverflow overflowX() const {
1470 return static_cast<EOverflow>(m_nonInheritedData.m_overflowX);
1471 }
1472 void setOverflowX(EOverflow v) {
1473 m_nonInheritedData.m_overflowX = static_cast<unsigned>(v);
1474 }
1475
1476 // overflow-y
1477 static EOverflow initialOverflowY() { return EOverflow::kVisible; }
1478 EOverflow overflowY() const {
1479 return static_cast<EOverflow>(m_nonInheritedData.m_overflowY);
1480 }
1481 void setOverflowY(EOverflow v) {
1482 m_nonInheritedData.m_overflowY = static_cast<unsigned>(v);
1483 }
1484
1485 // Padding properties. 1461 // Padding properties.
1486 static Length initialPadding() { return Length(Fixed); } 1462 static Length initialPadding() { return Length(Fixed); }
1487 1463
1488 // padding-bottom 1464 // padding-bottom
1489 const Length& paddingBottom() const { return m_surround->padding.bottom(); } 1465 const Length& paddingBottom() const { return m_surround->padding.bottom(); }
1490 void setPaddingBottom(const Length& v) { 1466 void setPaddingBottom(const Length& v) {
1491 SET_VAR(m_surround, padding.m_bottom, v); 1467 SET_VAR(m_surround, padding.m_bottom, v);
1492 } 1468 }
1493 1469
1494 // padding-left 1470 // padding-left
(...skipping 2430 matching lines...) Expand 10 before | Expand all | Expand 10 after
3925 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 3901 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
3926 } 3902 }
3927 3903
3928 inline bool ComputedStyle::hasPseudoElementStyle() const { 3904 inline bool ComputedStyle::hasPseudoElementStyle() const {
3929 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 3905 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
3930 } 3906 }
3931 3907
3932 } // namespace blink 3908 } // namespace blink
3933 3909
3934 #endif // ComputedStyle_h 3910 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698