OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. |
4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
5 * Copyright (C) 2013 Adobe Systems Incorporated. | 5 * Copyright (C) 2013 Adobe Systems Incorporated. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "core/rendering/RenderCombineText.h" | 29 #include "core/rendering/RenderCombineText.h" |
30 #include "core/rendering/RenderInline.h" | 30 #include "core/rendering/RenderInline.h" |
31 #include "core/rendering/break_lines.h" | 31 #include "core/rendering/break_lines.h" |
32 #include "core/rendering/line/LineInfo.h" | 32 #include "core/rendering/line/LineInfo.h" |
33 #include "core/rendering/line/LineWidth.h" | 33 #include "core/rendering/line/LineWidth.h" |
34 #include "core/rendering/shapes/ShapeInsideInfo.h" | 34 #include "core/rendering/shapes/ShapeInsideInfo.h" |
35 #include "core/rendering/svg/RenderSVGInlineText.h" | 35 #include "core/rendering/svg/RenderSVGInlineText.h" |
36 | 36 |
37 namespace WebCore { | 37 namespace WebCore { |
38 | 38 |
39 using namespace std; | |
40 using namespace WTF; | |
41 using namespace Unicode; | |
42 | |
43 // We don't let our line box tree for a single line get any deeper than this. | 39 // We don't let our line box tree for a single line get any deeper than this. |
44 const unsigned cMaxLineDepth = 200; | 40 const unsigned cMaxLineDepth = 200; |
45 | 41 |
46 struct RenderTextInfo { | 42 struct RenderTextInfo { |
47 RenderTextInfo(); | 43 RenderTextInfo(); |
48 ~RenderTextInfo(); | 44 ~RenderTextInfo(); |
49 | 45 |
50 RenderText* m_text; | 46 RenderText* m_text; |
51 LazyLineBreakIterator m_lineBreakIterator; | 47 LazyLineBreakIterator m_lineBreakIterator; |
52 const Font* m_font; | 48 const Font* m_font; |
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 | 916 |
921 if (m_autoWrap && betweenWords) { | 917 if (m_autoWrap && betweenWords) { |
922 m_width.commit(); | 918 m_width.commit(); |
923 wrapW = 0; | 919 wrapW = 0; |
924 m_lineBreak.moveTo(m_current.object(), m_current.offset(), m_cur
rent.nextBreakablePosition()); | 920 m_lineBreak.moveTo(m_current.object(), m_current.offset(), m_cur
rent.nextBreakablePosition()); |
925 // Auto-wrapping text should not wrap in the middle of a word on
ce it has had an | 921 // Auto-wrapping text should not wrap in the middle of a word on
ce it has had an |
926 // opportunity to break after a word. | 922 // opportunity to break after a word. |
927 breakWords = false; | 923 breakWords = false; |
928 } | 924 } |
929 | 925 |
930 if (midWordBreak && !U16_IS_TRAIL(c) && !(category(c) & (Mark_NonSpa
cing | Mark_Enclosing | Mark_SpacingCombining))) { | 926 if (midWordBreak && !U16_IS_TRAIL(c) && !(WTF::Unicode::category(c)
& (WTF::Unicode::Mark_NonSpacing | WTF::Unicode::Mark_Enclosing | WTF::Unicode::
Mark_SpacingCombining))) { |
931 // Remember this as a breakable position in case | 927 // Remember this as a breakable position in case |
932 // adding the end width forces a break. | 928 // adding the end width forces a break. |
933 m_lineBreak.moveTo(m_current.object(), m_current.offset(), m_cur
rent.nextBreakablePosition()); | 929 m_lineBreak.moveTo(m_current.object(), m_current.offset(), m_cur
rent.nextBreakablePosition()); |
934 midWordBreak &= (breakWords || breakAll); | 930 midWordBreak &= (breakWords || breakAll); |
935 } | 931 } |
936 | 932 |
937 if (betweenWords) { | 933 if (betweenWords) { |
938 lastSpaceWordSpacing = applyWordSpacing ? wordSpacing : 0; | 934 lastSpaceWordSpacing = applyWordSpacing ? wordSpacing : 0; |
939 wordSpacingForWordMeasurement = (applyWordSpacing && wordMeasure
ment.width) ? wordSpacing : 0; | 935 wordSpacingForWordMeasurement = (applyWordSpacing && wordMeasure
ment.width) ? wordSpacing : 0; |
940 lastSpace = m_current.offset(); | 936 lastSpace = m_current.offset(); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 m_lineBreak.increment(); | 1135 m_lineBreak.increment(); |
1140 } while (!m_lineBreak.atEnd() && isEmptyInline(m_lineBreak.object())); | 1136 } while (!m_lineBreak.atEnd() && isEmptyInline(m_lineBreak.object())); |
1141 } | 1137 } |
1142 | 1138 |
1143 return m_lineBreak; | 1139 return m_lineBreak; |
1144 } | 1140 } |
1145 | 1141 |
1146 } | 1142 } |
1147 | 1143 |
1148 #endif // BreakingContextInlineHeaders_h | 1144 #endif // BreakingContextInlineHeaders_h |
OLD | NEW |