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

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

Issue 2151933003: Change WTF::TemporaryChange to be an alias for AutoReset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 RefPtr<Image> image = styleImage->image(m_layoutBox, flooredIntSize(imageSiz e), m_layoutBox.style()->effectiveZoom()); 138 RefPtr<Image> image = styleImage->image(m_layoutBox, flooredIntSize(imageSiz e), m_layoutBox.style()->effectiveZoom());
139 139
140 return Shape::createRasterShape(image.get(), shapeImageThreshold, imageRect, marginRect, writingMode, margin); 140 return Shape::createRasterShape(image.get(), shapeImageThreshold, imageRect, marginRect, writingMode, margin);
141 } 141 }
142 142
143 const Shape& ShapeOutsideInfo::computedShape() const 143 const Shape& ShapeOutsideInfo::computedShape() const
144 { 144 {
145 if (Shape* shape = m_shape.get()) 145 if (Shape* shape = m_shape.get())
146 return *shape; 146 return *shape;
147 147
148 TemporaryChange<bool> isInComputingShape(m_isComputingShape, true); 148 TemporaryChange<bool> isInComputingShape(&m_isComputingShape, true);
149 149
150 const ComputedStyle& style = *m_layoutBox.style(); 150 const ComputedStyle& style = *m_layoutBox.style();
151 ASSERT(m_layoutBox.containingBlock()); 151 ASSERT(m_layoutBox.containingBlock());
152 const ComputedStyle& containingBlockStyle = *m_layoutBox.containingBlock()-> style(); 152 const ComputedStyle& containingBlockStyle = *m_layoutBox.containingBlock()-> style();
153 153
154 WritingMode writingMode = containingBlockStyle.getWritingMode(); 154 WritingMode writingMode = containingBlockStyle.getWritingMode();
155 // Make sure contentWidth is not negative. This can happen when containing b lock has a vertical scrollbar and 155 // Make sure contentWidth is not negative. This can happen when containing b lock has a vertical scrollbar and
156 // its content is smaller than the scrollbar width. 156 // its content is smaller than the scrollbar width.
157 LayoutUnit maximumValue = m_layoutBox.containingBlock() ? std::max(LayoutUni t(), m_layoutBox.containingBlock()->contentWidth()) : LayoutUnit(); 157 LayoutUnit maximumValue = m_layoutBox.containingBlock() ? std::max(LayoutUni t(), m_layoutBox.containingBlock()->contentWidth()) : LayoutUnit();
158 float margin = floatValueForLength(m_layoutBox.style()->shapeMargin(), maxim umValue.toFloat()); 158 float margin = floatValueForLength(m_layoutBox.style()->shapeMargin(), maxim umValue.toFloat());
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 } 345 }
346 346
347 FloatSize ShapeOutsideInfo::shapeToLayoutObjectSize(FloatSize size) const 347 FloatSize ShapeOutsideInfo::shapeToLayoutObjectSize(FloatSize size) const
348 { 348 {
349 if (!m_layoutBox.style()->isHorizontalWritingMode()) 349 if (!m_layoutBox.style()->isHorizontalWritingMode())
350 return size.transposedSize(); 350 return size.transposedSize();
351 return size; 351 return size;
352 } 352 }
353 353
354 } // namespace blink 354 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698