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

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

Issue 1681273003: Add CSS parser support for break-after, break-before and break-inside. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase master Created 4 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) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 struct SameSizeAsComputedStyle : public RefCounted<SameSizeAsComputedStyle> { 60 struct SameSizeAsComputedStyle : public RefCounted<SameSizeAsComputedStyle> {
61 void* dataRefs[7]; 61 void* dataRefs[7];
62 void* ownPtrs[1]; 62 void* ownPtrs[1];
63 void* dataRefSvgStyle; 63 void* dataRefSvgStyle;
64 64
65 struct InheritedFlags { 65 struct InheritedFlags {
66 unsigned m_bitfields[2]; 66 unsigned m_bitfields[2];
67 } inherited_flags; 67 } inherited_flags;
68 68
69 struct NonInheritedFlags { 69 struct NonInheritedFlags {
70 unsigned m_bitfields[2]; 70 unsigned m_bitfields[3];
71 } noninherited_flags; 71 } noninherited_flags;
72 }; 72 };
73 73
74 static_assert(sizeof(ComputedStyle) == sizeof(SameSizeAsComputedStyle), "Compute dStyle should stay small"); 74 static_assert(sizeof(ComputedStyle) == sizeof(SameSizeAsComputedStyle), "Compute dStyle should stay small");
75 75
76 PassRefPtr<ComputedStyle> ComputedStyle::create() 76 PassRefPtr<ComputedStyle> ComputedStyle::create()
77 { 77 {
78 return adoptRef(new ComputedStyle()); 78 return adoptRef(new ComputedStyle());
79 } 79 }
80 80
(...skipping 21 matching lines...) Expand all
102 , visual(initialStyle()->visual) 102 , visual(initialStyle()->visual)
103 , m_background(initialStyle()->m_background) 103 , m_background(initialStyle()->m_background)
104 , surround(initialStyle()->surround) 104 , surround(initialStyle()->surround)
105 , rareNonInheritedData(initialStyle()->rareNonInheritedData) 105 , rareNonInheritedData(initialStyle()->rareNonInheritedData)
106 , rareInheritedData(initialStyle()->rareInheritedData) 106 , rareInheritedData(initialStyle()->rareInheritedData)
107 , inherited(initialStyle()->inherited) 107 , inherited(initialStyle()->inherited)
108 , m_svgStyle(initialStyle()->m_svgStyle) 108 , m_svgStyle(initialStyle()->m_svgStyle)
109 { 109 {
110 setBitDefaults(); // Would it be faster to copy this from the default style? 110 setBitDefaults(); // Would it be faster to copy this from the default style?
111 static_assert((sizeof(InheritedFlags) <= 8), "InheritedFlags should not grow "); 111 static_assert((sizeof(InheritedFlags) <= 8), "InheritedFlags should not grow ");
112 static_assert((sizeof(NonInheritedFlags) <= 8), "NonInheritedFlags should no t grow"); 112 static_assert((sizeof(NonInheritedFlags) <= 12), "NonInheritedFlags should n ot grow");
113 } 113 }
114 114
115 ALWAYS_INLINE ComputedStyle::ComputedStyle(InitialStyleTag) 115 ALWAYS_INLINE ComputedStyle::ComputedStyle(InitialStyleTag)
116 { 116 {
117 setBitDefaults(); 117 setBitDefaults();
118 118
119 m_box.init(); 119 m_box.init();
120 visual.init(); 120 visual.init();
121 m_background.init(); 121 m_background.init();
122 surround.init(); 122 surround.init();
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 noninherited_flags.originalDisplay = other.noninherited_flags.originalDispla y; 283 noninherited_flags.originalDisplay = other.noninherited_flags.originalDispla y;
284 noninherited_flags.overflowX = other.noninherited_flags.overflowX; 284 noninherited_flags.overflowX = other.noninherited_flags.overflowX;
285 noninherited_flags.overflowY = other.noninherited_flags.overflowY; 285 noninherited_flags.overflowY = other.noninherited_flags.overflowY;
286 noninherited_flags.verticalAlign = other.noninherited_flags.verticalAlign; 286 noninherited_flags.verticalAlign = other.noninherited_flags.verticalAlign;
287 noninherited_flags.clear = other.noninherited_flags.clear; 287 noninherited_flags.clear = other.noninherited_flags.clear;
288 noninherited_flags.position = other.noninherited_flags.position; 288 noninherited_flags.position = other.noninherited_flags.position;
289 noninherited_flags.floating = other.noninherited_flags.floating; 289 noninherited_flags.floating = other.noninherited_flags.floating;
290 noninherited_flags.tableLayout = other.noninherited_flags.tableLayout; 290 noninherited_flags.tableLayout = other.noninherited_flags.tableLayout;
291 noninherited_flags.unicodeBidi = other.noninherited_flags.unicodeBidi; 291 noninherited_flags.unicodeBidi = other.noninherited_flags.unicodeBidi;
292 noninherited_flags.hasViewportUnits = other.noninherited_flags.hasViewportUn its; 292 noninherited_flags.hasViewportUnits = other.noninherited_flags.hasViewportUn its;
293 noninherited_flags.pageBreakBefore = other.noninherited_flags.pageBreakBefor e; 293 noninherited_flags.breakBefore = other.noninherited_flags.breakBefore;
294 noninherited_flags.pageBreakAfter = other.noninherited_flags.pageBreakAfter; 294 noninherited_flags.breakAfter = other.noninherited_flags.breakAfter;
295 noninherited_flags.pageBreakInside = other.noninherited_flags.pageBreakInsid e; 295 noninherited_flags.breakInside = other.noninherited_flags.breakInside;
296 noninherited_flags.hasRemUnits = other.noninherited_flags.hasRemUnits; 296 noninherited_flags.hasRemUnits = other.noninherited_flags.hasRemUnits;
297 297
298 // Correctly set during selector matching: 298 // Correctly set during selector matching:
299 // noninherited_flags.styleType 299 // noninherited_flags.styleType
300 // noninherited_flags.pseudoBits 300 // noninherited_flags.pseudoBits
301 301
302 // Set correctly while computing style for children: 302 // Set correctly while computing style for children:
303 // noninherited_flags.explicitInheritance 303 // noninherited_flags.explicitInheritance
304 304
305 // unique() styles are not cacheable. 305 // unique() styles are not cacheable.
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1874 if (!shadowList) 1874 if (!shadowList)
1875 return false; 1875 return false;
1876 for (size_t i = shadowList->shadows().size(); i--; ) { 1876 for (size_t i = shadowList->shadows().size(); i--; ) {
1877 if (shadowList->shadows()[i].color().isCurrentColor()) 1877 if (shadowList->shadows()[i].color().isCurrentColor())
1878 return true; 1878 return true;
1879 } 1879 }
1880 return false; 1880 return false;
1881 } 1881 }
1882 1882
1883 } // namespace blink 1883 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | third_party/WebKit/Source/core/style/ComputedStyleConstants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698