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

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

Issue 2669433002: Moved table-layout property 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 std::unique_ptr<PseudoStyleCache> m_cachedPseudoStyles; 191 std::unique_ptr<PseudoStyleCache> m_cachedPseudoStyles;
192 192
193 DataRef<SVGComputedStyle> m_svgStyle; 193 DataRef<SVGComputedStyle> m_svgStyle;
194 194
195 // !START SYNC!: Keep this in sync with the copy constructor in 195 // !START SYNC!: Keep this in sync with the copy constructor in
196 // ComputedStyle.cpp. 196 // ComputedStyle.cpp.
197 197
198 // inherit 198 // inherit
199 struct InheritedData { 199 struct InheritedData {
200 bool operator==(const InheritedData& other) const { 200 bool operator==(const InheritedData& other) const {
201 // Generated properties are compared in ComputedStyleBase
201 return (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && 202 return (m_hasSimpleUnderline == other.m_hasSimpleUnderline) &&
202 (m_cursorStyle == other.m_cursorStyle) && 203 (m_cursorStyle == other.m_cursorStyle) &&
203 (m_insideLink == other.m_insideLink); 204 (m_insideLink == other.m_insideLink);
204 } 205 }
205 206
206 bool operator!=(const InheritedData& other) const { 207 bool operator!=(const InheritedData& other) const {
207 return !(*this == other); 208 return !(*this == other);
208 } 209 }
209 210
210 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only 211 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only
211 // text decoration on this element. 212 // text decoration on this element.
212 unsigned m_cursorStyle : 6; // ECursor 213 unsigned m_cursorStyle : 6; // ECursor
213 214
214 // non CSS2 inherited 215 // non CSS2 inherited
215 unsigned m_insideLink : 2; // EInsideLink 216 unsigned m_insideLink : 2; // EInsideLink
216 } m_inheritedData; 217 } m_inheritedData;
217 218
218 // don't inherit 219 // don't inherit
219 struct NonInheritedData { 220 struct NonInheritedData {
220 // Compare computed styles, differences in inherited bits or other flags 221 // Compare computed styles, differences in inherited bits or other flags
221 // should not cause an inequality. 222 // should not cause an inequality.
222 bool operator==(const NonInheritedData& other) const { 223 bool operator==(const NonInheritedData& other) const {
224 // Generated properties are compared in ComputedStyleBase
223 return m_effectiveDisplay == other.m_effectiveDisplay && 225 return m_effectiveDisplay == other.m_effectiveDisplay &&
224 m_originalDisplay == other.m_originalDisplay && 226 m_originalDisplay == other.m_originalDisplay &&
225 m_overflowAnchor == other.m_overflowAnchor && 227 m_overflowAnchor == other.m_overflowAnchor &&
226 m_overflowX == other.m_overflowX && 228 m_overflowX == other.m_overflowX &&
227 m_overflowY == other.m_overflowY && 229 m_overflowY == other.m_overflowY &&
228 m_verticalAlign == other.m_verticalAlign && 230 m_verticalAlign == other.m_verticalAlign &&
229 m_position == other.m_position && 231 m_position == other.m_position &&
230 m_tableLayout == other.m_tableLayout && 232 m_tableLayout == other.m_tableLayout &&
Bugs Nash 2017/01/31 22:13:54 looks like you lost some changes in this patch? I
231 // hasViewportUnits 233 // hasViewportUnits
232 m_breakBefore == other.m_breakBefore && 234 m_breakBefore == other.m_breakBefore &&
233 m_breakAfter == other.m_breakAfter && 235 m_breakAfter == other.m_breakAfter &&
234 m_breakInside == other.m_breakInside; 236 m_breakInside == other.m_breakInside;
235 // styleType 237 // styleType
236 // pseudoBits 238 // pseudoBits
237 // explicitInheritance 239 // explicitInheritance
238 // unique 240 // unique
239 // emptyState 241 // emptyState
240 // affectedByFocus 242 // affectedByFocus
241 // affectedByHover 243 // affectedByHover
242 // affectedByActive 244 // affectedByActive
243 // affectedByDrag 245 // affectedByDrag
244 // isLink 246 // isLink
245 // isInherited flags 247 // isInherited flags
246 } 248 }
247 249
248 bool operator!=(const NonInheritedData& other) const { 250 bool operator!=(const NonInheritedData& other) const {
249 return !(*this == other); 251 return !(*this == other);
250 } 252 }
251 253
252 unsigned m_effectiveDisplay : 5; // EDisplay 254 unsigned m_effectiveDisplay : 5; // EDisplay
253 unsigned m_originalDisplay : 5; // EDisplay 255 unsigned m_originalDisplay : 5; // EDisplay
254 unsigned m_overflowAnchor : 2; // EOverflowAnchor 256 unsigned m_overflowAnchor : 2; // EOverflowAnchor
255 unsigned m_overflowX : 3; // EOverflow 257 unsigned m_overflowX : 3; // EOverflow
256 unsigned m_overflowY : 3; // EOverflow 258 unsigned m_overflowY : 3; // EOverflow
257 unsigned m_verticalAlign : 4; // EVerticalAlign 259 unsigned m_verticalAlign : 4; // EVerticalAlign
258 unsigned m_position : 3; // EPosition 260 unsigned m_position : 3; // EPosition
259 unsigned m_tableLayout : 1; // ETableLayout
260 261
261 // This is set if we used viewport units when resolving a length. 262 // This is set if we used viewport units when resolving a length.
262 // It is mutable so we can pass around const ComputedStyles to resolve 263 // It is mutable so we can pass around const ComputedStyles to resolve
263 // lengths. 264 // lengths.
264 mutable unsigned m_hasViewportUnits : 1; 265 mutable unsigned m_hasViewportUnits : 1;
265 266
266 // 32 bits 267 // 32 bits
267 268
268 unsigned m_breakBefore : 4; // EBreak 269 unsigned m_breakBefore : 4; // EBreak
269 unsigned m_breakAfter : 4; // EBreak 270 unsigned m_breakAfter : 4; // EBreak
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 m_nonInheritedData.m_effectiveDisplay = 307 m_nonInheritedData.m_effectiveDisplay =
307 m_nonInheritedData.m_originalDisplay = 308 m_nonInheritedData.m_originalDisplay =
308 static_cast<unsigned>(initialDisplay()); 309 static_cast<unsigned>(initialDisplay());
309 m_nonInheritedData.m_overflowAnchor = 310 m_nonInheritedData.m_overflowAnchor =
310 static_cast<unsigned>(initialOverflowAnchor()); 311 static_cast<unsigned>(initialOverflowAnchor());
311 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX()); 312 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX());
312 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY()); 313 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY());
313 m_nonInheritedData.m_verticalAlign = 314 m_nonInheritedData.m_verticalAlign =
314 static_cast<unsigned>(initialVerticalAlign()); 315 static_cast<unsigned>(initialVerticalAlign());
315 m_nonInheritedData.m_position = initialPosition(); 316 m_nonInheritedData.m_position = initialPosition();
316 m_nonInheritedData.m_tableLayout =
317 static_cast<unsigned>(initialTableLayout());
318 m_nonInheritedData.m_breakBefore = initialBreakBefore(); 317 m_nonInheritedData.m_breakBefore = initialBreakBefore();
319 m_nonInheritedData.m_breakAfter = initialBreakAfter(); 318 m_nonInheritedData.m_breakAfter = initialBreakAfter();
320 m_nonInheritedData.m_breakInside = initialBreakInside(); 319 m_nonInheritedData.m_breakInside = initialBreakInside();
321 m_nonInheritedData.m_styleType = PseudoIdNone; 320 m_nonInheritedData.m_styleType = PseudoIdNone;
322 m_nonInheritedData.m_pseudoBits = 0; 321 m_nonInheritedData.m_pseudoBits = 0;
323 m_nonInheritedData.m_explicitInheritance = false; 322 m_nonInheritedData.m_explicitInheritance = false;
324 m_nonInheritedData.m_variableReference = false; 323 m_nonInheritedData.m_variableReference = false;
325 m_nonInheritedData.m_unique = false; 324 m_nonInheritedData.m_unique = false;
326 m_nonInheritedData.m_emptyState = false; 325 m_nonInheritedData.m_emptyState = false;
327 m_nonInheritedData.m_hasViewportUnits = false; 326 m_nonInheritedData.m_hasViewportUnits = false;
(...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after
1763 } 1762 }
1764 PageSizeType getPageSizeType() const { 1763 PageSizeType getPageSizeType() const {
1765 return static_cast<PageSizeType>(m_rareNonInheritedData->m_pageSizeType); 1764 return static_cast<PageSizeType>(m_rareNonInheritedData->m_pageSizeType);
1766 } 1765 }
1767 void setPageSize(const FloatSize& s) { 1766 void setPageSize(const FloatSize& s) {
1768 SET_VAR(m_rareNonInheritedData, m_pageSize, s); 1767 SET_VAR(m_rareNonInheritedData, m_pageSize, s);
1769 } 1768 }
1770 void setPageSizeType(PageSizeType t) { 1769 void setPageSizeType(PageSizeType t) {
1771 SET_VAR(m_rareNonInheritedData, m_pageSizeType, t); 1770 SET_VAR(m_rareNonInheritedData, m_pageSizeType, t);
1772 } 1771 }
1773 // table-layout
1774 static ETableLayout initialTableLayout() { return ETableLayout::kAuto; }
1775 ETableLayout tableLayout() const {
1776 return static_cast<ETableLayout>(m_nonInheritedData.m_tableLayout);
1777 }
1778 void setTableLayout(ETableLayout v) {
1779 m_nonInheritedData.m_tableLayout = static_cast<unsigned>(v);
1780 }
1781 1772
1782 // Text decoration properties. 1773 // Text decoration properties.
1783 // text-decoration-line 1774 // text-decoration-line
1784 static TextDecoration initialTextDecoration() { return TextDecorationNone; } 1775 static TextDecoration initialTextDecoration() { return TextDecorationNone; }
1785 TextDecoration getTextDecoration() const { 1776 TextDecoration getTextDecoration() const {
1786 return static_cast<TextDecoration>(m_visual->textDecoration); 1777 return static_cast<TextDecoration>(m_visual->textDecoration);
1787 } 1778 }
1788 void setTextDecoration(TextDecoration v) { 1779 void setTextDecoration(TextDecoration v) {
1789 SET_VAR(m_visual, textDecoration, v); 1780 SET_VAR(m_visual, textDecoration, v);
1790 } 1781 }
(...skipping 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after
3938 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 3929 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
3939 } 3930 }
3940 3931
3941 inline bool ComputedStyle::hasPseudoElementStyle() const { 3932 inline bool ComputedStyle::hasPseudoElementStyle() const {
3942 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 3933 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
3943 } 3934 }
3944 3935
3945 } // namespace blink 3936 } // namespace blink
3946 3937
3947 #endif // ComputedStyle_h 3938 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSProperties.json5 ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698