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

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

Issue 184023003: Make InlineBox::renderer() and related subclass methods return reference. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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
OLDNEW
1 /* 1 /*
2 * This file is part of the render object implementation for KHTML. 2 * This file is part of the render object implementation for KHTML.
3 * 3 *
4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
5 * (C) 1999 Antti Koivisto (koivisto@kde.org) 5 * (C) 1999 Antti Koivisto (koivisto@kde.org)
6 * Copyright (C) 2003 Apple Computer, Inc. 6 * Copyright (C) 2003 Apple Computer, Inc.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 continue; 937 continue;
938 938
939 const UChar ellipsisAndSpace[2] = { horizontalEllipsis, ' ' }; 939 const UChar ellipsisAndSpace[2] = { horizontalEllipsis, ' ' };
940 DEFINE_STATIC_LOCAL(AtomicString, ellipsisAndSpaceStr, (ellipsisAndSpace , 2)); 940 DEFINE_STATIC_LOCAL(AtomicString, ellipsisAndSpaceStr, (ellipsisAndSpace , 2));
941 DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsis, 1)) ; 941 DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsis, 1)) ;
942 const Font& font = style(numVisibleLines == 1)->font(); 942 const Font& font = style(numVisibleLines == 1)->font();
943 943
944 // Get ellipsis width, and if the last child is an anchor, it will go af ter the ellipsis, so add in a space and the anchor width too 944 // Get ellipsis width, and if the last child is an anchor, it will go af ter the ellipsis, so add in a space and the anchor width too
945 LayoutUnit totalWidth; 945 LayoutUnit totalWidth;
946 InlineBox* anchorBox = lastLine->lastChild(); 946 InlineBox* anchorBox = lastLine->lastChild();
947 if (anchorBox && anchorBox->renderer()->style()->isLink()) 947 if (anchorBox && anchorBox->renderer().style()->isLink())
948 totalWidth = anchorBox->logicalWidth() + font.width(RenderBlockFlow: :constructTextRun(this, font, ellipsisAndSpace, 2, style(), style()->direction() )); 948 totalWidth = anchorBox->logicalWidth() + font.width(RenderBlockFlow: :constructTextRun(this, font, ellipsisAndSpace, 2, style(), style()->direction() ));
949 else { 949 else {
950 anchorBox = 0; 950 anchorBox = 0;
951 totalWidth = font.width(RenderBlockFlow::constructTextRun(this, font , &horizontalEllipsis, 1, style(), style()->direction())); 951 totalWidth = font.width(RenderBlockFlow::constructTextRun(this, font , &horizontalEllipsis, 1, style(), style()->direction()));
952 } 952 }
953 953
954 // See if this width can be accommodated on the last visible line 954 // See if this width can be accommodated on the last visible line
955 RenderBlockFlow* destBlock = lastVisibleLine->block(); 955 RenderBlockFlow* destBlock = &lastVisibleLine->block();
Inactive 2014/02/28 02:28:19 RenderBlockFlow& destBlock = lastVisibleLine->bloc
ostap 2014/02/28 08:29:14 Done.
956 RenderBlockFlow* srcBlock = lastLine->block(); 956 RenderBlockFlow* srcBlock = &lastLine->block();
Inactive 2014/02/28 02:28:19 Ditto
ostap 2014/02/28 08:29:14 Done.
957 957
958 // FIXME: Directions of src/destBlock could be different from our direct ion and from one another. 958 // FIXME: Directions of src/destBlock could be different from our direct ion and from one another.
959 if (!srcBlock->style()->isLeftToRightDirection()) 959 if (!srcBlock->style()->isLeftToRightDirection())
960 continue; 960 continue;
961 961
962 bool leftToRight = destBlock->style()->isLeftToRightDirection(); 962 bool leftToRight = destBlock->style()->isLeftToRightDirection();
963 if (!leftToRight) 963 if (!leftToRight)
964 continue; 964 continue;
965 965
966 LayoutUnit blockRightEdge = destBlock->logicalRightOffsetForLine(lastVis ibleLine->y(), false); 966 LayoutUnit blockRightEdge = destBlock->logicalRightOffsetForLine(lastVis ibleLine->y(), false);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 if (isPseudoElement()) 1078 if (isPseudoElement())
1079 return "RenderDeprecatedFlexibleBox (generated)"; 1079 return "RenderDeprecatedFlexibleBox (generated)";
1080 if (isAnonymous()) 1080 if (isAnonymous())
1081 return "RenderDeprecatedFlexibleBox (generated)"; 1081 return "RenderDeprecatedFlexibleBox (generated)";
1082 if (isRelPositioned()) 1082 if (isRelPositioned())
1083 return "RenderDeprecatedFlexibleBox (relative positioned)"; 1083 return "RenderDeprecatedFlexibleBox (relative positioned)";
1084 return "RenderDeprecatedFlexibleBox"; 1084 return "RenderDeprecatedFlexibleBox";
1085 } 1085 }
1086 1086
1087 } // namespace WebCore 1087 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698