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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 dirtyLineBoxes(false); | 252 dirtyLineBoxes(false); |
253 setAlwaysCreateLineBoxes(); | 253 setAlwaysCreateLineBoxes(); |
254 } | 254 } |
255 } | 255 } |
256 | 256 |
257 LayoutRect RenderInline::localCaretRect(InlineBox* inlineBox, int, LayoutUnit* e
xtraWidthToEndOfLine) | 257 LayoutRect RenderInline::localCaretRect(InlineBox* inlineBox, int, LayoutUnit* e
xtraWidthToEndOfLine) |
258 { | 258 { |
259 if (firstChild()) { | 259 if (firstChild()) { |
260 // This condition is possible if the RenderInline is at an editing bound
ary, | 260 // This condition is possible if the RenderInline is at an editing bound
ary, |
261 // i.e. the VisiblePosition is: | 261 // i.e. the VisiblePosition is: |
262 // <RenderInline editingBoundary=true>|<RenderText> </RenderText></Ren
derInline> | 262 // <RenderInline editingBoundary=true>|<LayoutText> </LayoutText></Ren
derInline> |
263 // FIXME: need to figure out how to make this return a valid rect, note
that | 263 // FIXME: need to figure out how to make this return a valid rect, note
that |
264 // there are no line boxes created in the above case. | 264 // there are no line boxes created in the above case. |
265 return LayoutRect(); | 265 return LayoutRect(); |
266 } | 266 } |
267 | 267 |
268 ASSERT_UNUSED(inlineBox, !inlineBox); | 268 ASSERT_UNUSED(inlineBox, !inlineBox); |
269 | 269 |
270 if (extraWidthToEndOfLine) | 270 if (extraWidthToEndOfLine) |
271 *extraWidthToEndOfLine = 0; | 271 *extraWidthToEndOfLine = 0; |
272 | 272 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 childLine->logicalWidth() + childLine->marginLogical
Left() + childLine->marginLogicalRight(), | 611 childLine->logicalWidth() + childLine->marginLogical
Left() + childLine->marginLogicalRight(), |
612 logicalHeight)); | 612 logicalHeight)); |
613 else | 613 else |
614 yield(FloatRect(logicalTop, | 614 yield(FloatRect(logicalTop, |
615 childLine->y() - childLine->marginLogicalLeft(), | 615 childLine->y() - childLine->marginLogicalLeft(), |
616 logicalHeight, | 616 logicalHeight, |
617 childLine->logicalWidth() + childLine->marginLogical
Left() + childLine->marginLogicalRight())); | 617 childLine->logicalWidth() + childLine->marginLogical
Left() + childLine->marginLogicalRight())); |
618 } | 618 } |
619 } | 619 } |
620 } else if (curr->isText()) { | 620 } else if (curr->isText()) { |
621 RenderText* currText = toRenderText(curr); | 621 LayoutText* currText = toLayoutText(curr); |
622 for (InlineTextBox* childText = currText->firstTextBox(); childText;
childText = childText->nextTextBox()) { | 622 for (InlineTextBox* childText = currText->firstTextBox(); childText;
childText = childText->nextTextBox()) { |
623 RootInlineBox& rootBox = childText->root(); | 623 RootInlineBox& rootBox = childText->root(); |
624 int logicalTop = rootBox.logicalTop() + (rootBox.renderer().styl
e(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->style(
rootBox.isFirstLineStyle())->font().fontMetrics().ascent()); | 624 int logicalTop = rootBox.logicalTop() + (rootBox.renderer().styl
e(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->style(
rootBox.isFirstLineStyle())->font().fontMetrics().ascent()); |
625 int logicalHeight = container->style(rootBox.isFirstLineStyle())
->font().fontMetrics().height(); | 625 int logicalHeight = container->style(rootBox.isFirstLineStyle())
->font().fontMetrics().height(); |
626 if (isHorizontal) | 626 if (isHorizontal) |
627 yield(FloatRect(childText->x(), logicalTop, childText->logic
alWidth(), logicalHeight)); | 627 yield(FloatRect(childText->x(), logicalTop, childText->logic
alWidth(), logicalHeight)); |
628 else | 628 else |
629 yield(FloatRect(logicalTop, childText->y(), logicalHeight, c
hildText->logicalWidth())); | 629 yield(FloatRect(logicalTop, childText->y(), logicalHeight, c
hildText->logicalWidth())); |
630 } | 630 } |
631 } | 631 } |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 // We want to get the margin box in the inline direction, and then use o
ur font ascent/descent in the block | 917 // We want to get the margin box in the inline direction, and then use o
ur font ascent/descent in the block |
918 // direction (aligned to the root box's baseline). | 918 // direction (aligned to the root box's baseline). |
919 if (curr->isBox()) | 919 if (curr->isBox()) |
920 return toLayoutBox(curr)->inlineBoxWrapper(); | 920 return toLayoutBox(curr)->inlineBoxWrapper(); |
921 if (curr->isRenderInline()) { | 921 if (curr->isRenderInline()) { |
922 RenderInline* currInline = toRenderInline(curr); | 922 RenderInline* currInline = toRenderInline(curr); |
923 InlineBox* result = currInline->firstLineBoxIncludingCulling(); | 923 InlineBox* result = currInline->firstLineBoxIncludingCulling(); |
924 if (result) | 924 if (result) |
925 return result; | 925 return result; |
926 } else if (curr->isText()) { | 926 } else if (curr->isText()) { |
927 RenderText* currText = toRenderText(curr); | 927 LayoutText* currText = toLayoutText(curr); |
928 if (currText->firstTextBox()) | 928 if (currText->firstTextBox()) |
929 return currText->firstTextBox(); | 929 return currText->firstTextBox(); |
930 } | 930 } |
931 } | 931 } |
932 return 0; | 932 return 0; |
933 } | 933 } |
934 | 934 |
935 InlineBox* RenderInline::culledInlineLastLineBox() const | 935 InlineBox* RenderInline::culledInlineLastLineBox() const |
936 { | 936 { |
937 for (LayoutObject* curr = lastChild(); curr; curr = curr->previousSibling())
{ | 937 for (LayoutObject* curr = lastChild(); curr; curr = curr->previousSibling())
{ |
938 if (curr->isFloatingOrOutOfFlowPositioned()) | 938 if (curr->isFloatingOrOutOfFlowPositioned()) |
939 continue; | 939 continue; |
940 | 940 |
941 // We want to get the margin box in the inline direction, and then use o
ur font ascent/descent in the block | 941 // We want to get the margin box in the inline direction, and then use o
ur font ascent/descent in the block |
942 // direction (aligned to the root box's baseline). | 942 // direction (aligned to the root box's baseline). |
943 if (curr->isBox()) | 943 if (curr->isBox()) |
944 return toLayoutBox(curr)->inlineBoxWrapper(); | 944 return toLayoutBox(curr)->inlineBoxWrapper(); |
945 if (curr->isRenderInline()) { | 945 if (curr->isRenderInline()) { |
946 RenderInline* currInline = toRenderInline(curr); | 946 RenderInline* currInline = toRenderInline(curr); |
947 InlineBox* result = currInline->lastLineBoxIncludingCulling(); | 947 InlineBox* result = currInline->lastLineBoxIncludingCulling(); |
948 if (result) | 948 if (result) |
949 return result; | 949 return result; |
950 } else if (curr->isText()) { | 950 } else if (curr->isText()) { |
951 RenderText* currText = toRenderText(curr); | 951 LayoutText* currText = toLayoutText(curr); |
952 if (currText->lastTextBox()) | 952 if (currText->lastTextBox()) |
953 return currText->lastTextBox(); | 953 return currText->lastTextBox(); |
954 } | 954 } |
955 } | 955 } |
956 return 0; | 956 return 0; |
957 } | 957 } |
958 | 958 |
959 LayoutRect RenderInline::culledInlineVisualOverflowBoundingBox() const | 959 LayoutRect RenderInline::culledInlineVisualOverflowBoundingBox() const |
960 { | 960 { |
961 FloatRect floatResult; | 961 FloatRect floatResult; |
(...skipping 21 matching lines...) Expand all Loading... |
983 } else if (curr->isRenderInline()) { | 983 } else if (curr->isRenderInline()) { |
984 // If the child doesn't need line boxes either, then we can recur. | 984 // If the child doesn't need line boxes either, then we can recur. |
985 RenderInline* currInline = toRenderInline(curr); | 985 RenderInline* currInline = toRenderInline(curr); |
986 if (!currInline->alwaysCreateLineBoxes()) | 986 if (!currInline->alwaysCreateLineBoxes()) |
987 result.uniteIfNonZero(currInline->culledInlineVisualOverflowBoun
dingBox()); | 987 result.uniteIfNonZero(currInline->culledInlineVisualOverflowBoun
dingBox()); |
988 else if (!currInline->hasSelfPaintingLayer()) | 988 else if (!currInline->hasSelfPaintingLayer()) |
989 result.uniteIfNonZero(currInline->linesVisualOverflowBoundingBox
()); | 989 result.uniteIfNonZero(currInline->linesVisualOverflowBoundingBox
()); |
990 } else if (curr->isText()) { | 990 } else if (curr->isText()) { |
991 // FIXME; Overflow from text boxes is lost. We will need to cache th
is information in | 991 // FIXME; Overflow from text boxes is lost. We will need to cache th
is information in |
992 // InlineTextBoxes. | 992 // InlineTextBoxes. |
993 RenderText* currText = toRenderText(curr); | 993 LayoutText* currText = toLayoutText(curr); |
994 result.uniteIfNonZero(currText->linesVisualOverflowBoundingBox()); | 994 result.uniteIfNonZero(currText->linesVisualOverflowBoundingBox()); |
995 } | 995 } |
996 } | 996 } |
997 return result; | 997 return result; |
998 } | 998 } |
999 | 999 |
1000 LayoutRect RenderInline::linesVisualOverflowBoundingBox() const | 1000 LayoutRect RenderInline::linesVisualOverflowBoundingBox() const |
1001 { | 1001 { |
1002 if (!alwaysCreateLineBoxes()) | 1002 if (!alwaysCreateLineBoxes()) |
1003 return culledInlineVisualOverflowBoundingBox(); | 1003 return culledInlineVisualOverflowBoundingBox(); |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 if (curr->isBox() && !curr->needsLayout()) { | 1278 if (curr->isBox() && !curr->needsLayout()) { |
1279 LayoutBox* currBox = toLayoutBox(curr); | 1279 LayoutBox* currBox = toLayoutBox(curr); |
1280 if (currBox->inlineBoxWrapper()) | 1280 if (currBox->inlineBoxWrapper()) |
1281 currBox->inlineBoxWrapper()->root().markDirty(); | 1281 currBox->inlineBoxWrapper()->root().markDirty(); |
1282 } else if (!curr->selfNeedsLayout()) { | 1282 } else if (!curr->selfNeedsLayout()) { |
1283 if (curr->isRenderInline()) { | 1283 if (curr->isRenderInline()) { |
1284 RenderInline* currInline = toRenderInline(curr); | 1284 RenderInline* currInline = toRenderInline(curr); |
1285 for (InlineFlowBox* childLine = currInline->firstLineBox();
childLine; childLine = childLine->nextLineBox()) | 1285 for (InlineFlowBox* childLine = currInline->firstLineBox();
childLine; childLine = childLine->nextLineBox()) |
1286 childLine->root().markDirty(); | 1286 childLine->root().markDirty(); |
1287 } else if (curr->isText()) { | 1287 } else if (curr->isText()) { |
1288 RenderText* currText = toRenderText(curr); | 1288 LayoutText* currText = toLayoutText(curr); |
1289 for (InlineTextBox* childText = currText->firstTextBox(); ch
ildText; childText = childText->nextTextBox()) | 1289 for (InlineTextBox* childText = currText->firstTextBox(); ch
ildText; childText = childText->nextTextBox()) |
1290 childText->root().markDirty(); | 1290 childText->root().markDirty(); |
1291 } | 1291 } |
1292 } | 1292 } |
1293 } | 1293 } |
1294 } else | 1294 } else |
1295 m_lineBoxes.dirtyLineBoxes(); | 1295 m_lineBoxes.dirtyLineBoxes(); |
1296 } | 1296 } |
1297 | 1297 |
1298 InlineFlowBox* RenderInline::createInlineFlowBox() | 1298 InlineFlowBox* RenderInline::createInlineFlowBox() |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 } | 1452 } |
1453 | 1453 |
1454 void RenderInline::invalidateDisplayItemClients(DisplayItemList* displayItemList
) const | 1454 void RenderInline::invalidateDisplayItemClients(DisplayItemList* displayItemList
) const |
1455 { | 1455 { |
1456 LayoutBoxModelObject::invalidateDisplayItemClients(displayItemList); | 1456 LayoutBoxModelObject::invalidateDisplayItemClients(displayItemList); |
1457 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) | 1457 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) |
1458 displayItemList->invalidate(box->displayItemClient()); | 1458 displayItemList->invalidate(box->displayItemClient()); |
1459 } | 1459 } |
1460 | 1460 |
1461 } // namespace blink | 1461 } // namespace blink |
OLD | NEW |