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

Side by Side Diff: Source/core/rendering/RenderBlock.h

Issue 23084002: Use the outermost float for shape-outside (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 template <FloatingObject::Type FloatTypeValue> 1174 template <FloatingObject::Type FloatTypeValue>
1175 class ComputeFloatOffsetAdapter { 1175 class ComputeFloatOffsetAdapter {
1176 public: 1176 public:
1177 typedef FloatingObjectInterval IntervalType; 1177 typedef FloatingObjectInterval IntervalType;
1178 1178
1179 ComputeFloatOffsetAdapter(const RenderBlock* renderer, int lineTop, int lineBottom, LayoutUnit& offset) 1179 ComputeFloatOffsetAdapter(const RenderBlock* renderer, int lineTop, int lineBottom, LayoutUnit& offset)
1180 : m_renderer(renderer) 1180 : m_renderer(renderer)
1181 , m_lineTop(lineTop) 1181 , m_lineTop(lineTop)
1182 , m_lineBottom(lineBottom) 1182 , m_lineBottom(lineBottom)
1183 , m_offset(offset) 1183 , m_offset(offset)
1184 , m_last(0) 1184 , m_outermostFloat(0)
1185 , m_floatForHeight(0)
1186 { 1185 {
1187 } 1186 }
1188 1187
1189 inline int lowValue() const { return m_lineTop; } 1188 inline int lowValue() const { return m_lineTop; }
1190 inline int highValue() const { return m_lineBottom; } 1189 inline int highValue() const { return m_lineBottom; }
1191 void collectIfNeeded(const IntervalType&); 1190 void collectIfNeeded(const IntervalType&);
1192 1191
1193 // When computing the offset caused by the floats on a given line, if 1192 // When computing the offset caused by the floats on a given line, if
1194 // the outermost float on that line has a shape-outside, the inline 1193 // the outermost float on that line has a shape-outside, the inline
1195 // content that butts up against that float must be positioned using 1194 // content that butts up against that float must be positioned using
1196 // the contours of the shape, not the margin box of the float. 1195 // the contours of the shape, not the margin box of the float.
1197 // We save the last float encountered so that the offset can be 1196 const FloatingObject* outermostFloat() const { return m_outermostFloat; }
1198 // computed correctly by the code using this adapter.
1199 const FloatingObject* lastFloat() const { return m_last; }
1200 1197
1201 LayoutUnit getHeightRemaining() const; 1198 LayoutUnit getHeightRemaining() const;
1202 1199
1203 private: 1200 private:
1204 bool updateOffsetIfNeeded(const FloatingObject*); 1201 bool updateOffsetIfNeeded(const FloatingObject*);
1205 1202
1206 const RenderBlock* m_renderer; 1203 const RenderBlock* m_renderer;
1207 int m_lineTop; 1204 int m_lineTop;
1208 int m_lineBottom; 1205 int m_lineBottom;
1209 LayoutUnit& m_offset; 1206 LayoutUnit& m_offset;
1210 const FloatingObject* m_last; 1207 const FloatingObject* m_outermostFloat;
1211 const FloatingObject* m_floatForHeight;
1212 }; 1208 };
1213 1209
1214 void createFloatingObjects(); 1210 void createFloatingObjects();
1215 1211
1216 public: 1212 public:
1217 1213
1218 class FloatingObjects { 1214 class FloatingObjects {
1219 WTF_MAKE_NONCOPYABLE(FloatingObjects); WTF_MAKE_FAST_ALLOCATED; 1215 WTF_MAKE_NONCOPYABLE(FloatingObjects); WTF_MAKE_FAST_ALLOCATED;
1220 public: 1216 public:
1221 void clear(); 1217 void clear();
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 static String string(const int value); 1343 static String string(const int value);
1348 }; 1344 };
1349 template<> struct ValueToString<RenderBlock::FloatingObject*> { 1345 template<> struct ValueToString<RenderBlock::FloatingObject*> {
1350 static String string(const RenderBlock::FloatingObject*); 1346 static String string(const RenderBlock::FloatingObject*);
1351 }; 1347 };
1352 #endif 1348 #endif
1353 1349
1354 } // namespace WebCore 1350 } // namespace WebCore
1355 1351
1356 #endif // RenderBlock_h 1352 #endif // RenderBlock_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698