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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 const unsigned cMaxLineDepth = 200; | 48 const unsigned cMaxLineDepth = 200; |
49 | 49 |
50 class BreakingContext { | 50 class BreakingContext { |
51 public: | 51 public: |
52 BreakingContext(InlineBidiResolver& resolver, LineInfo& inLineInfo, LineWidt
h& lineWidth, LayoutTextInfo& inLayoutTextInfo, FloatingObject* inLastFloatFromP
reviousLine, bool appliedStartWidth, LayoutBlockFlow* block) | 52 BreakingContext(InlineBidiResolver& resolver, LineInfo& inLineInfo, LineWidt
h& lineWidth, LayoutTextInfo& inLayoutTextInfo, FloatingObject* inLastFloatFromP
reviousLine, bool appliedStartWidth, LayoutBlockFlow* block) |
53 : m_resolver(resolver) | 53 : m_resolver(resolver) |
54 , m_current(resolver.position()) | 54 , m_current(resolver.position()) |
55 , m_lineBreak(resolver.position()) | 55 , m_lineBreak(resolver.position()) |
56 , m_block(block) | 56 , m_block(block) |
57 , m_lastObject(m_current.object()) | 57 , m_lastObject(m_current.object()) |
58 , m_nextObject(0) | 58 , m_nextObject(nullptr) |
59 , m_currentStyle(0) | 59 , m_currentStyle(nullptr) |
60 , m_blockStyle(block->style()) | 60 , m_blockStyle(block->style()) |
61 , m_lineInfo(inLineInfo) | 61 , m_lineInfo(inLineInfo) |
62 , m_layoutTextInfo(inLayoutTextInfo) | 62 , m_layoutTextInfo(inLayoutTextInfo) |
63 , m_lastFloatFromPreviousLine(inLastFloatFromPreviousLine) | 63 , m_lastFloatFromPreviousLine(inLastFloatFromPreviousLine) |
64 , m_width(lineWidth) | 64 , m_width(lineWidth) |
65 , m_currWS(NORMAL) | 65 , m_currWS(NORMAL) |
66 , m_lastWS(NORMAL) | 66 , m_lastWS(NORMAL) |
67 , m_preservesNewline(false) | 67 , m_preservesNewline(false) |
68 , m_atStart(true) | 68 , m_atStart(true) |
69 , m_ignoringSpaces(false) | 69 , m_ignoringSpaces(false) |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 return font.width(constructTextRun(layoutText, font, | 502 return font.width(constructTextRun(layoutText, font, |
503 style.hyphenString().string(), style, style.direction())); | 503 style.hyphenString().string(), style, style.direction())); |
504 } | 504 } |
505 | 505 |
506 ALWAYS_INLINE TextDirection textDirectionFromUnicode(WTF::Unicode::Direction dir
ection) | 506 ALWAYS_INLINE TextDirection textDirectionFromUnicode(WTF::Unicode::Direction dir
ection) |
507 { | 507 { |
508 return direction == WTF::Unicode::RightToLeft | 508 return direction == WTF::Unicode::RightToLeft |
509 || direction == WTF::Unicode::RightToLeftArabic ? RTL : LTR; | 509 || direction == WTF::Unicode::RightToLeftArabic ? RTL : LTR; |
510 } | 510 } |
511 | 511 |
512 ALWAYS_INLINE float textWidth(LayoutText* text, unsigned from, unsigned len, con
st Font& font, float xPos, bool collapseWhiteSpace, HashSet<const SimpleFontData
*>* fallbackFonts = 0) | 512 ALWAYS_INLINE float textWidth(LayoutText* text, unsigned from, unsigned len, con
st Font& font, float xPos, bool collapseWhiteSpace, HashSet<const SimpleFontData
*>* fallbackFonts = nullptr) |
513 { | 513 { |
514 GlyphOverflow glyphOverflow; | 514 GlyphOverflow glyphOverflow; |
515 if ((!from && len == text->textLength()) || text->style()->hasTextCombine()) | 515 if ((!from && len == text->textLength()) || text->style()->hasTextCombine()) |
516 return text->width(from, len, font, xPos, text->style()->direction(), fa
llbackFonts, &glyphOverflow); | 516 return text->width(from, len, font, xPos, text->style()->direction(), fa
llbackFonts, &glyphOverflow); |
517 | 517 |
518 TextRun run = constructTextRun(text, font, text, from, len, text->styleRef()
); | 518 TextRun run = constructTextRun(text, font, text, from, len, text->styleRef()
); |
519 run.setCodePath(text->canUseSimpleFontCodePath() ? TextRun::ForceSimple : Te
xtRun::ForceComplex); | 519 run.setCodePath(text->canUseSimpleFontCodePath() ? TextRun::ForceSimple : Te
xtRun::ForceComplex); |
520 run.setTabSize(!collapseWhiteSpace, text->style()->tabSize()); | 520 run.setTabSize(!collapseWhiteSpace, text->style()->tabSize()); |
521 run.setXPos(xPos); | 521 run.setXPos(xPos); |
522 return font.width(run, fallbackFonts, &glyphOverflow); | 522 return font.width(run, fallbackFonts, &glyphOverflow); |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 | 899 |
900 if (style.textIndentType() == TextIndentHanging) | 900 if (style.textIndentType() == TextIndentHanging) |
901 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In
dentText; | 901 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In
dentText; |
902 | 902 |
903 return shouldIndentText; | 903 return shouldIndentText; |
904 } | 904 } |
905 | 905 |
906 } | 906 } |
907 | 907 |
908 #endif // BreakingContextInlineHeaders_h | 908 #endif // BreakingContextInlineHeaders_h |
OLD | NEW |