| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. |
| 4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. 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 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(
); | 1057 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(
); |
| 1058 FloatingObjectSetIterator it = floatingObjectSet.begin(); | 1058 FloatingObjectSetIterator it = floatingObjectSet.begin(); |
| 1059 FloatingObjectSetIterator end = floatingObjectSet.end(); | 1059 FloatingObjectSetIterator end = floatingObjectSet.end(); |
| 1060 if (layoutState.lastFloat()) { | 1060 if (layoutState.lastFloat()) { |
| 1061 FloatingObjectSetIterator lastFloatIterator = floatingObjectSet.
find(layoutState.lastFloat()); | 1061 FloatingObjectSetIterator lastFloatIterator = floatingObjectSet.
find(layoutState.lastFloat()); |
| 1062 ASSERT(lastFloatIterator != end); | 1062 ASSERT(lastFloatIterator != end); |
| 1063 ++lastFloatIterator; | 1063 ++lastFloatIterator; |
| 1064 it = lastFloatIterator; | 1064 it = lastFloatIterator; |
| 1065 } | 1065 } |
| 1066 for (; it != end; ++it) { | 1066 for (; it != end; ++it) { |
| 1067 FloatingObject* f = (*it).get(); | 1067 FloatingObject* f = it->get(); |
| 1068 appendFloatingObjectToLastLine(f); | 1068 appendFloatingObjectToLastLine(f); |
| 1069 ASSERT(f->renderer() == layoutState.floats()[layoutState.floatIn
dex()].object); | 1069 ASSERT(f->renderer() == layoutState.floats()[layoutState.floatIn
dex()].object); |
| 1070 // If a float's geometry has changed, give up on syncing with cl
ean lines. | 1070 // If a float's geometry has changed, give up on syncing with cl
ean lines. |
| 1071 if (layoutState.floats()[layoutState.floatIndex()].rect != f->fr
ameRect()) | 1071 if (layoutState.floats()[layoutState.floatIndex()].rect != f->fr
ameRect()) |
| 1072 checkForEndLineMatch = false; | 1072 checkForEndLineMatch = false; |
| 1073 layoutState.setFloatIndex(layoutState.floatIndex() + 1); | 1073 layoutState.setFloatIndex(layoutState.floatIndex() + 1); |
| 1074 } | 1074 } |
| 1075 layoutState.setLastFloat(!floatingObjectSet.isEmpty() ? floatingObje
ctSet.last().get() : 0); | 1075 layoutState.setLastFloat(!floatingObjectSet.isEmpty() ? floatingObje
ctSet.last().get() : 0); |
| 1076 } | 1076 } |
| 1077 | 1077 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | 1201 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); |
| 1202 FloatingObjectSetIterator it = floatingObjectSet.begin(); | 1202 FloatingObjectSetIterator it = floatingObjectSet.begin(); |
| 1203 FloatingObjectSetIterator end = floatingObjectSet.end(); | 1203 FloatingObjectSetIterator end = floatingObjectSet.end(); |
| 1204 if (layoutState.lastFloat()) { | 1204 if (layoutState.lastFloat()) { |
| 1205 FloatingObjectSetIterator lastFloatIterator = floatingObjectSet.find
(layoutState.lastFloat()); | 1205 FloatingObjectSetIterator lastFloatIterator = floatingObjectSet.find
(layoutState.lastFloat()); |
| 1206 ASSERT(lastFloatIterator != end); | 1206 ASSERT(lastFloatIterator != end); |
| 1207 ++lastFloatIterator; | 1207 ++lastFloatIterator; |
| 1208 it = lastFloatIterator; | 1208 it = lastFloatIterator; |
| 1209 } | 1209 } |
| 1210 for (; it != end; ++it) | 1210 for (; it != end; ++it) |
| 1211 appendFloatingObjectToLastLine((*it).get()); | 1211 appendFloatingObjectToLastLine(it->get()); |
| 1212 layoutState.setLastFloat(!floatingObjectSet.isEmpty() ? floatingObjectSe
t.last().get() : 0); | 1212 layoutState.setLastFloat(!floatingObjectSet.isEmpty() ? floatingObjectSe
t.last().get() : 0); |
| 1213 } | 1213 } |
| 1214 } | 1214 } |
| 1215 | 1215 |
| 1216 void RenderBlockFlow::repaintDirtyFloats(Vector<FloatWithRect>& floats) | 1216 void RenderBlockFlow::repaintDirtyFloats(Vector<FloatWithRect>& floats) |
| 1217 { | 1217 { |
| 1218 size_t floatCount = floats.size(); | 1218 size_t floatCount = floats.size(); |
| 1219 // Floats that did not have layout did not repaint when we laid them out. Th
ey would have | 1219 // Floats that did not have layout did not repaint when we laid them out. Th
ey would have |
| 1220 // painted by now if they had moved, but if they stayed at (0, 0), they stil
l need to be | 1220 // painted by now if they had moved, but if they stayed at (0, 0), they stil
l need to be |
| 1221 // painted. | 1221 // painted. |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1975 | 1975 |
| 1976 RootInlineBox* lastLine = layoutState.endLine(); | 1976 RootInlineBox* lastLine = layoutState.endLine(); |
| 1977 while (RootInlineBox* nextLine = lastLine->nextRootBox()) | 1977 while (RootInlineBox* nextLine = lastLine->nextRootBox()) |
| 1978 lastLine = nextLine; | 1978 lastLine = nextLine; |
| 1979 | 1979 |
| 1980 LayoutUnit logicalBottom = lastLine->lineBottomWithLeading() + absoluteValue
(lineDelta); | 1980 LayoutUnit logicalBottom = lastLine->lineBottomWithLeading() + absoluteValue
(lineDelta); |
| 1981 | 1981 |
| 1982 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | 1982 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); |
| 1983 FloatingObjectSetIterator end = floatingObjectSet.end(); | 1983 FloatingObjectSetIterator end = floatingObjectSet.end(); |
| 1984 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++
it) { | 1984 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++
it) { |
| 1985 FloatingObject* floatingObject = (*it).get(); | 1985 FloatingObject* floatingObject = it->get(); |
| 1986 if (logicalBottomForFloat(floatingObject) >= logicalTop && logicalBottom
ForFloat(floatingObject) < logicalBottom) | 1986 if (logicalBottomForFloat(floatingObject) >= logicalTop && logicalBottom
ForFloat(floatingObject) < logicalBottom) |
| 1987 return false; | 1987 return false; |
| 1988 } | 1988 } |
| 1989 | 1989 |
| 1990 return true; | 1990 return true; |
| 1991 } | 1991 } |
| 1992 | 1992 |
| 1993 bool RenderBlockFlow::matchedEndLine(LineLayoutState& layoutState, const InlineB
idiResolver& resolver, const InlineIterator& endLineStart, const BidiStatus& end
LineStatus) | 1993 bool RenderBlockFlow::matchedEndLine(LineLayoutState& layoutState, const InlineB
idiResolver& resolver, const InlineIterator& endLineStart, const BidiStatus& end
LineStatus) |
| 1994 { | 1994 { |
| 1995 if (resolver.position() == endLineStart) { | 1995 if (resolver.position() == endLineStart) { |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 int paginationStrut = newFloat->paginationStrut(); | 2148 int paginationStrut = newFloat->paginationStrut(); |
| 2149 | 2149 |
| 2150 if (floatLogicalTop - paginationStrut != logicalHeight() + lineInfo.floatPag
inationStrut()) | 2150 if (floatLogicalTop - paginationStrut != logicalHeight() + lineInfo.floatPag
inationStrut()) |
| 2151 return true; | 2151 return true; |
| 2152 | 2152 |
| 2153 FloatingObjectSetIterator it = floatingObjectSet.end(); | 2153 FloatingObjectSetIterator it = floatingObjectSet.end(); |
| 2154 --it; // Last float is newFloat, skip that one. | 2154 --it; // Last float is newFloat, skip that one. |
| 2155 FloatingObjectSetIterator begin = floatingObjectSet.begin(); | 2155 FloatingObjectSetIterator begin = floatingObjectSet.begin(); |
| 2156 while (it != begin) { | 2156 while (it != begin) { |
| 2157 --it; | 2157 --it; |
| 2158 FloatingObject* floatingObject = (*it).get(); | 2158 FloatingObject* floatingObject = it->get(); |
| 2159 if (floatingObject == lastFloatFromPreviousLine) | 2159 if (floatingObject == lastFloatFromPreviousLine) |
| 2160 break; | 2160 break; |
| 2161 if (logicalTopForFloat(floatingObject) == logicalHeight() + lineInfo.flo
atPaginationStrut()) { | 2161 if (logicalTopForFloat(floatingObject) == logicalHeight() + lineInfo.flo
atPaginationStrut()) { |
| 2162 floatingObject->setPaginationStrut(paginationStrut + floatingObject-
>paginationStrut()); | 2162 floatingObject->setPaginationStrut(paginationStrut + floatingObject-
>paginationStrut()); |
| 2163 RenderBox* floatBox = floatingObject->renderer(); | 2163 RenderBox* floatBox = floatingObject->renderer(); |
| 2164 setLogicalTopForChild(floatBox, logicalTopForChild(floatBox) + margi
nBeforeForChild(floatBox) + paginationStrut); | 2164 setLogicalTopForChild(floatBox, logicalTopForChild(floatBox) + margi
nBeforeForChild(floatBox) + paginationStrut); |
| 2165 if (floatBox->isRenderBlock()) | 2165 if (floatBox->isRenderBlock()) |
| 2166 floatBox->forceChildLayout(); | 2166 floatBox->forceChildLayout(); |
| 2167 else | 2167 else |
| 2168 floatBox->layoutIfNeeded(); | 2168 floatBox->layoutIfNeeded(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 2193 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat
(); | 2193 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat
(); |
| 2194 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal
se) - logicalLeft; | 2194 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal
se) - logicalLeft; |
| 2195 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); | 2195 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); |
| 2196 | 2196 |
| 2197 if (!style()->isLeftToRightDirection()) | 2197 if (!style()->isLeftToRightDirection()) |
| 2198 return logicalWidth() - logicalLeft; | 2198 return logicalWidth() - logicalLeft; |
| 2199 return logicalLeft; | 2199 return logicalLeft; |
| 2200 } | 2200 } |
| 2201 | 2201 |
| 2202 } | 2202 } |
| OLD | NEW |