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 27 matching lines...) Expand all Loading... |
38 #include "sky/engine/core/rendering/line/TrailingObjects.h" | 38 #include "sky/engine/core/rendering/line/TrailingObjects.h" |
39 #include "sky/engine/core/rendering/line/WordMeasurement.h" | 39 #include "sky/engine/core/rendering/line/WordMeasurement.h" |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 // We don't let our line box tree for a single line get any deeper than this. | 43 // We don't let our line box tree for a single line get any deeper than this. |
44 const unsigned cMaxLineDepth = 200; | 44 const unsigned cMaxLineDepth = 200; |
45 | 45 |
46 class BreakingContext { | 46 class BreakingContext { |
47 public: | 47 public: |
48 BreakingContext(InlineBidiResolver& resolver, LineInfo& inLineInfo, LineWidt
h& lineWidth, RenderTextInfo& inRenderTextInfo, FloatingObject* inLastFloatFromP
reviousLine, bool appliedStartWidth, RenderBlockFlow* block) | 48 BreakingContext(InlineBidiResolver& resolver, LineInfo& inLineInfo, LineWidt
h& lineWidth, RenderTextInfo& inRenderTextInfo, FloatingObject* inLastFloatFromP
reviousLine, bool appliedStartWidth, RenderParagraph* block) |
49 : m_resolver(resolver) | 49 : m_resolver(resolver) |
50 , m_current(resolver.position()) | 50 , m_current(resolver.position()) |
51 , m_lineBreak(resolver.position()) | 51 , m_lineBreak(resolver.position()) |
52 , m_block(block) | 52 , m_block(block) |
53 , m_lastObject(m_current.object()) | 53 , m_lastObject(m_current.object()) |
54 , m_nextObject(0) | 54 , m_nextObject(0) |
55 , m_currentStyle(0) | 55 , m_currentStyle(0) |
56 , m_blockStyle(block->style()) | 56 , m_blockStyle(block->style()) |
57 , m_lineInfo(inLineInfo) | 57 , m_lineInfo(inLineInfo) |
58 , m_renderTextInfo(inRenderTextInfo) | 58 , m_renderTextInfo(inRenderTextInfo) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 m_lineBreak.clear(); | 98 m_lineBreak.clear(); |
99 } | 99 } |
100 | 100 |
101 private: | 101 private: |
102 InlineBidiResolver& m_resolver; | 102 InlineBidiResolver& m_resolver; |
103 | 103 |
104 InlineIterator m_current; | 104 InlineIterator m_current; |
105 InlineIterator m_lineBreak; | 105 InlineIterator m_lineBreak; |
106 InlineIterator m_startOfIgnoredSpaces; | 106 InlineIterator m_startOfIgnoredSpaces; |
107 | 107 |
108 RenderBlockFlow* m_block; | 108 RenderParagraph* m_block; |
109 RenderObject* m_lastObject; | 109 RenderObject* m_lastObject; |
110 RenderObject* m_nextObject; | 110 RenderObject* m_nextObject; |
111 | 111 |
112 RenderStyle* m_currentStyle; | 112 RenderStyle* m_currentStyle; |
113 RenderStyle* m_blockStyle; | 113 RenderStyle* m_blockStyle; |
114 | 114 |
115 LineInfo& m_lineInfo; | 115 LineInfo& m_lineInfo; |
116 | 116 |
117 RenderTextInfo& m_renderTextInfo; | 117 RenderTextInfo& m_renderTextInfo; |
118 | 118 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } else { | 285 } else { |
286 positionedObjects.append(box); | 286 positionedObjects.append(box); |
287 } | 287 } |
288 m_width.addUncommittedWidth(inlineLogicalWidth(box).toFloat()); | 288 m_width.addUncommittedWidth(inlineLogicalWidth(box).toFloat()); |
289 // Reset prior line break context characters. | 289 // Reset prior line break context characters. |
290 m_renderTextInfo.m_lineBreakIterator.resetPriorContext(); | 290 m_renderTextInfo.m_lineBreakIterator.resetPriorContext(); |
291 } | 291 } |
292 | 292 |
293 // This is currently just used for list markers and inline flows that have line
boxes. Neither should | 293 // This is currently just used for list markers and inline flows that have line
boxes. Neither should |
294 // have an effect on whitespace at the start of the line. | 294 // have an effect on whitespace at the start of the line. |
295 inline bool shouldSkipWhitespaceAfterStartObject(RenderBlockFlow* block, RenderO
bject* o, LineMidpointState& lineMidpointState) | 295 inline bool shouldSkipWhitespaceAfterStartObject(RenderParagraph* block, RenderO
bject* o, LineMidpointState& lineMidpointState) |
296 { | 296 { |
297 RenderObject* next = bidiNextSkippingEmptyInlines(block, o); | 297 RenderObject* next = bidiNextSkippingEmptyInlines(block, o); |
298 while (next && next->isFloatingOrOutOfFlowPositioned()) | 298 while (next && next->isFloatingOrOutOfFlowPositioned()) |
299 next = bidiNextSkippingEmptyInlines(block, next); | 299 next = bidiNextSkippingEmptyInlines(block, next); |
300 | 300 |
301 if (next && next->isText() && toRenderText(next)->textLength() > 0) { | 301 if (next && next->isText() && toRenderText(next)->textLength() > 0) { |
302 RenderText* nextText = toRenderText(next); | 302 RenderText* nextText = toRenderText(next); |
303 UChar nextChar = nextText->characterAt(0); | 303 UChar nextChar = nextText->characterAt(0); |
304 if (nextText->style()->isCollapsibleWhiteSpace(nextChar)) { | 304 if (nextText->style()->isCollapsibleWhiteSpace(nextChar)) { |
305 lineMidpointState.startIgnoringSpaces(InlineIterator(0, o, 0)); | 305 lineMidpointState.startIgnoringSpaces(InlineIterator(0, o, 0)); |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 | 761 |
762 if (style->textIndentType() == TextIndentHanging) | 762 if (style->textIndentType() == TextIndentHanging) |
763 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In
dentText; | 763 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In
dentText; |
764 | 764 |
765 return shouldIndentText; | 765 return shouldIndentText; |
766 } | 766 } |
767 | 767 |
768 } | 768 } |
769 | 769 |
770 #endif // SKY_ENGINE_CORE_RENDERING_LINE_BREAKINGCONTEXTINLINEHEADERS_H_ | 770 #endif // SKY_ENGINE_CORE_RENDERING_LINE_BREAKINGCONTEXTINLINEHEADERS_H_ |
OLD | NEW |