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. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
4 * All right reserved. | 4 * All right reserved. |
5 * Copyright (C) 2010 Google Inc. All rights reserved. | 5 * Copyright (C) 2010 Google Inc. All rights 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 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 } | 1357 } |
1358 if (delta) | 1358 if (delta) |
1359 line->moveInBlockDirection(delta); | 1359 line->moveInBlockDirection(delta); |
1360 if (Vector<LayoutBox*>* cleanLineFloats = line->floatsPtr()) { | 1360 if (Vector<LayoutBox*>* cleanLineFloats = line->floatsPtr()) { |
1361 for (auto* box : *cleanLineFloats) { | 1361 for (auto* box : *cleanLineFloats) { |
1362 FloatingObject* floatingObject = insertFloatingObject(*box); | 1362 FloatingObject* floatingObject = insertFloatingObject(*box); |
1363 ASSERT(!floatingObject->originatingLine()); | 1363 ASSERT(!floatingObject->originatingLine()); |
1364 floatingObject->setOriginatingLine(line); | 1364 floatingObject->setOriginatingLine(line); |
1365 LayoutUnit logicalTop = | 1365 LayoutUnit logicalTop = |
1366 logicalTopForChild(*box) - marginBeforeForChild(*box) + delta; | 1366 logicalTopForChild(*box) - marginBeforeForChild(*box) + delta; |
1367 positionNewFloats(logicalTop); | 1367 placeNewFloats(logicalTop); |
1368 } | 1368 } |
1369 } | 1369 } |
1370 } | 1370 } |
1371 setLogicalHeight(lastRootBox()->lineBottomWithLeading()); | 1371 setLogicalHeight(lastRootBox()->lineBottomWithLeading()); |
1372 } else { | 1372 } else { |
1373 // Delete all the remaining lines. | 1373 // Delete all the remaining lines. |
1374 deleteLineRange(layoutState, layoutState.endLine()); | 1374 deleteLineRange(layoutState, layoutState.endLine()); |
1375 } | 1375 } |
1376 } | 1376 } |
1377 | 1377 |
1378 // In case we have a float on the last line, it might not be positioned up to | 1378 // In case we have a float on the last line, it might not be positioned up to |
1379 // now. This has to be done before adding in the bottom border/padding, or the | 1379 // now. This has to be done before adding in the bottom border/padding, or the |
1380 // float will | 1380 // float will |
1381 // include the padding incorrectly. -dwh | 1381 // include the padding incorrectly. -dwh |
1382 if (positionNewFloats(logicalHeight()) && lastRootBox()) | 1382 if (placeNewFloats(logicalHeight()) && lastRootBox()) |
1383 appendFloatsToLastLine(layoutState, InlineIterator(), InlineBidiResolver(), | 1383 appendFloatsToLastLine(layoutState, InlineIterator(), InlineBidiResolver(), |
1384 BidiStatus()); | 1384 BidiStatus()); |
1385 } | 1385 } |
1386 | 1386 |
1387 void LayoutBlockFlow::markDirtyFloatsForPaintInvalidation( | 1387 void LayoutBlockFlow::markDirtyFloatsForPaintInvalidation( |
1388 Vector<FloatWithRect>& floats) { | 1388 Vector<FloatWithRect>& floats) { |
1389 size_t floatCount = floats.size(); | 1389 size_t floatCount = floats.size(); |
1390 // Floats that did not have layout did not paint invalidations when we laid | 1390 // Floats that did not have layout did not paint invalidations when we laid |
1391 // them out. They would have painted by now if they had moved, but if they | 1391 // them out. They would have painted by now if they had moved, but if they |
1392 // stayed at (0, 0), they still need to be painted. | 1392 // stayed at (0, 0), they still need to be painted. |
1393 for (size_t i = 0; i < floatCount; ++i) { | 1393 for (size_t i = 0; i < floatCount; ++i) { |
1394 LayoutBox* f = floats[i].object; | 1394 LayoutBox* f = floats[i].object; |
1395 if (!floats[i].everHadLayout) { | 1395 if (!floats[i].everHadLayout) { |
1396 if (!f->location().x() && !f->location().y()) | 1396 if (!f->location().x() && !f->location().y()) |
1397 f->setShouldDoFullPaintInvalidation(); | 1397 f->setShouldDoFullPaintInvalidation(); |
1398 } | 1398 } |
1399 insertFloatingObject(*f); | 1399 insertFloatingObject(*f); |
1400 } | 1400 } |
1401 positionNewFloats(logicalHeight()); | 1401 placeNewFloats(logicalHeight()); |
1402 } | 1402 } |
1403 | 1403 |
1404 // InlineMinMaxIterator is a class that will iterate over all layout objects | 1404 // InlineMinMaxIterator is a class that will iterate over all layout objects |
1405 // that contribute to inline min/max width calculations. Note the following | 1405 // that contribute to inline min/max width calculations. Note the following |
1406 // about the way it walks: | 1406 // about the way it walks: |
1407 // (1) Positioned content is skipped (since it does not contribute to min/max | 1407 // (1) Positioned content is skipped (since it does not contribute to min/max |
1408 // width of a block) | 1408 // width of a block) |
1409 // (2) We do not drill into the children of floats or replaced elements, since | 1409 // (2) We do not drill into the children of floats or replaced elements, since |
1410 // you can't break in the middle of such an element. | 1410 // you can't break in the middle of such an element. |
1411 // (3) Inline flows (e.g., <a>, <span>, <i>) are walked twice, since each side | 1411 // (3) Inline flows (e.g., <a>, <span>, <i>) are walked twice, since each side |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2081 // Restore floats from clean lines. | 2081 // Restore floats from clean lines. |
2082 RootInlineBox* line = firstRootBox(); | 2082 RootInlineBox* line = firstRootBox(); |
2083 while (line != curr) { | 2083 while (line != curr) { |
2084 if (Vector<LayoutBox*>* cleanLineFloats = line->floatsPtr()) { | 2084 if (Vector<LayoutBox*>* cleanLineFloats = line->floatsPtr()) { |
2085 for (auto* box : *cleanLineFloats) { | 2085 for (auto* box : *cleanLineFloats) { |
2086 FloatingObject* floatingObject = insertFloatingObject(*box); | 2086 FloatingObject* floatingObject = insertFloatingObject(*box); |
2087 ASSERT(!floatingObject->originatingLine()); | 2087 ASSERT(!floatingObject->originatingLine()); |
2088 floatingObject->setOriginatingLine(line); | 2088 floatingObject->setOriginatingLine(line); |
2089 LayoutUnit logicalTop = | 2089 LayoutUnit logicalTop = |
2090 logicalTopForChild(*box) - marginBeforeForChild(*box); | 2090 logicalTopForChild(*box) - marginBeforeForChild(*box); |
2091 positionNewFloats(logicalTop); | 2091 placeNewFloats(logicalTop); |
2092 ASSERT(layoutState.floats()[numCleanFloats].object == box); | 2092 ASSERT(layoutState.floats()[numCleanFloats].object == box); |
2093 numCleanFloats++; | 2093 numCleanFloats++; |
2094 } | 2094 } |
2095 } | 2095 } |
2096 line = line->nextRootBox(); | 2096 line = line->nextRootBox(); |
2097 } | 2097 } |
2098 } | 2098 } |
2099 layoutState.setFloatIndex(numCleanFloats); | 2099 layoutState.setFloatIndex(numCleanFloats); |
2100 | 2100 |
2101 layoutState.lineInfo().setFirstLine(!last); | 2101 layoutState.lineInfo().setFirstLine(!last); |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2511 | 2511 |
2512 bool LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { | 2512 bool LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { |
2513 // LayoutBlockFlow is in charge of paint invalidation of the first line. | 2513 // LayoutBlockFlow is in charge of paint invalidation of the first line. |
2514 if (firstLineBox()) | 2514 if (firstLineBox()) |
2515 return false; | 2515 return false; |
2516 | 2516 |
2517 return LayoutBlock::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); | 2517 return LayoutBlock::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); |
2518 } | 2518 } |
2519 | 2519 |
2520 } // namespace blink | 2520 } // namespace blink |
OLD | NEW |