Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: Source/WebCore/rendering/RenderBlockLineLayout.cpp

Issue 14150014: Merge 147660 "Source/WebCore: InlineIterator needs to be updated..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1453/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/text/international/combine-at-line-break-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 *
(...skipping 2593 matching lines...) Expand 10 before | Expand all | Expand 10 after
2604 // If we hit a new line break, just stop adding anything to this line. 2604 // If we hit a new line break, just stop adding anything to this line.
2605 break; 2605 break;
2606 } 2606 }
2607 } 2607 }
2608 } 2608 }
2609 resolver.setPositionIgnoringNestedIsolates(oldEnd); 2609 resolver.setPositionIgnoringNestedIsolates(oldEnd);
2610 return end; 2610 return end;
2611 #endif 2611 #endif
2612 } 2612 }
2613 2613
2614 static inline bool iteratorIsBeyondEndOfRenderCombineText(const InlineIterator& iter, RenderCombineText* renderer)
2615 {
2616 return iter.m_obj == renderer && iter.m_pos >= renderer->textLength();
2617 }
2618
2614 InlineIterator RenderBlock::LineBreaker::nextSegmentBreak(InlineBidiResolver& re solver, LineInfo& lineInfo, RenderTextInfo& renderTextInfo, FloatingObject* last FloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements& wo rdMeasurements) 2619 InlineIterator RenderBlock::LineBreaker::nextSegmentBreak(InlineBidiResolver& re solver, LineInfo& lineInfo, RenderTextInfo& renderTextInfo, FloatingObject* last FloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements& wo rdMeasurements)
2615 { 2620 {
2616 reset(); 2621 reset();
2617 2622
2618 ASSERT(resolver.position().root() == m_block); 2623 ASSERT(resolver.position().root() == m_block);
2619 2624
2620 bool appliedStartWidth = resolver.position().m_pos > 0; 2625 bool appliedStartWidth = resolver.position().m_pos > 0;
2621 bool includeEndWidth = true; 2626 bool includeEndWidth = true;
2622 LineMidpointState& lineMidpointState = resolver.midpointState(); 2627 LineMidpointState& lineMidpointState = resolver.midpointState();
2623 2628
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
2823 } else if (current.m_obj->isText()) { 2828 } else if (current.m_obj->isText()) {
2824 if (!current.m_pos) 2829 if (!current.m_pos)
2825 appliedStartWidth = false; 2830 appliedStartWidth = false;
2826 2831
2827 RenderText* t = toRenderText(current.m_obj); 2832 RenderText* t = toRenderText(current.m_obj);
2828 2833
2829 #if ENABLE(SVG) 2834 #if ENABLE(SVG)
2830 bool isSVGText = t->isSVGInlineText(); 2835 bool isSVGText = t->isSVGInlineText();
2831 #endif 2836 #endif
2832 2837
2833 if (t->style()->hasTextCombine() && current.m_obj->isCombineText() & & !toRenderCombineText(current.m_obj)->isCombined()) 2838 if (t->style()->hasTextCombine() && current.m_obj->isCombineText() & & !toRenderCombineText(current.m_obj)->isCombined()) {
2834 toRenderCombineText(current.m_obj)->combineText(); 2839 RenderCombineText* combineRenderer = toRenderCombineText(current .m_obj);
2840 combineRenderer->combineText();
2841 // The length of the renderer's text may have changed. Increment stale iterator positions
2842 if (iteratorIsBeyondEndOfRenderCombineText(lBreak, combineRender er)) {
2843 ASSERT(iteratorIsBeyondEndOfRenderCombineText(resolver.posit ion(), combineRenderer));
2844 lBreak.increment();
2845 resolver.increment();
2846 }
2847 }
2835 2848
2836 RenderStyle* style = t->style(lineInfo.isFirstLine()); 2849 RenderStyle* style = t->style(lineInfo.isFirstLine());
2837 const Font& f = style->font(); 2850 const Font& f = style->font();
2838 bool isFixedPitch = f.isFixedPitch(); 2851 bool isFixedPitch = f.isFixedPitch();
2839 bool canHyphenate = style->hyphens() == HyphensAuto && WebCore::canH yphenate(style->locale()); 2852 bool canHyphenate = style->hyphens() == HyphensAuto && WebCore::canH yphenate(style->locale());
2840 2853
2841 unsigned lastSpace = current.m_pos; 2854 unsigned lastSpace = current.m_pos;
2842 float wordSpacing = currentStyle->wordSpacing(); 2855 float wordSpacing = currentStyle->wordSpacing();
2843 float lastSpaceWordSpacing = 0; 2856 float lastSpaceWordSpacing = 0;
2844 float wordSpacingForWordMeasurement = 0; 2857 float wordSpacingForWordMeasurement = 0;
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
3397 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver ticalPositionCache); 3410 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver ticalPositionCache);
3398 3411
3399 setLineGridBox(lineGridBox); 3412 setLineGridBox(lineGridBox);
3400 3413
3401 // FIXME: If any of the characteristics of the box change compared to the ol d one, then we need to do a deep dirtying 3414 // FIXME: If any of the characteristics of the box change compared to the ol d one, then we need to do a deep dirtying
3402 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping 3415 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping
3403 // to this grid. 3416 // to this grid.
3404 } 3417 }
3405 3418
3406 } 3419 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/text/international/combine-at-line-break-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698