| 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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 trailingSpaceRun->m_level = 0; | 709 trailingSpaceRun->m_level = 0; |
| 710 } else { | 710 } else { |
| 711 bidiRuns.moveRunToBeginning(trailingSpaceRun); | 711 bidiRuns.moveRunToBeginning(trailingSpaceRun); |
| 712 trailingSpaceRun->m_level = 1; | 712 trailingSpaceRun->m_level = 1; |
| 713 } | 713 } |
| 714 return trailingSpaceRun; | 714 return trailingSpaceRun; |
| 715 } | 715 } |
| 716 | 716 |
| 717 void RenderBlock::appendFloatingObjectToLastLine(FloatingObject* floatingObject) | 717 void RenderBlock::appendFloatingObjectToLastLine(FloatingObject* floatingObject) |
| 718 { | 718 { |
| 719 // Ensure that the float touches the line. | 719 ASSERT(!floatingObject->m_originatingLine); |
| 720 if (RootInlineBox* previousLine = lastRootBox()->prevRootBox()) { | 720 floatingObject->m_originatingLine = lastRootBox(); |
| 721 if (logicalBottomForFloat(floatingObject) < previousLine->blockLogicalHe
ight()) | |
| 722 setLogicalHeightForFloat(floatingObject, previousLine->blockLogicalH
eight() - logicalTopForFloat(floatingObject)); | |
| 723 } | |
| 724 | |
| 725 lastRootBox()->appendFloat(floatingObject->renderer()); | 721 lastRootBox()->appendFloat(floatingObject->renderer()); |
| 726 } | 722 } |
| 727 | 723 |
| 728 void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintLogica
lTop, int& repaintLogicalBottom) | 724 void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintLogica
lTop, int& repaintLogicalBottom) |
| 729 { | 725 { |
| 730 bool useRepaintBounds = false; | 726 bool useRepaintBounds = false; |
| 731 | 727 |
| 732 m_overflow.clear(); | 728 m_overflow.clear(); |
| 733 | 729 |
| 734 setLogicalHeight(borderBefore() + paddingBefore()); | 730 setLogicalHeight(borderBefore() + paddingBefore()); |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 adjustLinePositionForPagination(line, delta); | 1030 adjustLinePositionForPagination(line, delta); |
| 1035 } | 1031 } |
| 1036 if (delta) { | 1032 if (delta) { |
| 1037 repaintLogicalTop = min(repaintLogicalTop, line->logical
TopVisualOverflow() + min(delta, 0)); | 1033 repaintLogicalTop = min(repaintLogicalTop, line->logical
TopVisualOverflow() + min(delta, 0)); |
| 1038 repaintLogicalBottom = max(repaintLogicalBottom, line->l
ogicalBottomVisualOverflow() + max(delta, 0)); | 1034 repaintLogicalBottom = max(repaintLogicalBottom, line->l
ogicalBottomVisualOverflow() + max(delta, 0)); |
| 1039 line->adjustBlockDirectionPosition(delta); | 1035 line->adjustBlockDirectionPosition(delta); |
| 1040 } | 1036 } |
| 1041 if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr())
{ | 1037 if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr())
{ |
| 1042 Vector<RenderBox*>::iterator end = cleanLineFloats->end(
); | 1038 Vector<RenderBox*>::iterator end = cleanLineFloats->end(
); |
| 1043 for (Vector<RenderBox*>::iterator f = cleanLineFloats->b
egin(); f != end; ++f) { | 1039 for (Vector<RenderBox*>::iterator f = cleanLineFloats->b
egin(); f != end; ++f) { |
| 1044 insertFloatingObject(*f); | 1040 FloatingObject* floatingObject = insertFloatingObjec
t(*f); |
| 1041 ASSERT(!floatingObject->m_originatingLine); |
| 1042 floatingObject->m_originatingLine = line; |
| 1045 setLogicalHeight(logicalTopForChild(*f) - marginBefo
reForChild(*f) + delta); | 1043 setLogicalHeight(logicalTopForChild(*f) - marginBefo
reForChild(*f) + delta); |
| 1046 positionNewFloats(); | 1044 positionNewFloats(); |
| 1047 } | 1045 } |
| 1048 } | 1046 } |
| 1049 } | 1047 } |
| 1050 setLogicalHeight(lastRootBox()->blockLogicalHeight()); | 1048 setLogicalHeight(lastRootBox()->blockLogicalHeight()); |
| 1051 } else { | 1049 } else { |
| 1052 // Delete all the remaining lines. | 1050 // Delete all the remaining lines. |
| 1053 RootInlineBox* line = endLine; | 1051 RootInlineBox* line = endLine; |
| 1054 RenderArena* arena = renderArena(); | 1052 RenderArena* arena = renderArena(); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 | 1235 |
| 1238 numCleanFloats = 0; | 1236 numCleanFloats = 0; |
| 1239 if (!floats.isEmpty()) { | 1237 if (!floats.isEmpty()) { |
| 1240 int savedLogicalHeight = logicalHeight(); | 1238 int savedLogicalHeight = logicalHeight(); |
| 1241 // Restore floats from clean lines. | 1239 // Restore floats from clean lines. |
| 1242 RootInlineBox* line = firstRootBox(); | 1240 RootInlineBox* line = firstRootBox(); |
| 1243 while (line != curr) { | 1241 while (line != curr) { |
| 1244 if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr()) { | 1242 if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr()) { |
| 1245 Vector<RenderBox*>::iterator end = cleanLineFloats->end(); | 1243 Vector<RenderBox*>::iterator end = cleanLineFloats->end(); |
| 1246 for (Vector<RenderBox*>::iterator f = cleanLineFloats->begin();
f != end; ++f) { | 1244 for (Vector<RenderBox*>::iterator f = cleanLineFloats->begin();
f != end; ++f) { |
| 1247 insertFloatingObject(*f); | 1245 FloatingObject* floatingObject = insertFloatingObject(*f); |
| 1246 ASSERT(!floatingObject->m_originatingLine); |
| 1247 floatingObject->m_originatingLine = line; |
| 1248 setLogicalHeight(logicalTopForChild(*f) - marginBeforeForChi
ld(*f)); | 1248 setLogicalHeight(logicalTopForChild(*f) - marginBeforeForChi
ld(*f)); |
| 1249 positionNewFloats(); | 1249 positionNewFloats(); |
| 1250 ASSERT(floats[numCleanFloats].object == *f); | 1250 ASSERT(floats[numCleanFloats].object == *f); |
| 1251 numCleanFloats++; | 1251 numCleanFloats++; |
| 1252 } | 1252 } |
| 1253 } | 1253 } |
| 1254 line = line->nextRootBox(); | 1254 line = line->nextRootBox(); |
| 1255 } | 1255 } |
| 1256 setLogicalHeight(savedLogicalHeight); | 1256 setLogicalHeight(savedLogicalHeight); |
| 1257 } | 1257 } |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2380 } | 2380 } |
| 2381 } | 2381 } |
| 2382 | 2382 |
| 2383 setLogicalHeight(logicalHeight() + paginationStrut); | 2383 setLogicalHeight(logicalHeight() + paginationStrut); |
| 2384 width.updateAvailableWidth(); | 2384 width.updateAvailableWidth(); |
| 2385 | 2385 |
| 2386 return true; | 2386 return true; |
| 2387 } | 2387 } |
| 2388 | 2388 |
| 2389 } | 2389 } |
| OLD | NEW |