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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // If a space (U+0020) at the end of a line has 'white-space' set to 'normal
', 'nowrap', or 'pre-line', it is also removed. | 158 // If a space (U+0020) at the end of a line has 'white-space' set to 'normal
', 'nowrap', or 'pre-line', it is also removed. |
159 // If spaces (U+0020) or tabs (U+0009) at the end of a line have 'white-spac
e' set to 'pre-wrap', UAs may visually collapse them. | 159 // If spaces (U+0020) or tabs (U+0009) at the end of a line have 'white-spac
e' set to 'pre-wrap', UAs may visually collapse them. |
160 return style->collapseWhiteSpace() | 160 return style->collapseWhiteSpace() |
161 || (whitespacePosition == TrailingWhitespace && style->whiteSpace() == P
RE_WRAP && (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly())); | 161 || (whitespacePosition == TrailingWhitespace && style->whiteSpace() == P
RE_WRAP && (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly())); |
162 } | 162 } |
163 | 163 |
164 inline bool requiresLineBoxForContent(RenderInline* flow, const LineInfo& lineIn
fo) | 164 inline bool requiresLineBoxForContent(RenderInline* flow, const LineInfo& lineIn
fo) |
165 { | 165 { |
166 RenderObject* parent = flow->parent(); | 166 RenderObject* parent = flow->parent(); |
167 if (flow->document().inNoQuirksMode() | 167 if (flow->document().inNoQuirksMode() |
168 && (flow->style(lineInfo.isFirstLine())->lineHeight() != parent->style(l
ineInfo.isFirstLine())->lineHeight() | 168 && (flow->styleOrFirstLineStyle(lineInfo.isFirstLine())->lineHeight() !=
parent->styleOrFirstLineStyle(lineInfo.isFirstLine())->lineHeight() |
169 || flow->style()->verticalAlign() != parent->style()->verticalAlign() | 169 || flow->style()->verticalAlign() != parent->style()->verticalAlign() |
170 || !parent->style()->font().fontMetrics().hasIdenticalAscentDescentAndLi
neGap(flow->style()->font().fontMetrics()))) | 170 || !parent->style()->font().fontMetrics().hasIdenticalAscentDescentAndLi
neGap(flow->style()->font().fontMetrics()))) |
171 return true; | 171 return true; |
172 return false; | 172 return false; |
173 } | 173 } |
174 | 174 |
175 inline bool alwaysRequiresLineBox(RenderObject* flow) | 175 inline bool alwaysRequiresLineBox(RenderObject* flow) |
176 { | 176 { |
177 // FIXME: Right now, we only allow line boxes for inlines that are truly emp
ty. | 177 // FIXME: Right now, we only allow line boxes for inlines that are truly emp
ty. |
178 // We need to fix this, though, because at the very least, inlines containin
g only | 178 // We need to fix this, though, because at the very least, inlines containin
g only |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 RenderCombineText* combineRenderer = toRenderCombineText(m_current.objec
t()); | 537 RenderCombineText* combineRenderer = toRenderCombineText(m_current.objec
t()); |
538 combineRenderer->combineText(); | 538 combineRenderer->combineText(); |
539 // The length of the renderer's text may have changed. Increment stale i
terator positions | 539 // The length of the renderer's text may have changed. Increment stale i
terator positions |
540 if (iteratorIsBeyondEndOfRenderCombineText(m_lineBreak, combineRenderer)
) { | 540 if (iteratorIsBeyondEndOfRenderCombineText(m_lineBreak, combineRenderer)
) { |
541 ASSERT(iteratorIsBeyondEndOfRenderCombineText(m_resolver.position(),
combineRenderer)); | 541 ASSERT(iteratorIsBeyondEndOfRenderCombineText(m_resolver.position(),
combineRenderer)); |
542 m_lineBreak.increment(); | 542 m_lineBreak.increment(); |
543 m_resolver.position().increment(&m_resolver); | 543 m_resolver.position().increment(&m_resolver); |
544 } | 544 } |
545 } | 545 } |
546 | 546 |
547 RenderStyle* style = renderText->style(m_lineInfo.isFirstLine()); | 547 RenderStyle* style = renderText->styleOrFirstLineStyle(m_lineInfo.isFirstLin
e()); |
548 const Font& font = style->font(); | 548 const Font& font = style->font(); |
549 bool isFixedPitch = font.isFixedPitch(); | 549 bool isFixedPitch = font.isFixedPitch(); |
550 | 550 |
551 unsigned lastSpace = m_current.offset(); | 551 unsigned lastSpace = m_current.offset(); |
552 float wordSpacing = m_currentStyle->wordSpacing(); | 552 float wordSpacing = m_currentStyle->wordSpacing(); |
553 float lastSpaceWordSpacing = 0; | 553 float lastSpaceWordSpacing = 0; |
554 float wordSpacingForWordMeasurement = 0; | 554 float wordSpacingForWordMeasurement = 0; |
555 | 555 |
556 float wrapW = m_width.uncommittedWidth() + inlineLogicalWidth(m_current.obje
ct(), !m_appliedStartWidth, true); | 556 float wrapW = m_width.uncommittedWidth() + inlineLogicalWidth(m_current.obje
ct(), !m_appliedStartWidth, true); |
557 float charWidth = 0; | 557 float charWidth = 0; |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 | 890 |
891 if (style->textIndentType() == TextIndentHanging) | 891 if (style->textIndentType() == TextIndentHanging) |
892 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In
dentText; | 892 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In
dentText; |
893 | 893 |
894 return shouldIndentText; | 894 return shouldIndentText; |
895 } | 895 } |
896 | 896 |
897 } | 897 } |
898 | 898 |
899 #endif // BreakingContextInlineHeaders_h | 899 #endif // BreakingContextInlineHeaders_h |
OLD | NEW |