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

Side by Side Diff: third_party/WebKit/Source/core/layout/shapes/ShapeOutsideInfo.cpp

Issue 1743803002: Rename enums/functions that collide in chromium style in core/style/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@get-names-8
Patch Set: get-names-9: rebase Created 4 years, 9 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) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 Adobe Systems Incorporated. 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 { 143 {
144 if (Shape* shape = m_shape.get()) 144 if (Shape* shape = m_shape.get())
145 return *shape; 145 return *shape;
146 146
147 TemporaryChange<bool> isInComputingShape(m_isComputingShape, true); 147 TemporaryChange<bool> isInComputingShape(m_isComputingShape, true);
148 148
149 const ComputedStyle& style = *m_layoutBox.style(); 149 const ComputedStyle& style = *m_layoutBox.style();
150 ASSERT(m_layoutBox.containingBlock()); 150 ASSERT(m_layoutBox.containingBlock());
151 const ComputedStyle& containingBlockStyle = *m_layoutBox.containingBlock()-> style(); 151 const ComputedStyle& containingBlockStyle = *m_layoutBox.containingBlock()-> style();
152 152
153 WritingMode writingMode = containingBlockStyle.writingMode(); 153 WritingMode writingMode = containingBlockStyle.getWritingMode();
154 // Make sure contentWidth is not negative. This can happen when containing b lock has a vertical scrollbar and 154 // Make sure contentWidth is not negative. This can happen when containing b lock has a vertical scrollbar and
155 // its content is smaller than the scrollbar width. 155 // its content is smaller than the scrollbar width.
156 LayoutUnit maximumValue = m_layoutBox.containingBlock() ? std::max(LayoutUni t(), m_layoutBox.containingBlock()->contentWidth()) : LayoutUnit(); 156 LayoutUnit maximumValue = m_layoutBox.containingBlock() ? std::max(LayoutUni t(), m_layoutBox.containingBlock()->contentWidth()) : LayoutUnit();
157 float margin = floatValueForLength(m_layoutBox.style()->shapeMargin(), maxim umValue.toFloat()); 157 float margin = floatValueForLength(m_layoutBox.style()->shapeMargin(), maxim umValue.toFloat());
158 158
159 float shapeImageThreshold = style.shapeImageThreshold(); 159 float shapeImageThreshold = style.shapeImageThreshold();
160 ASSERT(style.shapeOutside()); 160 ASSERT(style.shapeOutside());
161 const ShapeValue& shapeValue = *style.shapeOutside(); 161 const ShapeValue& shapeValue = *style.shapeOutside();
162 162
163 switch (shapeValue.type()) { 163 switch (shapeValue.type()) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 ASSERT_NOT_REACHED(); 203 ASSERT_NOT_REACHED();
204 return layoutBox.borderAndPaddingBefore(); 204 return layoutBox.borderAndPaddingBefore();
205 } 205 }
206 206
207 LayoutUnit ShapeOutsideInfo::logicalTopOffset() const 207 LayoutUnit ShapeOutsideInfo::logicalTopOffset() const
208 { 208 {
209 switch (referenceBox(*m_layoutBox.style()->shapeOutside())) { 209 switch (referenceBox(*m_layoutBox.style()->shapeOutside())) {
210 case MarginBox: return -m_layoutBox.marginBefore(m_layoutBox.containingBlock ()->style()); 210 case MarginBox: return -m_layoutBox.marginBefore(m_layoutBox.containingBlock ()->style());
211 case BorderBox: return LayoutUnit(); 211 case BorderBox: return LayoutUnit();
212 case PaddingBox: return borderBeforeInWritingMode(m_layoutBox, m_layoutBox.c ontainingBlock()->style()->writingMode()); 212 case PaddingBox: return borderBeforeInWritingMode(m_layoutBox, m_layoutBox.c ontainingBlock()->style()->getWritingMode());
213 case ContentBox: return borderAndPaddingBeforeInWritingMode(m_layoutBox, m_l ayoutBox.containingBlock()->style()->writingMode()); 213 case ContentBox: return borderAndPaddingBeforeInWritingMode(m_layoutBox, m_l ayoutBox.containingBlock()->style()->getWritingMode());
214 case BoxMissing: break; 214 case BoxMissing: break;
215 } 215 }
216 216
217 ASSERT_NOT_REACHED(); 217 ASSERT_NOT_REACHED();
218 return LayoutUnit(); 218 return LayoutUnit();
219 } 219 }
220 220
221 inline LayoutUnit borderStartWithStyleForWritingMode(const LayoutBox& layoutBox, const ComputedStyle* style) 221 inline LayoutUnit borderStartWithStyleForWritingMode(const LayoutBox& layoutBox, const ComputedStyle* style)
222 { 222 {
223 if (style->isHorizontalWritingMode()) { 223 if (style->isHorizontalWritingMode()) {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 344 }
345 345
346 FloatSize ShapeOutsideInfo::shapeToLayoutObjectSize(FloatSize size) const 346 FloatSize ShapeOutsideInfo::shapeToLayoutObjectSize(FloatSize size) const
347 { 347 {
348 if (!m_layoutBox.style()->isHorizontalWritingMode()) 348 if (!m_layoutBox.style()->isHorizontalWritingMode())
349 return size.transposedSize(); 349 return size.transposedSize();
350 return size; 350 return size;
351 } 351 }
352 352
353 } // namespace blink 353 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/shapes/Shape.cpp ('k') | third_party/WebKit/Source/core/paint/BoxPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698