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 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1438 // FIXME: Why is this only done when we had runs? | 1438 // FIXME: Why is this only done when we had runs? |
1439 lineInfo.setLastLine(!end.m_obj); | 1439 lineInfo.setLastLine(!end.m_obj); |
1440 | 1440 |
1441 RootInlineBox* lineBox = constructLine(bidiRuns, lineInfo); | 1441 RootInlineBox* lineBox = constructLine(bidiRuns, lineInfo); |
1442 if (!lineBox) | 1442 if (!lineBox) |
1443 return 0; | 1443 return 0; |
1444 | 1444 |
1445 lineBox->setBidiLevel(bidiLevel); | 1445 lineBox->setBidiLevel(bidiLevel); |
1446 lineBox->setEndsWithBreak(lineInfo.previousLineBrokeCleanly()); | 1446 lineBox->setEndsWithBreak(lineInfo.previousLineBrokeCleanly()); |
1447 | 1447 |
1448 bool isSVGRootInlineBox = lineBox->isSVGRootInlineBox(); | |
tkent
2013/09/12 22:45:13
You don't need to remove this local variable. isS
| |
1449 | |
1450 GlyphOverflowAndFallbackFontsMap textBoxDataMap; | 1448 GlyphOverflowAndFallbackFontsMap textBoxDataMap; |
1451 | 1449 |
1452 // Now we position all of our text runs horizontally. | 1450 // Now we position all of our text runs horizontally. |
1453 if (!isSVGRootInlineBox) | 1451 if (!lineBox->isSVGRootInlineBox()) |
1454 computeInlineDirectionPositionsForLine(lineBox, lineInfo, bidiRuns.first Run(), trailingSpaceRun, end.atEnd(), textBoxDataMap, verticalPositionCache, wor dMeasurements); | 1452 computeInlineDirectionPositionsForLine(lineBox, lineInfo, bidiRuns.first Run(), trailingSpaceRun, end.atEnd(), textBoxDataMap, verticalPositionCache, wor dMeasurements); |
1455 | 1453 |
1456 // Now position our text runs vertically. | 1454 // Now position our text runs vertically. |
1457 computeBlockDirectionPositionsForLine(lineBox, bidiRuns.firstRun(), textBoxD ataMap, verticalPositionCache); | 1455 computeBlockDirectionPositionsForLine(lineBox, bidiRuns.firstRun(), textBoxD ataMap, verticalPositionCache); |
1458 | 1456 |
1459 // SVG text layout code computes vertical & horizontal positions on its own. | 1457 // SVG text layout code computes vertical & horizontal positions on its own. |
1460 // Note that we still need to execute computeVerticalPositionsForLine() as | 1458 // Note that we still need to execute computeVerticalPositionsForLine() as |
1461 // it calls InlineTextBox::positionLineBox(), which tracks whether the box | 1459 // it calls InlineTextBox::positionLineBox(), which tracks whether the box |
1462 // contains reversed text or not. If we wouldn't do that editing and thus | 1460 // contains reversed text or not. If we wouldn't do that editing and thus |
1463 // text selection in RTL boxes would not work as expected. | 1461 // text selection in RTL boxes would not work as expected. |
1464 if (isSVGRootInlineBox) { | 1462 if (lineBox->isSVGRootInlineBox()) { |
1465 ASSERT(isSVGText()); | 1463 ASSERT(isSVGText()); |
1466 static_cast<SVGRootInlineBox*>(lineBox)->computePerCharacterLayoutInform ation(); | 1464 toSVGRootInlineBox(lineBox)->computePerCharacterLayoutInformation(); |
1467 } | 1465 } |
1468 | 1466 |
1469 // Compute our overflow now. | 1467 // Compute our overflow now. |
1470 lineBox->computeOverflow(lineBox->lineTop(), lineBox->lineBottom(), textBoxD ataMap); | 1468 lineBox->computeOverflow(lineBox->lineTop(), lineBox->lineBottom(), textBoxD ataMap); |
1471 | 1469 |
1472 return lineBox; | 1470 return lineBox; |
1473 } | 1471 } |
1474 | 1472 |
1475 // Like LayoutState for layout(), LineLayoutState keeps track of global informat ion | 1473 // Like LayoutState for layout(), LineLayoutState keeps track of global informat ion |
1476 // during an entire linebox tree layout pass (aka layoutInlineChildren). | 1474 // during an entire linebox tree layout pass (aka layoutInlineChildren). |
(...skipping 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3559 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver ticalPositionCache); | 3557 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver ticalPositionCache); |
3560 | 3558 |
3561 setLineGridBox(lineGridBox); | 3559 setLineGridBox(lineGridBox); |
3562 | 3560 |
3563 // FIXME: If any of the characteristics of the box change compared to the ol d one, then we need to do a deep dirtying | 3561 // FIXME: If any of the characteristics of the box change compared to the ol d one, then we need to do a deep dirtying |
3564 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping | 3562 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping |
3565 // to this grid. | 3563 // to this grid. |
3566 } | 3564 } |
3567 | 3565 |
3568 } | 3566 } |
OLD | NEW |