OLD | NEW |
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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple 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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling()) { | 557 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling()) { |
558 if (curr->isFloatingOrOutOfFlowPositioned()) | 558 if (curr->isFloatingOrOutOfFlowPositioned()) |
559 continue; | 559 continue; |
560 | 560 |
561 // We want to get the margin box in the inline direction, and then use o
ur font ascent/descent in the block | 561 // We want to get the margin box in the inline direction, and then use o
ur font ascent/descent in the block |
562 // direction (aligned to the root box's baseline). | 562 // direction (aligned to the root box's baseline). |
563 if (curr->isBox()) { | 563 if (curr->isBox()) { |
564 LayoutBox* currBox = toLayoutBox(curr); | 564 LayoutBox* currBox = toLayoutBox(curr); |
565 if (currBox->inlineBoxWrapper()) { | 565 if (currBox->inlineBoxWrapper()) { |
566 RootInlineBox& rootBox = currBox->inlineBoxWrapper()->root(); | 566 RootInlineBox& rootBox = currBox->inlineBoxWrapper()->root(); |
567 LayoutUnit logicalTop = rootBox.logicalTop() + (rootBox.lineLayo
utItem().style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - cont
ainer->style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent()); | 567 LayoutUnit logicalTop = rootBox.logicalTop() + (rootBox.getLineL
ayoutItem().style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - c
ontainer->style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent()); |
568 LayoutUnit logicalHeight(container->style(rootBox.isFirstLineSty
le())->font().fontMetrics().height()); | 568 LayoutUnit logicalHeight(container->style(rootBox.isFirstLineSty
le())->font().fontMetrics().height()); |
569 if (isHorizontal) { | 569 if (isHorizontal) { |
570 yield(LayoutRect(LayoutUnit(currBox->inlineBoxWrapper()->x()
- currBox->marginLeft()), LayoutUnit(logicalTop), | 570 yield(LayoutRect(LayoutUnit(currBox->inlineBoxWrapper()->x()
- currBox->marginLeft()), LayoutUnit(logicalTop), |
571 LayoutUnit(currBox->size().width() + currBox->marginWidt
h()), LayoutUnit(logicalHeight))); | 571 LayoutUnit(currBox->size().width() + currBox->marginWidt
h()), LayoutUnit(logicalHeight))); |
572 } else { | 572 } else { |
573 yield(LayoutRect(LayoutUnit(logicalTop), LayoutUnit(currBox-
>inlineBoxWrapper()->y() - currBox->marginTop()), | 573 yield(LayoutRect(LayoutUnit(logicalTop), LayoutUnit(currBox-
>inlineBoxWrapper()->y() - currBox->marginTop()), |
574 LayoutUnit(logicalHeight), currBox->size().height() + cu
rrBox->marginHeight())); | 574 LayoutUnit(logicalHeight), currBox->size().height() + cu
rrBox->marginHeight())); |
575 } | 575 } |
576 } | 576 } |
577 } else if (curr->isLayoutInline()) { | 577 } else if (curr->isLayoutInline()) { |
578 // If the child doesn't need line boxes either, then we can recur. | 578 // If the child doesn't need line boxes either, then we can recur. |
579 LayoutInline* currInline = toLayoutInline(curr); | 579 LayoutInline* currInline = toLayoutInline(curr); |
580 if (!currInline->alwaysCreateLineBoxes()) { | 580 if (!currInline->alwaysCreateLineBoxes()) { |
581 currInline->generateCulledLineBoxRects(yield, container); | 581 currInline->generateCulledLineBoxRects(yield, container); |
582 } else { | 582 } else { |
583 for (InlineFlowBox* childLine = currInline->firstLineBox(); chil
dLine; childLine = childLine->nextLineBox()) { | 583 for (InlineFlowBox* childLine = currInline->firstLineBox(); chil
dLine; childLine = childLine->nextLineBox()) { |
584 RootInlineBox& rootBox = childLine->root(); | 584 RootInlineBox& rootBox = childLine->root(); |
585 LayoutUnit logicalTop = rootBox.logicalTop() + (rootBox.line
LayoutItem().style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() -
container->style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent()); | 585 LayoutUnit logicalTop = rootBox.logicalTop() + (rootBox.getL
ineLayoutItem().style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent()
- container->style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent()); |
586 LayoutUnit logicalHeight(container->style(rootBox.isFirstLin
eStyle())->font().fontMetrics().height()); | 586 LayoutUnit logicalHeight(container->style(rootBox.isFirstLin
eStyle())->font().fontMetrics().height()); |
587 if (isHorizontal) { | 587 if (isHorizontal) { |
588 yield(LayoutRect(LayoutUnit(childLine->x() - childLine->
marginLogicalLeft()), | 588 yield(LayoutRect(LayoutUnit(childLine->x() - childLine->
marginLogicalLeft()), |
589 logicalTop, | 589 logicalTop, |
590 LayoutUnit(childLine->logicalWidth() + childLine->ma
rginLogicalLeft() + childLine->marginLogicalRight()), | 590 LayoutUnit(childLine->logicalWidth() + childLine->ma
rginLogicalLeft() + childLine->marginLogicalRight()), |
591 logicalHeight)); | 591 logicalHeight)); |
592 } else { | 592 } else { |
593 yield(LayoutRect(logicalTop, | 593 yield(LayoutRect(logicalTop, |
594 LayoutUnit(childLine->y() - childLine->marginLogical
Left()), | 594 LayoutUnit(childLine->y() - childLine->marginLogical
Left()), |
595 logicalHeight, | 595 logicalHeight, |
596 LayoutUnit(childLine->logicalWidth() + childLine->ma
rginLogicalLeft() + childLine->marginLogicalRight()))); | 596 LayoutUnit(childLine->logicalWidth() + childLine->ma
rginLogicalLeft() + childLine->marginLogicalRight()))); |
597 } | 597 } |
598 } | 598 } |
599 } | 599 } |
600 } else if (curr->isText()) { | 600 } else if (curr->isText()) { |
601 LayoutText* currText = toLayoutText(curr); | 601 LayoutText* currText = toLayoutText(curr); |
602 for (InlineTextBox* childText = currText->firstTextBox(); childText;
childText = childText->nextTextBox()) { | 602 for (InlineTextBox* childText = currText->firstTextBox(); childText;
childText = childText->nextTextBox()) { |
603 RootInlineBox& rootBox = childText->root(); | 603 RootInlineBox& rootBox = childText->root(); |
604 LayoutUnit logicalTop = LayoutUnit(rootBox.logicalTop() | 604 LayoutUnit logicalTop = LayoutUnit(rootBox.logicalTop() |
605 + (rootBox.lineLayoutItem().style(rootBox.isFirstLineStyle()
)->font().fontMetrics().ascent() | 605 + (rootBox.getLineLayoutItem().style(rootBox.isFirstLineStyl
e())->font().fontMetrics().ascent() |
606 - container->style(rootBox.isFirstLineStyle())->font().fontM
etrics().ascent())); | 606 - container->style(rootBox.isFirstLineStyle())->font().fontM
etrics().ascent())); |
607 LayoutUnit logicalHeight(container->style(rootBox.isFirstLineSty
le())->font().fontMetrics().height()); | 607 LayoutUnit logicalHeight(container->style(rootBox.isFirstLineSty
le())->font().fontMetrics().height()); |
608 if (isHorizontal) | 608 if (isHorizontal) |
609 yield(LayoutRect(childText->x(), logicalTop, childText->logi
calWidth(), logicalHeight)); | 609 yield(LayoutRect(childText->x(), logicalTop, childText->logi
calWidth(), logicalHeight)); |
610 else | 610 else |
611 yield(LayoutRect(logicalTop, childText->y(), logicalHeight,
childText->logicalWidth())); | 611 yield(LayoutRect(logicalTop, childText->y(), logicalHeight,
childText->logicalWidth())); |
612 } | 612 } |
613 } | 613 } |
614 } | 614 } |
615 } | 615 } |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1388 | 1388 |
1389 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain
tInvalidationContainer, PaintInvalidationReason invalidationReason) const | 1389 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain
tInvalidationContainer, PaintInvalidationReason invalidationReason) const |
1390 { | 1390 { |
1391 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine
r, invalidationReason); | 1391 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine
r, invalidationReason); |
1392 | 1392 |
1393 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) | 1393 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) |
1394 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in
validationReason); | 1394 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in
validationReason); |
1395 } | 1395 } |
1396 | 1396 |
1397 } // namespace blink | 1397 } // namespace blink |
OLD | NEW |