| 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 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| 11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
| 15 * | 15 * |
| 16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
| 17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
| 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
| 20 * | 20 * |
| 21 */ | 21 */ |
| 22 | 22 |
| 23 #include "config.h" | 23 #include "config.h" |
| 24 | 24 |
| 25 #include "core/platform/text/BidiResolver.h" | 25 #include "core/platform/text/BidiResolver.h" |
| 26 #include "core/platform/text/Hyphenation.h" | |
| 27 #include "core/rendering/InlineIterator.h" | 26 #include "core/rendering/InlineIterator.h" |
| 28 #include "core/rendering/InlineTextBox.h" | 27 #include "core/rendering/InlineTextBox.h" |
| 29 #include "core/rendering/RenderCombineText.h" | 28 #include "core/rendering/RenderCombineText.h" |
| 30 #include "core/rendering/RenderCounter.h" | 29 #include "core/rendering/RenderCounter.h" |
| 31 #include "core/rendering/RenderFlowThread.h" | 30 #include "core/rendering/RenderFlowThread.h" |
| 32 #include "core/rendering/RenderInline.h" | 31 #include "core/rendering/RenderInline.h" |
| 33 #include "core/rendering/RenderLayer.h" | 32 #include "core/rendering/RenderLayer.h" |
| 34 #include "core/rendering/RenderListMarker.h" | 33 #include "core/rendering/RenderListMarker.h" |
| 35 #include "core/rendering/RenderRegion.h" | 34 #include "core/rendering/RenderRegion.h" |
| 36 #include "core/rendering/RenderRubyRun.h" | 35 #include "core/rendering/RenderRubyRun.h" |
| (...skipping 2392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2429 TextRun run = RenderBlock::constructTextRun(text, font, text, from, len, tex
t->style()); | 2428 TextRun run = RenderBlock::constructTextRun(text, font, text, from, len, tex
t->style()); |
| 2430 run.setCharactersLength(text->textLength() - from); | 2429 run.setCharactersLength(text->textLength() - from); |
| 2431 ASSERT(run.charactersLength() >= run.length()); | 2430 ASSERT(run.charactersLength() >= run.length()); |
| 2432 | 2431 |
| 2433 run.setCharacterScanForCodePath(!text->canUseSimpleFontCodePath()); | 2432 run.setCharacterScanForCodePath(!text->canUseSimpleFontCodePath()); |
| 2434 run.setTabSize(!collapseWhiteSpace, text->style()->tabSize()); | 2433 run.setTabSize(!collapseWhiteSpace, text->style()->tabSize()); |
| 2435 run.setXPos(xPos); | 2434 run.setXPos(xPos); |
| 2436 return font.width(run, fallbackFonts, &glyphOverflow); | 2435 return font.width(run, fallbackFonts, &glyphOverflow); |
| 2437 } | 2436 } |
| 2438 | 2437 |
| 2439 static void tryHyphenating(RenderText* text, const Font& font, const AtomicStrin
g& localeIdentifier, unsigned consecutiveHyphenatedLines, int consecutiveHyphena
tedLinesLimit, int minimumPrefixLimit, int minimumSuffixLimit, unsigned lastSpac
e, unsigned pos, float xPos, int availableWidth, bool isFixedPitch, bool collaps
eWhiteSpace, int lastSpaceWordSpacing, InlineIterator& lineBreak, int nextBreaka
ble, bool& hyphenated) | |
| 2440 { | |
| 2441 // Map 'hyphenate-limit-{before,after}: auto;' to 2. | |
| 2442 unsigned minimumPrefixLength; | |
| 2443 unsigned minimumSuffixLength; | |
| 2444 | |
| 2445 if (minimumPrefixLimit < 0) | |
| 2446 minimumPrefixLength = 2; | |
| 2447 else | |
| 2448 minimumPrefixLength = static_cast<unsigned>(minimumPrefixLimit); | |
| 2449 | |
| 2450 if (minimumSuffixLimit < 0) | |
| 2451 minimumSuffixLength = 2; | |
| 2452 else | |
| 2453 minimumSuffixLength = static_cast<unsigned>(minimumSuffixLimit); | |
| 2454 | |
| 2455 if (pos - lastSpace <= minimumSuffixLength) | |
| 2456 return; | |
| 2457 | |
| 2458 if (consecutiveHyphenatedLinesLimit >= 0 && consecutiveHyphenatedLines >= st
atic_cast<unsigned>(consecutiveHyphenatedLinesLimit)) | |
| 2459 return; | |
| 2460 | |
| 2461 int hyphenWidth = measureHyphenWidth(text, font); | |
| 2462 | |
| 2463 float maxPrefixWidth = availableWidth - xPos - hyphenWidth - lastSpaceWordSp
acing; | |
| 2464 // If the maximum width available for the prefix before the hyphen is small,
then it is very unlikely | |
| 2465 // that an hyphenation opportunity exists, so do not bother to look for it. | |
| 2466 if (maxPrefixWidth <= font.pixelSize() * 5 / 4) | |
| 2467 return; | |
| 2468 | |
| 2469 TextRun run = RenderBlock::constructTextRun(text, font, text, lastSpace, pos
- lastSpace, text->style()); | |
| 2470 run.setCharactersLength(text->textLength() - lastSpace); | |
| 2471 ASSERT(run.charactersLength() >= run.length()); | |
| 2472 | |
| 2473 run.setTabSize(!collapseWhiteSpace, text->style()->tabSize()); | |
| 2474 run.setXPos(xPos + lastSpaceWordSpacing); | |
| 2475 | |
| 2476 unsigned prefixLength = font.offsetForPosition(run, maxPrefixWidth, false); | |
| 2477 if (prefixLength < minimumPrefixLength) | |
| 2478 return; | |
| 2479 | |
| 2480 prefixLength = lastHyphenLocation(text->substring(lastSpace, pos - lastSpace
), min(prefixLength, pos - lastSpace - minimumSuffixLength) + 1, localeIdentifie
r); | |
| 2481 if (!prefixLength || prefixLength < minimumPrefixLength) | |
| 2482 return; | |
| 2483 | |
| 2484 // When lastSapce is a space, which it always is except sometimes at the beg
inning of a line or after collapsed | |
| 2485 // space, it should not count towards hyphenate-limit-before. | |
| 2486 if (prefixLength == minimumPrefixLength) { | |
| 2487 UChar characterAtLastSpace = text->characterAt(lastSpace); | |
| 2488 if (characterAtLastSpace == ' ' || characterAtLastSpace == '\n' || chara
cterAtLastSpace == '\t' || characterAtLastSpace == noBreakSpace) | |
| 2489 return; | |
| 2490 } | |
| 2491 | |
| 2492 ASSERT(pos - lastSpace - prefixLength >= minimumSuffixLength); | |
| 2493 | |
| 2494 #if !ASSERT_DISABLED | |
| 2495 float prefixWidth = hyphenWidth + textWidth(text, lastSpace, prefixLength, f
ont, xPos, isFixedPitch, collapseWhiteSpace) + lastSpaceWordSpacing; | |
| 2496 ASSERT(xPos + prefixWidth <= availableWidth); | |
| 2497 #else | |
| 2498 UNUSED_PARAM(isFixedPitch); | |
| 2499 #endif | |
| 2500 | |
| 2501 lineBreak.moveTo(text, lastSpace + prefixLength, nextBreakable); | |
| 2502 hyphenated = true; | |
| 2503 } | |
| 2504 | |
| 2505 class TrailingObjects { | 2438 class TrailingObjects { |
| 2506 public: | 2439 public: |
| 2507 TrailingObjects(); | 2440 TrailingObjects(); |
| 2508 void setTrailingWhitespace(RenderText*); | 2441 void setTrailingWhitespace(RenderText*); |
| 2509 void clear(); | 2442 void clear(); |
| 2510 void appendBoxIfNeeded(RenderBox*); | 2443 void appendBoxIfNeeded(RenderBox*); |
| 2511 | 2444 |
| 2512 enum CollapseFirstSpaceOrNot { DoNotCollapseFirstSpace, CollapseFirstSpace }
; | 2445 enum CollapseFirstSpaceOrNot { DoNotCollapseFirstSpace, CollapseFirstSpace }
; |
| 2513 | 2446 |
| 2514 void updateMidpointsForTrailingBoxes(LineMidpointState&, const InlineIterato
r& lBreak, CollapseFirstSpaceOrNot); | 2447 void updateMidpointsForTrailingBoxes(LineMidpointState&, const InlineIterato
r& lBreak, CollapseFirstSpaceOrNot); |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2864 if (iteratorIsBeyondEndOfRenderCombineText(lBreak, combineRender
er)) { | 2797 if (iteratorIsBeyondEndOfRenderCombineText(lBreak, combineRender
er)) { |
| 2865 ASSERT(iteratorIsBeyondEndOfRenderCombineText(resolver.posit
ion(), combineRenderer)); | 2798 ASSERT(iteratorIsBeyondEndOfRenderCombineText(resolver.posit
ion(), combineRenderer)); |
| 2866 lBreak.increment(); | 2799 lBreak.increment(); |
| 2867 resolver.increment(); | 2800 resolver.increment(); |
| 2868 } | 2801 } |
| 2869 } | 2802 } |
| 2870 | 2803 |
| 2871 RenderStyle* style = t->style(lineInfo.isFirstLine()); | 2804 RenderStyle* style = t->style(lineInfo.isFirstLine()); |
| 2872 const Font& f = style->font(); | 2805 const Font& f = style->font(); |
| 2873 bool isFixedPitch = f.isFixedPitch(); | 2806 bool isFixedPitch = f.isFixedPitch(); |
| 2874 bool canHyphenate = style->hyphens() == HyphensAuto && WebCore::canH
yphenate(style->locale()); | |
| 2875 | 2807 |
| 2876 unsigned lastSpace = current.m_pos; | 2808 unsigned lastSpace = current.m_pos; |
| 2877 float wordSpacing = currentStyle->wordSpacing(); | 2809 float wordSpacing = currentStyle->wordSpacing(); |
| 2878 float lastSpaceWordSpacing = 0; | 2810 float lastSpaceWordSpacing = 0; |
| 2879 float wordSpacingForWordMeasurement = 0; | 2811 float wordSpacingForWordMeasurement = 0; |
| 2880 | 2812 |
| 2881 float wrapW = width.uncommittedWidth() + inlineLogicalWidth(current.
m_obj, !appliedStartWidth, true); | 2813 float wrapW = width.uncommittedWidth() + inlineLogicalWidth(current.
m_obj, !appliedStartWidth, true); |
| 2882 float charWidth = 0; | 2814 float charWidth = 0; |
| 2883 // Auto-wrapping text should wrap in the middle of a word only if it
could not wrap before the word, | 2815 // Auto-wrapping text should wrap in the middle of a word only if it
could not wrap before the word, |
| 2884 // which is only possible if the word is the first thing on the line
, that is, if |w| is zero. | 2816 // which is only possible if the word is the first thing on the line
, that is, if |w| is zero. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2919 UChar secondToLastCharacter = renderTextInfo.m_lineBreakIterator.sec
ondToLastCharacter(); | 2851 UChar secondToLastCharacter = renderTextInfo.m_lineBreakIterator.sec
ondToLastCharacter(); |
| 2920 for (; current.m_pos < t->textLength(); current.fastIncrementInTextN
ode()) { | 2852 for (; current.m_pos < t->textLength(); current.fastIncrementInTextN
ode()) { |
| 2921 bool previousCharacterIsSpace = currentCharacterIsSpace; | 2853 bool previousCharacterIsSpace = currentCharacterIsSpace; |
| 2922 bool previousCharacterShouldCollapseIfPreWap = currentCharacterS
houldCollapseIfPreWap; | 2854 bool previousCharacterShouldCollapseIfPreWap = currentCharacterS
houldCollapseIfPreWap; |
| 2923 UChar c = current.current(); | 2855 UChar c = current.current(); |
| 2924 currentCharacterShouldCollapseIfPreWap = currentCharacterIsSpace
= c == ' ' || c == '\t' || (!preserveNewline && (c == '\n')); | 2856 currentCharacterShouldCollapseIfPreWap = currentCharacterIsSpace
= c == ' ' || c == '\t' || (!preserveNewline && (c == '\n')); |
| 2925 | 2857 |
| 2926 if (!collapseWhiteSpace || !currentCharacterIsSpace) | 2858 if (!collapseWhiteSpace || !currentCharacterIsSpace) |
| 2927 lineInfo.setEmpty(false, m_block, &width); | 2859 lineInfo.setEmpty(false, m_block, &width); |
| 2928 | 2860 |
| 2929 if (c == softHyphen && autoWrap && !hyphenWidth && style->hyphen
s() != HyphensNone) { | 2861 if (c == softHyphen && autoWrap && !hyphenWidth) { |
| 2930 hyphenWidth = measureHyphenWidth(t, f); | 2862 hyphenWidth = measureHyphenWidth(t, f); |
| 2931 width.addUncommittedWidth(hyphenWidth); | 2863 width.addUncommittedWidth(hyphenWidth); |
| 2932 } | 2864 } |
| 2933 | 2865 |
| 2934 bool applyWordSpacing = false; | 2866 bool applyWordSpacing = false; |
| 2935 | 2867 |
| 2936 if ((breakAll || breakWords) && !midWordBreak) { | 2868 if ((breakAll || breakWords) && !midWordBreak) { |
| 2937 wrapW += charWidth; | 2869 wrapW += charWidth; |
| 2938 bool midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) && c
urrent.m_pos + 1 < t->textLength() && U16_IS_TRAIL((*t)[current.m_pos + 1]); | 2870 bool midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) && c
urrent.m_pos + 1 < t->textLength() && U16_IS_TRAIL((*t)[current.m_pos + 1]); |
| 2939 charWidth = textWidth(t, current.m_pos, midWordBreakIsBefore
SurrogatePair ? 2 : 1, f, width.committedWidth() + wrapW, isFixedPitch, collapse
WhiteSpace, 0, textLayout); | 2871 charWidth = textWidth(t, current.m_pos, midWordBreakIsBefore
SurrogatePair ? 2 : 1, f, width.committedWidth() + wrapW, isFixedPitch, collapse
WhiteSpace, 0, textLayout); |
| 2940 midWordBreak = width.committedWidth() + wrapW + charWidth >
width.availableWidth(); | 2872 midWordBreak = width.committedWidth() + wrapW + charWidth >
width.availableWidth(); |
| 2941 } | 2873 } |
| 2942 | 2874 |
| 2943 bool betweenWords = c == '\n' || (currWS != PRE && !atStart && i
sBreakable(renderTextInfo.m_lineBreakIterator, current.m_pos, current.m_nextBrea
kablePosition) | 2875 bool betweenWords = c == '\n' || (currWS != PRE && !atStart && i
sBreakable(renderTextInfo.m_lineBreakIterator, current.m_pos, current.m_nextBrea
kablePosition)); |
| 2944 && (style->hyphens() != HyphensNone || (current.previousInSa
meNode() != softHyphen))); | |
| 2945 | 2876 |
| 2946 if (betweenWords || midWordBreak) { | 2877 if (betweenWords || midWordBreak) { |
| 2947 bool stoppedIgnoringSpaces = false; | 2878 bool stoppedIgnoringSpaces = false; |
| 2948 if (ignoringSpaces) { | 2879 if (ignoringSpaces) { |
| 2949 lastSpaceWordSpacing = 0; | 2880 lastSpaceWordSpacing = 0; |
| 2950 if (!currentCharacterIsSpace) { | 2881 if (!currentCharacterIsSpace) { |
| 2951 // Stop ignoring spaces and begin at this | 2882 // Stop ignoring spaces and begin at this |
| 2952 // new point. | 2883 // new point. |
| 2953 ignoringSpaces = false; | 2884 ignoringSpaces = false; |
| 2954 wordSpacingForWordMeasurement = 0; | 2885 wordSpacingForWordMeasurement = 0; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2998 // If the line needs the extra whitespace to be too
long, | 2929 // If the line needs the extra whitespace to be too
long, |
| 2999 // then move the line break to the space and skip al
l | 2930 // then move the line break to the space and skip al
l |
| 3000 // additional whitespace. | 2931 // additional whitespace. |
| 3001 if (!width.fitsOnLine(charWidth)) { | 2932 if (!width.fitsOnLine(charWidth)) { |
| 3002 lineWasTooWide = true; | 2933 lineWasTooWide = true; |
| 3003 lBreak.moveTo(current.m_obj, current.m_pos, curr
ent.m_nextBreakablePosition); | 2934 lBreak.moveTo(current.m_obj, current.m_pos, curr
ent.m_nextBreakablePosition); |
| 3004 skipTrailingWhitespace(lBreak, lineInfo); | 2935 skipTrailingWhitespace(lBreak, lineInfo); |
| 3005 } | 2936 } |
| 3006 } | 2937 } |
| 3007 if (lineWasTooWide || !width.fitsOnLine()) { | 2938 if (lineWasTooWide || !width.fitsOnLine()) { |
| 3008 if (canHyphenate && !width.fitsOnLine()) { | |
| 3009 tryHyphenating(t, f, style->locale(), consecutiv
eHyphenatedLines, blockStyle->hyphenationLimitLines(), style->hyphenationLimitBe
fore(), style->hyphenationLimitAfter(), lastSpace, current.m_pos, width.currentW
idth() - additionalTmpW, width.availableWidth(), isFixedPitch, collapseWhiteSpac
e, lastSpaceWordSpacing, lBreak, current.m_nextBreakablePosition, m_hyphenated); | |
| 3010 if (m_hyphenated) | |
| 3011 goto end; | |
| 3012 } | |
| 3013 if (lBreak.atTextParagraphSeparator()) { | 2939 if (lBreak.atTextParagraphSeparator()) { |
| 3014 if (!stoppedIgnoringSpaces && current.m_pos > 0) | 2940 if (!stoppedIgnoringSpaces && current.m_pos > 0) |
| 3015 ensureCharacterGetsLineBox(lineMidpointState
, current); | 2941 ensureCharacterGetsLineBox(lineMidpointState
, current); |
| 3016 lBreak.increment(); | 2942 lBreak.increment(); |
| 3017 lineInfo.setPreviousLineBrokeCleanly(true); | 2943 lineInfo.setPreviousLineBrokeCleanly(true); |
| 3018 wordMeasurement.endOffset = lBreak.m_pos; | 2944 wordMeasurement.endOffset = lBreak.m_pos; |
| 3019 } | 2945 } |
| 3020 if (lBreak.m_obj && lBreak.m_pos && lBreak.m_obj->is
Text() && toRenderText(lBreak.m_obj)->textLength() && toRenderText(lBreak.m_obj)
->characterAt(lBreak.m_pos - 1) == softHyphen && style->hyphens() != HyphensNone
) | 2946 if (lBreak.m_obj && lBreak.m_pos && lBreak.m_obj->is
Text() && toRenderText(lBreak.m_obj)->textLength() && toRenderText(lBreak.m_obj)
->characterAt(lBreak.m_pos - 1) == softHyphen) |
| 3021 m_hyphenated = true; | 2947 m_hyphenated = true; |
| 3022 if (lBreak.m_pos && lBreak.m_pos != (unsigned)wordMe
asurement.endOffset && !wordMeasurement.width) { | 2948 if (lBreak.m_pos && lBreak.m_pos != (unsigned)wordMe
asurement.endOffset && !wordMeasurement.width) { |
| 3023 if (charWidth) { | 2949 if (charWidth) { |
| 3024 wordMeasurement.endOffset = lBreak.m_pos; | 2950 wordMeasurement.endOffset = lBreak.m_pos; |
| 3025 wordMeasurement.width = charWidth; | 2951 wordMeasurement.width = charWidth; |
| 3026 } | 2952 } |
| 3027 } | 2953 } |
| 3028 // Didn't fit. Jump to the end unless there's still
an opportunity to collapse whitespace. | 2954 // Didn't fit. Jump to the end unless there's still
an opportunity to collapse whitespace. |
| 3029 if (ignoringSpaces || !collapseWhiteSpace || !curren
tCharacterIsSpace || !previousCharacterIsSpace) | 2955 if (ignoringSpaces || !collapseWhiteSpace || !curren
tCharacterIsSpace || !previousCharacterIsSpace) |
| 3030 goto end; | 2956 goto end; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3130 // IMPORTANT: current.m_pos is > length here! | 3056 // IMPORTANT: current.m_pos is > length here! |
| 3131 float additionalTmpW = ignoringSpaces ? 0 : textWidth(t, lastSpace,
current.m_pos - lastSpace, f, width.currentWidth(), isFixedPitch, collapseWhiteS
pace, &wordMeasurement.fallbackFonts, textLayout); | 3057 float additionalTmpW = ignoringSpaces ? 0 : textWidth(t, lastSpace,
current.m_pos - lastSpace, f, width.currentWidth(), isFixedPitch, collapseWhiteS
pace, &wordMeasurement.fallbackFonts, textLayout); |
| 3132 wordMeasurement.startOffset = lastSpace; | 3058 wordMeasurement.startOffset = lastSpace; |
| 3133 wordMeasurement.endOffset = current.m_pos; | 3059 wordMeasurement.endOffset = current.m_pos; |
| 3134 wordMeasurement.width = ignoringSpaces ? 0 : additionalTmpW + wordSp
acingForWordMeasurement; | 3060 wordMeasurement.width = ignoringSpaces ? 0 : additionalTmpW + wordSp
acingForWordMeasurement; |
| 3135 additionalTmpW += lastSpaceWordSpacing; | 3061 additionalTmpW += lastSpaceWordSpacing; |
| 3136 width.addUncommittedWidth(additionalTmpW + inlineLogicalWidth(curren
t.m_obj, !appliedStartWidth, includeEndWidth)); | 3062 width.addUncommittedWidth(additionalTmpW + inlineLogicalWidth(curren
t.m_obj, !appliedStartWidth, includeEndWidth)); |
| 3137 includeEndWidth = false; | 3063 includeEndWidth = false; |
| 3138 | 3064 |
| 3139 if (!width.fitsOnLine()) { | 3065 if (!width.fitsOnLine()) { |
| 3140 if (canHyphenate) | 3066 if (!m_hyphenated && lBreak.previousInSameNode() == softHyphen) |
| 3141 tryHyphenating(t, f, style->locale(), consecutiveHyphenatedL
ines, blockStyle->hyphenationLimitLines(), style->hyphenationLimitBefore(), styl
e->hyphenationLimitAfter(), lastSpace, current.m_pos, width.currentWidth() - add
itionalTmpW, width.availableWidth(), isFixedPitch, collapseWhiteSpace, lastSpace
WordSpacing, lBreak, current.m_nextBreakablePosition, m_hyphenated); | |
| 3142 | |
| 3143 if (!m_hyphenated && lBreak.previousInSameNode() == softHyphen &
& style->hyphens() != HyphensNone) | |
| 3144 m_hyphenated = true; | 3067 m_hyphenated = true; |
| 3145 | 3068 |
| 3146 if (m_hyphenated) | 3069 if (m_hyphenated) |
| 3147 goto end; | 3070 goto end; |
| 3148 } | 3071 } |
| 3149 } else | 3072 } else |
| 3150 ASSERT_NOT_REACHED(); | 3073 ASSERT_NOT_REACHED(); |
| 3151 | 3074 |
| 3152 bool checkForBreak = autoWrap; | 3075 bool checkForBreak = autoWrap; |
| 3153 if (width.committedWidth() && !width.fitsOnLine() && lBreak.m_obj && cur
rWS == NOWRAP) | 3076 if (width.committedWidth() && !width.fitsOnLine() && lBreak.m_obj && cur
rWS == NOWRAP) |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3430 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver
ticalPositionCache); | 3353 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver
ticalPositionCache); |
| 3431 | 3354 |
| 3432 setLineGridBox(lineGridBox); | 3355 setLineGridBox(lineGridBox); |
| 3433 | 3356 |
| 3434 // FIXME: If any of the characteristics of the box change compared to the ol
d one, then we need to do a deep dirtying | 3357 // FIXME: If any of the characteristics of the box change compared to the ol
d one, then we need to do a deep dirtying |
| 3435 // (similar to what happens when the page height changes). Ideally, though,
we only do this if someone is actually snapping | 3358 // (similar to what happens when the page height changes). Ideally, though,
we only do this if someone is actually snapping |
| 3436 // to this grid. | 3359 // to this grid. |
| 3437 } | 3360 } |
| 3438 | 3361 |
| 3439 } | 3362 } |
| OLD | NEW |