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

Side by Side Diff: Source/core/rendering/RenderBlockFlow.cpp

Issue 811843003: replace COMPILE_ASSERT with static_assert in core/rendering/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « Source/core/rendering/RenderBlock.cpp ('k') | Source/core/rendering/RenderInline.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 namespace blink { 54 namespace blink {
55 55
56 bool RenderBlockFlow::s_canPropagateFloatIntoSibling = false; 56 bool RenderBlockFlow::s_canPropagateFloatIntoSibling = false;
57 57
58 struct SameSizeAsMarginInfo { 58 struct SameSizeAsMarginInfo {
59 uint16_t bitfields; 59 uint16_t bitfields;
60 LayoutUnit margins[2]; 60 LayoutUnit margins[2];
61 }; 61 };
62 62
63 COMPILE_ASSERT(sizeof(RenderBlockFlow::MarginValues) == sizeof(LayoutUnit[4]), M arginValues_should_stay_small); 63 static_assert(sizeof(RenderBlockFlow::MarginValues) == sizeof(LayoutUnit[4]), "M arginValues should stay small");
64 64
65 class MarginInfo { 65 class MarginInfo {
66 // Collapsing flags for whether we can collapse our margins with our childre n's margins. 66 // Collapsing flags for whether we can collapse our margins with our childre n's margins.
67 bool m_canCollapseWithChildren : 1; 67 bool m_canCollapseWithChildren : 1;
68 bool m_canCollapseMarginBeforeWithChildren : 1; 68 bool m_canCollapseMarginBeforeWithChildren : 1;
69 bool m_canCollapseMarginAfterWithChildren : 1; 69 bool m_canCollapseMarginAfterWithChildren : 1;
70 bool m_canCollapseMarginAfterWithLastChild: 1; 70 bool m_canCollapseMarginAfterWithLastChild: 1;
71 71
72 // Whether or not we are a quirky container, i.e., do we collapse away top a nd bottom 72 // Whether or not we are a quirky container, i.e., do we collapse away top a nd bottom
73 // margins in our container. Table cells and the body are the common example s. We 73 // margins in our container. Table cells and the body are the common example s. We
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 } 158 }
159 159
160 void RenderBlockFlow::RenderBlockFlowRareData::trace(Visitor* visitor) 160 void RenderBlockFlow::RenderBlockFlowRareData::trace(Visitor* visitor)
161 { 161 {
162 visitor->trace(m_multiColumnFlowThread); 162 visitor->trace(m_multiColumnFlowThread);
163 } 163 }
164 164
165 RenderBlockFlow::RenderBlockFlow(ContainerNode* node) 165 RenderBlockFlow::RenderBlockFlow(ContainerNode* node)
166 : RenderBlock(node) 166 : RenderBlock(node)
167 { 167 {
168 COMPILE_ASSERT(sizeof(MarginInfo) == sizeof(SameSizeAsMarginInfo), MarginInf o_should_stay_small); 168 static_assert(sizeof(MarginInfo) == sizeof(SameSizeAsMarginInfo), "MarginInf o should stay small");
169 setChildrenInline(true); 169 setChildrenInline(true);
170 } 170 }
171 171
172 RenderBlockFlow::~RenderBlockFlow() 172 RenderBlockFlow::~RenderBlockFlow()
173 { 173 {
174 } 174 }
175 175
176 void RenderBlockFlow::trace(Visitor* visitor) 176 void RenderBlockFlow::trace(Visitor* visitor)
177 { 177 {
178 visitor->trace(m_rareData); 178 visitor->trace(m_rareData);
(...skipping 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after
3113 FrameView* frameView = document().view(); 3113 FrameView* frameView = document().view();
3114 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); 3114 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height();
3115 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); 3115 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( );
3116 if (size().height() < visibleHeight) 3116 if (size().height() < visibleHeight)
3117 top += (visibleHeight - size().height()) / 2; 3117 top += (visibleHeight - size().height()) / 2;
3118 setY(top); 3118 setY(top);
3119 dialog->setCentered(top); 3119 dialog->setCentered(top);
3120 } 3120 }
3121 3121
3122 } // namespace blink 3122 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlock.cpp ('k') | Source/core/rendering/RenderInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698