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

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

Issue 397723006: Move RenderBlockFlow::constructTextRun out. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
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 11 matching lines...) Expand all
22 * 22 *
23 */ 23 */
24 24
25 #include "config.h" 25 #include "config.h"
26 #include "core/rendering/RenderDeprecatedFlexibleBox.h" 26 #include "core/rendering/RenderDeprecatedFlexibleBox.h"
27 27
28 #include "core/frame/UseCounter.h" 28 #include "core/frame/UseCounter.h"
29 #include "core/rendering/FastTextAutosizer.h" 29 #include "core/rendering/FastTextAutosizer.h"
30 #include "core/rendering/RenderLayer.h" 30 #include "core/rendering/RenderLayer.h"
31 #include "core/rendering/RenderView.h" 31 #include "core/rendering/RenderView.h"
32 #include "core/rendering/TextRunConstructor.h"
32 #include "platform/fonts/Font.h" 33 #include "platform/fonts/Font.h"
33 #include "wtf/StdLibExtras.h" 34 #include "wtf/StdLibExtras.h"
34 #include "wtf/unicode/CharacterNames.h" 35 #include "wtf/unicode/CharacterNames.h"
35 36
36 namespace WebCore { 37 namespace WebCore {
37 38
38 class FlexBoxIterator { 39 class FlexBoxIterator {
39 public: 40 public:
40 FlexBoxIterator(RenderDeprecatedFlexibleBox* parent) 41 FlexBoxIterator(RenderDeprecatedFlexibleBox* parent)
41 : m_box(parent) 42 : m_box(parent)
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 934
934 const UChar ellipsisAndSpace[2] = { horizontalEllipsis, ' ' }; 935 const UChar ellipsisAndSpace[2] = { horizontalEllipsis, ' ' };
935 DEFINE_STATIC_LOCAL(AtomicString, ellipsisAndSpaceStr, (ellipsisAndSpace , 2)); 936 DEFINE_STATIC_LOCAL(AtomicString, ellipsisAndSpaceStr, (ellipsisAndSpace , 2));
936 DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsis, 1)) ; 937 DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsis, 1)) ;
937 const Font& font = style(numVisibleLines == 1)->font(); 938 const Font& font = style(numVisibleLines == 1)->font();
938 939
939 // 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 940 // 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
940 float totalWidth; 941 float totalWidth;
941 InlineBox* anchorBox = lastLine->lastChild(); 942 InlineBox* anchorBox = lastLine->lastChild();
942 if (anchorBox && anchorBox->renderer().style()->isLink()) 943 if (anchorBox && anchorBox->renderer().style()->isLink())
943 totalWidth = anchorBox->logicalWidth() + font.width(RenderBlockFlow: :constructTextRun(this, font, ellipsisAndSpace, 2, style(), style()->direction() )); 944 totalWidth = anchorBox->logicalWidth() + font.width(constructTextRun (this, font, ellipsisAndSpace, 2, style(), style()->direction()));
944 else { 945 else {
945 anchorBox = 0; 946 anchorBox = 0;
946 totalWidth = font.width(RenderBlockFlow::constructTextRun(this, font , &horizontalEllipsis, 1, style(), style()->direction())); 947 totalWidth = font.width(constructTextRun(this, font, &horizontalElli psis, 1, style(), style()->direction()));
947 } 948 }
948 949
949 // See if this width can be accommodated on the last visible line 950 // See if this width can be accommodated on the last visible line
950 RenderBlockFlow& destBlock = lastVisibleLine->block(); 951 RenderBlockFlow& destBlock = lastVisibleLine->block();
951 RenderBlockFlow& srcBlock = lastLine->block(); 952 RenderBlockFlow& srcBlock = lastLine->block();
952 953
953 // FIXME: Directions of src/destBlock could be different from our direct ion and from one another. 954 // FIXME: Directions of src/destBlock could be different from our direct ion and from one another.
954 if (!srcBlock.style()->isLeftToRightDirection()) 955 if (!srcBlock.style()->isLeftToRightDirection())
955 continue; 956 continue;
956 957
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 if (isPseudoElement()) 1069 if (isPseudoElement())
1069 return "RenderDeprecatedFlexibleBox (generated)"; 1070 return "RenderDeprecatedFlexibleBox (generated)";
1070 if (isAnonymous()) 1071 if (isAnonymous())
1071 return "RenderDeprecatedFlexibleBox (generated)"; 1072 return "RenderDeprecatedFlexibleBox (generated)";
1072 if (isRelPositioned()) 1073 if (isRelPositioned())
1073 return "RenderDeprecatedFlexibleBox (relative positioned)"; 1074 return "RenderDeprecatedFlexibleBox (relative positioned)";
1074 return "RenderDeprecatedFlexibleBox"; 1075 return "RenderDeprecatedFlexibleBox";
1075 } 1076 }
1076 1077
1077 } // namespace WebCore 1078 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderCombineText.cpp ('k') | Source/core/rendering/RenderFileUploadControl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698