| 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 * |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 } | 237 } |
| 238 | 238 |
| 239 static TextDirection determinePlaintextDirectionality(RenderObject* root, Render
Object* current = 0, unsigned pos = 0) | 239 static TextDirection determinePlaintextDirectionality(RenderObject* root, Render
Object* current = 0, unsigned pos = 0) |
| 240 { | 240 { |
| 241 InlineIterator iter(root, firstRenderObjectForDirectionalityDetermination(ro
ot, current), pos); | 241 InlineIterator iter(root, firstRenderObjectForDirectionalityDetermination(ro
ot, current), pos); |
| 242 InlineBidiResolver observer; | 242 InlineBidiResolver observer; |
| 243 observer.setPositionIgnoringNestedIsolates(iter); | 243 observer.setPositionIgnoringNestedIsolates(iter); |
| 244 observer.setStatus(BidiStatus(root->style()->direction(), isOverride(root->s
tyle()->unicodeBidi()))); | 244 observer.setStatus(BidiStatus(root->style()->direction(), isOverride(root->s
tyle()->unicodeBidi()))); |
| 245 while (!iter.atEnd()) { | 245 while (!iter.atEnd()) { |
| 246 if (observer.inIsolate()) { | 246 if (observer.inIsolate()) { |
| 247 iter.increment(&observer, InlineIterator::FastIncrementInlineRendere
r); | 247 iter.increment(&observer, InlineIterator::FastIncrementInIsolatedRen
derer); |
| 248 continue; | 248 continue; |
| 249 } | 249 } |
| 250 if (iter.atParagraphSeparator()) | 250 if (iter.atParagraphSeparator()) |
| 251 break; | 251 break; |
| 252 if (UChar current = iter.current()) { | 252 if (UChar current = iter.current()) { |
| 253 Direction charDirection = direction(current); | 253 Direction charDirection = direction(current); |
| 254 if (charDirection == LeftToRight) | 254 if (charDirection == LeftToRight) |
| 255 return LTR; | 255 return LTR; |
| 256 if (charDirection == RightToLeft || charDirection == RightToLeftArab
ic) | 256 if (charDirection == RightToLeft || charDirection == RightToLeftArab
ic) |
| 257 return RTL; | 257 return RTL; |
| (...skipping 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2404 LayoutUnit marginOffset = (!object->previousSibling() && m_block->is
SelfCollapsingBlock() && m_block->style()->clear() && m_block->getClearDelta(m_b
lock, LayoutUnit())) ? m_block->collapsedMarginBeforeForChild(m_block) : LayoutU
nit(); | 2404 LayoutUnit marginOffset = (!object->previousSibling() && m_block->is
SelfCollapsingBlock() && m_block->style()->clear() && m_block->getClearDelta(m_b
lock, LayoutUnit())) ? m_block->collapsedMarginBeforeForChild(m_block) : LayoutU
nit(); |
| 2405 LayoutUnit oldLogicalHeight = m_block->logicalHeight(); | 2405 LayoutUnit oldLogicalHeight = m_block->logicalHeight(); |
| 2406 m_block->setLogicalHeight(oldLogicalHeight + marginOffset); | 2406 m_block->setLogicalHeight(oldLogicalHeight + marginOffset); |
| 2407 m_block->positionNewFloatOnLine(m_block->insertFloatingObject(toRend
erBox(object)), lastFloatFromPreviousLine, lineInfo, width); | 2407 m_block->positionNewFloatOnLine(m_block->insertFloatingObject(toRend
erBox(object)), lastFloatFromPreviousLine, lineInfo, width); |
| 2408 m_block->setLogicalHeight(oldLogicalHeight); | 2408 m_block->setLogicalHeight(oldLogicalHeight); |
| 2409 } else if (object->isText() && object->style()->hasTextCombine() && obje
ct->isCombineText() && !toRenderCombineText(object)->isCombined()) { | 2409 } else if (object->isText() && object->style()->hasTextCombine() && obje
ct->isCombineText() && !toRenderCombineText(object)->isCombined()) { |
| 2410 toRenderCombineText(object)->combineText(); | 2410 toRenderCombineText(object)->combineText(); |
| 2411 if (toRenderCombineText(object)->isCombined()) | 2411 if (toRenderCombineText(object)->isCombined()) |
| 2412 continue; | 2412 continue; |
| 2413 } | 2413 } |
| 2414 resolver.increment(); | 2414 resolver.position().increment(&resolver); |
| 2415 } | 2415 } |
| 2416 resolver.commitExplicitEmbedding(); | 2416 resolver.commitExplicitEmbedding(); |
| 2417 } | 2417 } |
| 2418 | 2418 |
| 2419 // This is currently just used for list markers and inline flows that have line
boxes. Neither should | 2419 // This is currently just used for list markers and inline flows that have line
boxes. Neither should |
| 2420 // have an effect on whitespace at the start of the line. | 2420 // have an effect on whitespace at the start of the line. |
| 2421 static bool shouldSkipWhitespaceAfterStartObject(RenderBlock* block, RenderObjec
t* o, LineMidpointState& lineMidpointState) | 2421 static bool shouldSkipWhitespaceAfterStartObject(RenderBlock* block, RenderObjec
t* o, LineMidpointState& lineMidpointState) |
| 2422 { | 2422 { |
| 2423 RenderObject* next = bidiNextSkippingEmptyInlines(block, o); | 2423 RenderObject* next = bidiNextSkippingEmptyInlines(block, o); |
| 2424 while (next && next->isFloatingOrOutOfFlowPositioned()) | 2424 while (next && next->isFloatingOrOutOfFlowPositioned()) |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2559 if (!shapeInsideInfo->hasSegments()) { | 2559 if (!shapeInsideInfo->hasSegments()) { |
| 2560 end = nextSegmentBreak(resolver, lineInfo, renderTextInfo, lastFloatFrom
PreviousLine, consecutiveHyphenatedLines, wordMeasurements); | 2560 end = nextSegmentBreak(resolver, lineInfo, renderTextInfo, lastFloatFrom
PreviousLine, consecutiveHyphenatedLines, wordMeasurements); |
| 2561 resolver.setPositionIgnoringNestedIsolates(oldEnd); | 2561 resolver.setPositionIgnoringNestedIsolates(oldEnd); |
| 2562 return oldEnd; | 2562 return oldEnd; |
| 2563 } | 2563 } |
| 2564 | 2564 |
| 2565 const SegmentList& segments = shapeInsideInfo->segments(); | 2565 const SegmentList& segments = shapeInsideInfo->segments(); |
| 2566 SegmentRangeList& segmentRanges = shapeInsideInfo->segmentRanges(); | 2566 SegmentRangeList& segmentRanges = shapeInsideInfo->segmentRanges(); |
| 2567 | 2567 |
| 2568 for (unsigned i = 0; i < segments.size() && !end.atEnd(); i++) { | 2568 for (unsigned i = 0; i < segments.size() && !end.atEnd(); i++) { |
| 2569 InlineIterator segmentStart = resolver.position(); | 2569 const InlineIterator segmentStart = resolver.position(); |
| 2570 end = nextSegmentBreak(resolver, lineInfo, renderTextInfo, lastFloatFrom
PreviousLine, consecutiveHyphenatedLines, wordMeasurements); | 2570 end = nextSegmentBreak(resolver, lineInfo, renderTextInfo, lastFloatFrom
PreviousLine, consecutiveHyphenatedLines, wordMeasurements); |
| 2571 | 2571 |
| 2572 ASSERT(segmentRanges.size() == i); | 2572 ASSERT(segmentRanges.size() == i); |
| 2573 if (resolver.position().atEnd()) { | 2573 if (resolver.position().atEnd()) { |
| 2574 segmentRanges.append(LineSegmentRange(segmentStart, end)); | 2574 segmentRanges.append(LineSegmentRange(segmentStart, end)); |
| 2575 break; | 2575 break; |
| 2576 } | 2576 } |
| 2577 if (resolver.position() == end) { | 2577 if (resolver.position() == end) { |
| 2578 // Nothing fit this segment | 2578 // Nothing fit this segment |
| 2579 end = segmentStart; | 2579 end = segmentStart; |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2811 | 2811 |
| 2812 bool isSVGText = t->isSVGInlineText(); | 2812 bool isSVGText = t->isSVGInlineText(); |
| 2813 | 2813 |
| 2814 if (t->style()->hasTextCombine() && current.m_obj->isCombineText() &
& !toRenderCombineText(current.m_obj)->isCombined()) { | 2814 if (t->style()->hasTextCombine() && current.m_obj->isCombineText() &
& !toRenderCombineText(current.m_obj)->isCombined()) { |
| 2815 RenderCombineText* combineRenderer = toRenderCombineText(current
.m_obj); | 2815 RenderCombineText* combineRenderer = toRenderCombineText(current
.m_obj); |
| 2816 combineRenderer->combineText(); | 2816 combineRenderer->combineText(); |
| 2817 // The length of the renderer's text may have changed. Increment
stale iterator positions | 2817 // The length of the renderer's text may have changed. Increment
stale iterator positions |
| 2818 if (iteratorIsBeyondEndOfRenderCombineText(lBreak, combineRender
er)) { | 2818 if (iteratorIsBeyondEndOfRenderCombineText(lBreak, combineRender
er)) { |
| 2819 ASSERT(iteratorIsBeyondEndOfRenderCombineText(resolver.posit
ion(), combineRenderer)); | 2819 ASSERT(iteratorIsBeyondEndOfRenderCombineText(resolver.posit
ion(), combineRenderer)); |
| 2820 lBreak.increment(); | 2820 lBreak.increment(); |
| 2821 resolver.increment(); | 2821 resolver.position().increment(&resolver); |
| 2822 } | 2822 } |
| 2823 } | 2823 } |
| 2824 | 2824 |
| 2825 RenderStyle* style = t->style(lineInfo.isFirstLine()); | 2825 RenderStyle* style = t->style(lineInfo.isFirstLine()); |
| 2826 const Font& f = style->font(); | 2826 const Font& f = style->font(); |
| 2827 bool isFixedPitch = f.isFixedPitch(); | 2827 bool isFixedPitch = f.isFixedPitch(); |
| 2828 | 2828 |
| 2829 unsigned lastSpace = current.m_pos; | 2829 unsigned lastSpace = current.m_pos; |
| 2830 float wordSpacing = currentStyle->wordSpacing(); | 2830 float wordSpacing = currentStyle->wordSpacing(); |
| 2831 float lastSpaceWordSpacing = 0; | 2831 float lastSpaceWordSpacing = 0; |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3373 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver
ticalPositionCache); | 3373 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver
ticalPositionCache); |
| 3374 | 3374 |
| 3375 setLineGridBox(lineGridBox); | 3375 setLineGridBox(lineGridBox); |
| 3376 | 3376 |
| 3377 // FIXME: If any of the characteristics of the box change compared to the ol
d one, then we need to do a deep dirtying | 3377 // FIXME: If any of the characteristics of the box change compared to the ol
d one, then we need to do a deep dirtying |
| 3378 // (similar to what happens when the page height changes). Ideally, though,
we only do this if someone is actually snapping | 3378 // (similar to what happens when the page height changes). Ideally, though,
we only do this if someone is actually snapping |
| 3379 // to this grid. | 3379 // to this grid. |
| 3380 } | 3380 } |
| 3381 | 3381 |
| 3382 } | 3382 } |
| OLD | NEW |