Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: Source/core/rendering/RenderInline.cpp

Issue 926193003: Move rendering/RenderBox to layout/LayoutBox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderInline.h ('k') | Source/core/rendering/RenderLineBoxList.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 578
579 bool isHorizontal = style()->isHorizontalWritingMode(); 579 bool isHorizontal = style()->isHorizontalWritingMode();
580 580
581 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling()) { 581 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
582 if (curr->isFloatingOrOutOfFlowPositioned()) 582 if (curr->isFloatingOrOutOfFlowPositioned())
583 continue; 583 continue;
584 584
585 // We want to get the margin box in the inline direction, and then use o ur font ascent/descent in the block 585 // We want to get the margin box in the inline direction, and then use o ur font ascent/descent in the block
586 // direction (aligned to the root box's baseline). 586 // direction (aligned to the root box's baseline).
587 if (curr->isBox()) { 587 if (curr->isBox()) {
588 RenderBox* currBox = toRenderBox(curr); 588 LayoutBox* currBox = toLayoutBox(curr);
589 if (currBox->inlineBoxWrapper()) { 589 if (currBox->inlineBoxWrapper()) {
590 RootInlineBox& rootBox = currBox->inlineBoxWrapper()->root(); 590 RootInlineBox& rootBox = currBox->inlineBoxWrapper()->root();
591 int logicalTop = rootBox.logicalTop() + (rootBox.renderer().styl e(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->style( rootBox.isFirstLineStyle())->font().fontMetrics().ascent()); 591 int logicalTop = rootBox.logicalTop() + (rootBox.renderer().styl e(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->style( rootBox.isFirstLineStyle())->font().fontMetrics().ascent());
592 int logicalHeight = container->style(rootBox.isFirstLineStyle()) ->font().fontMetrics().height(); 592 int logicalHeight = container->style(rootBox.isFirstLineStyle()) ->font().fontMetrics().height();
593 if (isHorizontal) 593 if (isHorizontal)
594 yield(FloatRect(currBox->inlineBoxWrapper()->x() - currBox-> marginLeft(), logicalTop, (currBox->size().width() + currBox->marginWidth()).toF loat(), logicalHeight)); 594 yield(FloatRect(currBox->inlineBoxWrapper()->x() - currBox-> marginLeft(), logicalTop, (currBox->size().width() + currBox->marginWidth()).toF loat(), logicalHeight));
595 else 595 else
596 yield(FloatRect(logicalTop, currBox->inlineBoxWrapper()->y() - currBox->marginTop(), logicalHeight, (currBox->size().height() + currBox->mar ginHeight()).toFloat())); 596 yield(FloatRect(logicalTop, currBox->inlineBoxWrapper()->y() - currBox->marginTop(), logicalHeight, (currBox->size().height() + currBox->mar ginHeight()).toFloat()));
597 } 597 }
598 } else if (curr->isRenderInline()) { 598 } else if (curr->isRenderInline()) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 653
654 } // unnamed namespace 654 } // unnamed namespace
655 655
656 void RenderInline::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accu mulatedOffset) const 656 void RenderInline::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accu mulatedOffset) const
657 { 657 {
658 AbsoluteRectsGeneratorContext context(rects, accumulatedOffset); 658 AbsoluteRectsGeneratorContext context(rects, accumulatedOffset);
659 generateLineBoxRects(context); 659 generateLineBoxRects(context);
660 660
661 if (continuation()) { 661 if (continuation()) {
662 if (continuation()->isBox()) { 662 if (continuation()->isBox()) {
663 RenderBox* box = toRenderBox(continuation()); 663 LayoutBox* box = toLayoutBox(continuation());
664 continuation()->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location() + box->locationOffset())); 664 continuation()->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location() + box->locationOffset()));
665 } else 665 } else
666 continuation()->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location())); 666 continuation()->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location()));
667 } 667 }
668 } 668 }
669 669
670 670
671 namespace { 671 namespace {
672 672
673 class AbsoluteQuadsGeneratorContext { 673 class AbsoluteQuadsGeneratorContext {
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 if (firstLineBoxIncludingCulling()) { 838 if (firstLineBoxIncludingCulling()) {
839 // This inline actually has a line box. We must have clicked in the bor der/padding of one of these boxes. We 839 // This inline actually has a line box. We must have clicked in the bor der/padding of one of these boxes. We
840 // should try to find a result by asking our containing block. 840 // should try to find a result by asking our containing block.
841 return cb->positionForPoint(point); 841 return cb->positionForPoint(point);
842 } 842 }
843 843
844 // Translate the coords from the pre-anonymous block to the post-anonymous b lock. 844 // Translate the coords from the pre-anonymous block to the post-anonymous b lock.
845 LayoutPoint parentBlockPoint = cb->location() + point; 845 LayoutPoint parentBlockPoint = cb->location() + point;
846 LayoutBoxModelObject* c = continuation(); 846 LayoutBoxModelObject* c = continuation();
847 while (c) { 847 while (c) {
848 RenderBox* contBlock = c->isInline() ? c->containingBlock() : toRenderBl ock(c); 848 LayoutBox* contBlock = c->isInline() ? c->containingBlock() : toRenderBl ock(c);
849 if (c->isInline() || c->slowFirstChild()) 849 if (c->isInline() || c->slowFirstChild())
850 return c->positionForPoint(parentBlockPoint - contBlock->locationOff set()); 850 return c->positionForPoint(parentBlockPoint - contBlock->locationOff set());
851 c = toRenderBlock(c)->inlineElementContinuation(); 851 c = toRenderBlock(c)->inlineElementContinuation();
852 } 852 }
853 853
854 return LayoutBoxModelObject::positionForPoint(point); 854 return LayoutBoxModelObject::positionForPoint(point);
855 } 855 }
856 856
857 namespace { 857 namespace {
858 858
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 910
911 InlineBox* RenderInline::culledInlineFirstLineBox() const 911 InlineBox* RenderInline::culledInlineFirstLineBox() const
912 { 912 {
913 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling()) { 913 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
914 if (curr->isFloatingOrOutOfFlowPositioned()) 914 if (curr->isFloatingOrOutOfFlowPositioned())
915 continue; 915 continue;
916 916
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 toRenderBox(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 RenderText* currText = toRenderText(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 toRenderBox(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 RenderText* currText = toRenderText(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;
962 LinesBoundingBoxGeneratorContext context(floatResult); 962 LinesBoundingBoxGeneratorContext context(floatResult);
963 generateCulledLineBoxRects(context, this); 963 generateCulledLineBoxRects(context, this);
964 LayoutRect result(enclosingLayoutRect(floatResult)); 964 LayoutRect result(enclosingLayoutRect(floatResult));
965 bool isHorizontal = style()->isHorizontalWritingMode(); 965 bool isHorizontal = style()->isHorizontalWritingMode();
966 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling()) { 966 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
967 if (curr->isFloatingOrOutOfFlowPositioned()) 967 if (curr->isFloatingOrOutOfFlowPositioned())
968 continue; 968 continue;
969 969
970 // For overflow we just have to propagate by hand and recompute it all. 970 // For overflow we just have to propagate by hand and recompute it all.
971 if (curr->isBox()) { 971 if (curr->isBox()) {
972 RenderBox* currBox = toRenderBox(curr); 972 LayoutBox* currBox = toLayoutBox(curr);
973 if (!currBox->hasSelfPaintingLayer() && currBox->inlineBoxWrapper()) { 973 if (!currBox->hasSelfPaintingLayer() && currBox->inlineBoxWrapper()) {
974 LayoutRect logicalRect = currBox->logicalVisualOverflowRectForPr opagation(styleRef()); 974 LayoutRect logicalRect = currBox->logicalVisualOverflowRectForPr opagation(styleRef());
975 if (isHorizontal) { 975 if (isHorizontal) {
976 logicalRect.moveBy(currBox->location()); 976 logicalRect.moveBy(currBox->location());
977 result.uniteIfNonZero(logicalRect); 977 result.uniteIfNonZero(logicalRect);
978 } else { 978 } else {
979 logicalRect.moveBy(currBox->location()); 979 logicalRect.moveBy(currBox->location());
980 result.uniteIfNonZero(logicalRect.transposedRect()); 980 result.uniteIfNonZero(logicalRect.transposedRect());
981 } 981 }
982 } 982 }
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 // is translated, but the render box isn't, so we need to do this to get the 1128 // is translated, but the render box isn't, so we need to do this to get the
1129 // right dirty rect. Since this is called from LayoutObject::setStyle, t he relative position 1129 // right dirty rect. Since this is called from LayoutObject::setStyle, t he relative position
1130 // flag on the LayoutObject has been cleared, so use the one on the styl e(). 1130 // flag on the LayoutObject has been cleared, so use the one on the styl e().
1131 topLeft += layer()->offsetForInFlowPosition(); 1131 topLeft += layer()->offsetForInFlowPosition();
1132 } 1132 }
1133 1133
1134 // FIXME: We ignore the lightweight clipping rect that controls use, since i f |o| is in mid-layout, 1134 // FIXME: We ignore the lightweight clipping rect that controls use, since i f |o| is in mid-layout,
1135 // its controlClipRect will be wrong. For overflow clip we use the values ca ched by the layer. 1135 // its controlClipRect will be wrong. For overflow clip we use the values ca ched by the layer.
1136 rect.setLocation(topLeft); 1136 rect.setLocation(topLeft);
1137 if (o->hasOverflowClip()) { 1137 if (o->hasOverflowClip()) {
1138 RenderBox* containerBox = toRenderBox(o); 1138 LayoutBox* containerBox = toLayoutBox(o);
1139 containerBox->applyCachedClipAndScrollOffsetForPaintInvalidation(rect); 1139 containerBox->applyCachedClipAndScrollOffsetForPaintInvalidation(rect);
1140 if (rect.isEmpty()) 1140 if (rect.isEmpty())
1141 return; 1141 return;
1142 } 1142 }
1143 1143
1144 if (containerSkipped) { 1144 if (containerSkipped) {
1145 // If the paintInvalidationContainer is below o, then we need to map the rect into paintInvalidationContainer's coordinates. 1145 // If the paintInvalidationContainer is below o, then we need to map the rect into paintInvalidationContainer's coordinates.
1146 LayoutSize containerOffset = paintInvalidationContainer->offsetFromAnces torContainer(o); 1146 LayoutSize containerOffset = paintInvalidationContainer->offsetFromAnces torContainer(o);
1147 rect.move(-containerOffset); 1147 rect.move(-containerOffset);
1148 return; 1148 return;
1149 } 1149 }
1150 1150
1151 o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, paint InvalidationState); 1151 o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, paint InvalidationState);
1152 } 1152 }
1153 1153
1154 LayoutSize RenderInline::offsetFromContainer(const LayoutObject* container, cons t LayoutPoint& point, bool* offsetDependsOnPoint) const 1154 LayoutSize RenderInline::offsetFromContainer(const LayoutObject* container, cons t LayoutPoint& point, bool* offsetDependsOnPoint) const
1155 { 1155 {
1156 ASSERT(container == this->container()); 1156 ASSERT(container == this->container());
1157 1157
1158 LayoutSize offset; 1158 LayoutSize offset;
1159 if (isRelPositioned()) 1159 if (isRelPositioned())
1160 offset += offsetForInFlowPosition(); 1160 offset += offsetForInFlowPosition();
1161 1161
1162 offset += container->columnOffset(point); 1162 offset += container->columnOffset(point);
1163 1163
1164 if (container->hasOverflowClip()) 1164 if (container->hasOverflowClip())
1165 offset -= toRenderBox(container)->scrolledContentOffset(); 1165 offset -= toLayoutBox(container)->scrolledContentOffset();
1166 1166
1167 if (offsetDependsOnPoint) { 1167 if (offsetDependsOnPoint) {
1168 *offsetDependsOnPoint = container->hasColumns() 1168 *offsetDependsOnPoint = container->hasColumns()
1169 || (container->isBox() && container->style()->isFlippedBlocksWriting Mode()) 1169 || (container->isBox() && container->style()->isFlippedBlocksWriting Mode())
1170 || container->isLayoutFlowThread(); 1170 || container->isLayoutFlowThread();
1171 } 1171 }
1172 1172
1173 return offset; 1173 return offset;
1174 } 1174 }
1175 1175
(...skipping 11 matching lines...) Expand all
1187 } 1187 }
1188 1188
1189 bool containerSkipped; 1189 bool containerSkipped;
1190 LayoutObject* o = container(paintInvalidationContainer, &containerSkipped); 1190 LayoutObject* o = container(paintInvalidationContainer, &containerSkipped);
1191 if (!o) 1191 if (!o)
1192 return; 1192 return;
1193 1193
1194 if (mode & ApplyContainerFlip && o->isBox()) { 1194 if (mode & ApplyContainerFlip && o->isBox()) {
1195 if (o->style()->isFlippedBlocksWritingMode()) { 1195 if (o->style()->isFlippedBlocksWritingMode()) {
1196 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint()) ; 1196 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint()) ;
1197 transformState.move(toRenderBox(o)->flipForWritingModeIncludingColum ns(centerPoint) - centerPoint); 1197 transformState.move(toLayoutBox(o)->flipForWritingModeIncludingColum ns(centerPoint) - centerPoint);
1198 } 1198 }
1199 mode &= ~ApplyContainerFlip; 1199 mode &= ~ApplyContainerFlip;
1200 } 1200 }
1201 1201
1202 LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(trans formState.mappedPoint())); 1202 LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(trans formState.mappedPoint()));
1203 1203
1204 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl e()->preserves3D()); 1204 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl e()->preserves3D());
1205 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { 1205 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
1206 TransformationMatrix t; 1206 TransformationMatrix t;
1207 getTransformFromContainer(o, containerOffset, t); 1207 getTransformFromContainer(o, containerOffset, t);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 1245
1246 Node* n = node(); 1246 Node* n = node();
1247 LayoutPoint localPoint(point); 1247 LayoutPoint localPoint(point);
1248 if (n) { 1248 if (n) {
1249 if (isInlineElementContinuation()) { 1249 if (isInlineElementContinuation()) {
1250 // We're in the continuation of a split inline. Adjust our local po int to be in the coordinate space 1250 // We're in the continuation of a split inline. Adjust our local po int to be in the coordinate space
1251 // of the principal renderer's containing block. This will end up b eing the innerNonSharedNode. 1251 // of the principal renderer's containing block. This will end up b eing the innerNonSharedNode.
1252 RenderBlock* firstBlock = n->renderer()->containingBlock(); 1252 RenderBlock* firstBlock = n->renderer()->containingBlock();
1253 1253
1254 // Get our containing block. 1254 // Get our containing block.
1255 RenderBox* block = containingBlock(); 1255 LayoutBox* block = containingBlock();
1256 localPoint.moveBy(block->location() - firstBlock->locationOffset()); 1256 localPoint.moveBy(block->location() - firstBlock->locationOffset());
1257 } 1257 }
1258 1258
1259 result.setInnerNode(n); 1259 result.setInnerNode(n);
1260 if (!result.innerNonSharedNode()) 1260 if (!result.innerNonSharedNode())
1261 result.setInnerNonSharedNode(n); 1261 result.setInnerNonSharedNode(n);
1262 result.setLocalPoint(localPoint); 1262 result.setLocalPoint(localPoint);
1263 } 1263 }
1264 } 1264 }
1265 1265
1266 void RenderInline::dirtyLineBoxes(bool fullLayout) 1266 void RenderInline::dirtyLineBoxes(bool fullLayout)
1267 { 1267 {
1268 if (fullLayout) { 1268 if (fullLayout) {
1269 m_lineBoxes.deleteLineBoxes(); 1269 m_lineBoxes.deleteLineBoxes();
1270 return; 1270 return;
1271 } 1271 }
1272 1272
1273 if (!alwaysCreateLineBoxes()) { 1273 if (!alwaysCreateLineBoxes()) {
1274 // We have to grovel into our children in order to dirty the appropriate lines. 1274 // We have to grovel into our children in order to dirty the appropriate lines.
1275 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling() ) { 1275 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling() ) {
1276 if (curr->isFloatingOrOutOfFlowPositioned()) 1276 if (curr->isFloatingOrOutOfFlowPositioned())
1277 continue; 1277 continue;
1278 if (curr->isBox() && !curr->needsLayout()) { 1278 if (curr->isBox() && !curr->needsLayout()) {
1279 RenderBox* currBox = toRenderBox(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 RenderText* currText = toRenderText(curr);
1289 for (InlineTextBox* childText = currText->firstTextBox(); ch ildText; childText = childText->nextTextBox()) 1289 for (InlineTextBox* childText = currText->firstTextBox(); ch ildText; childText = childText->nextTextBox())
(...skipping 29 matching lines...) Expand all
1319 return style()->computedLineHeight(); 1319 return style()->computedLineHeight();
1320 } 1320 }
1321 1321
1322 int RenderInline::baselinePosition(FontBaseline baselineType, bool firstLine, Li neDirectionMode direction, LinePositionMode linePositionMode) const 1322 int RenderInline::baselinePosition(FontBaseline baselineType, bool firstLine, Li neDirectionMode direction, LinePositionMode linePositionMode) const
1323 { 1323 {
1324 ASSERT(linePositionMode == PositionOnContainingLine); 1324 ASSERT(linePositionMode == PositionOnContainingLine);
1325 const FontMetrics& fontMetrics = style(firstLine)->fontMetrics(); 1325 const FontMetrics& fontMetrics = style(firstLine)->fontMetrics();
1326 return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2; 1326 return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2;
1327 } 1327 }
1328 1328
1329 LayoutSize RenderInline::offsetForInFlowPositionedInline(const RenderBox& child) const 1329 LayoutSize RenderInline::offsetForInFlowPositionedInline(const LayoutBox& child) const
1330 { 1330 {
1331 // FIXME: This function isn't right with mixed writing modes. 1331 // FIXME: This function isn't right with mixed writing modes.
1332 1332
1333 ASSERT(isRelPositioned()); 1333 ASSERT(isRelPositioned());
1334 if (!isRelPositioned()) 1334 if (!isRelPositioned())
1335 return LayoutSize(); 1335 return LayoutSize();
1336 1336
1337 // When we have an enclosing relpositioned inline, we need to add in the off set of the first line 1337 // When we have an enclosing relpositioned inline, we need to add in the off set of the first line
1338 // box from the rest of the content, but only in the cases where we know we' re positioned 1338 // box from the rest of the content, but only in the cases where we know we' re positioned
1339 // relative to the inline itself. 1339 // relative to the inline itself.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1410 { 1410 {
1411 AbsoluteLayoutRectsIgnoringEmptyRectsGeneratorContext context(rects, additio nalOffset); 1411 AbsoluteLayoutRectsIgnoringEmptyRectsGeneratorContext context(rects, additio nalOffset);
1412 generateLineBoxRects(context); 1412 generateLineBoxRects(context);
1413 1413
1414 addChildFocusRingRects(rects, additionalOffset); 1414 addChildFocusRingRects(rects, additionalOffset);
1415 1415
1416 if (continuation()) { 1416 if (continuation()) {
1417 if (continuation()->isInline()) 1417 if (continuation()->isInline())
1418 continuation()->addFocusRingRects(rects, additionalOffset + (continu ation()->containingBlock()->location() - containingBlock()->location())); 1418 continuation()->addFocusRingRects(rects, additionalOffset + (continu ation()->containingBlock()->location() - containingBlock()->location()));
1419 else 1419 else
1420 continuation()->addFocusRingRects(rects, additionalOffset + (toRende rBox(continuation())->location() - containingBlock()->location())); 1420 continuation()->addFocusRingRects(rects, additionalOffset + (toLayou tBox(continuation())->location() - containingBlock()->location()));
1421 } 1421 }
1422 } 1422 }
1423 1423
1424 void RenderInline::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layo utPoint& layerOffset) const 1424 void RenderInline::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layo utPoint& layerOffset) const
1425 { 1425 {
1426 AbsoluteLayoutRectsGeneratorContext context(rects, layerOffset); 1426 AbsoluteLayoutRectsGeneratorContext context(rects, layerOffset);
1427 generateLineBoxRects(context); 1427 generateLineBoxRects(context);
1428 } 1428 }
1429 1429
1430 void RenderInline::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) 1430 void RenderInline::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions)
(...skipping 21 matching lines...) Expand all
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
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderInline.h ('k') | Source/core/rendering/RenderLineBoxList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698