Changeset 83813 in webkit
- Timestamp:
- Apr 13, 2011 10:35:54 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83808 r83813 1 2011-04-13 Yael Aharon <yael.aharon@nokia.com> 2 3 Reviewed by Eric Seidel. 4 5 constructLine should take bidiRuns as a parameter 6 https://bugs.webkit.org/show_bug.cgi?id=58458 7 8 Pass bidiRuns to constructLine and move reachedEndOfTextRenderer so that it is 9 declared before constructLine. 10 11 No new tests as this is refactoring only. 12 13 * rendering/RenderBlock.h: 14 * rendering/RenderBlockLineLayout.cpp: 15 (WebCore::reachedEndOfTextRenderer): 16 (WebCore::RenderBlock::constructLine): 17 (WebCore::RenderBlock::layoutInlineChildren): 18 1 19 2011-04-13 Oliver Hunt <oliver@apple.com> 2 20 -
trunk/Source/WebCore/rendering/RenderBlock.h
r83794 r83813 501 501 InlineIterator findNextLineBreak(InlineBidiResolver&, bool firstLine, bool& isLineEmpty, LineBreakIteratorInfo&, bool& previousLineBrokeCleanly, bool& hyphenated, 502 502 EClear*, FloatingObject* lastFloatFromPreviousLine, Vector<RenderBox*>& positionedObjects); 503 RootInlineBox* constructLine( unsigned runCount, BidiRun* firstRun, BidiRun* lastRun, bool firstLine, bool lastLine, bool isLogicallyLastRunWrapped, RenderObject* logicallyLastRunRenderer);503 RootInlineBox* constructLine(BidiRunList<BidiRun>&, bool firstLine, bool lastLine); 504 504 InlineFlowBox* createLineBoxes(RenderObject*, bool firstLine, InlineBox* childBox); 505 505 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r83794 r83813 267 267 } 268 268 269 RootInlineBox* RenderBlock::constructLine(unsigned runCount, BidiRun* firstRun, BidiRun* lastRun, bool firstLine, bool lastLine, bool isLogicallyLastRunWrapped, RenderObject* logicallyLastRunRenderer) 270 { 271 ASSERT(firstRun); 269 static bool reachedEndOfTextRenderer(const BidiRunList<BidiRun>& bidiRuns) 270 { 271 BidiRun* run = bidiRuns.logicallyLastRun(); 272 if (!run) 273 return true; 274 unsigned int pos = run->stop(); 275 RenderObject* r = run->m_object; 276 if (!r->isText() || r->isBR()) 277 return false; 278 RenderText* renderText = toRenderText(r); 279 if (pos >= renderText->textLength()) 280 return true; 281 282 while (isASCIISpace(renderText->characters()[pos])) { 283 pos++; 284 if (pos >= renderText->textLength()) 285 return true; 286 } 287 return false; 288 } 289 290 RootInlineBox* RenderBlock::constructLine(BidiRunList<BidiRun>& bidiRuns, bool firstLine, bool lastLine) 291 { 292 ASSERT(bidiRuns.firstRun()); 272 293 273 294 bool rootHasSelectedChildren = false; 274 295 InlineFlowBox* parentBox = 0; 275 for (BidiRun* r = firstRun; r; r = r->next()) {296 for (BidiRun* r = bidiRuns.firstRun(); r; r = r->next()) { 276 297 // Create a box for our object. 277 bool isOnlyRun = ( runCount== 1);278 if ( runCount== 2 && !r->m_object->isListMarker())279 isOnlyRun = (!style()->isLeftToRightDirection() ? lastRun : firstRun)->m_object->isListMarker();298 bool isOnlyRun = (bidiRuns.runCount() == 1); 299 if (bidiRuns.runCount() == 2 && !r->m_object->isListMarker()) 300 isOnlyRun = (!style()->isLeftToRightDirection() ? bidiRuns.lastRun() : bidiRuns.firstRun())->m_object->isListMarker(); 280 301 281 302 InlineBox* box = createInlineBoxForRenderer(r->m_object, false, isOnlyRun); … … 326 347 // we determine the horizontal positions and widths of all the inline boxes on 327 348 // the line. 328 lastLineBox()->determineSpacingForFlowBoxes(lastLine, isLogicallyLastRunWrapped, logicallyLastRunRenderer); 349 bool isLogicallyLastRunWrapped = bidiRuns.logicallyLastRun()->m_object && bidiRuns.logicallyLastRun()->m_object->isText() ? !reachedEndOfTextRenderer(bidiRuns) : true; 350 lastLineBox()->determineSpacingForFlowBoxes(lastLine, isLogicallyLastRunWrapped, bidiRuns.logicallyLastRun()->m_object); 329 351 330 352 // Now mark the line boxes as being constructed. … … 640 662 } 641 663 642 static bool reachedEndOfTextRenderer(const BidiRunList<BidiRun>& bidiRuns)643 {644 BidiRun* run = bidiRuns.logicallyLastRun();645 if (!run)646 return true;647 unsigned int pos = run->stop();648 RenderObject* r = run->m_object;649 if (!r->isText() || r->isBR())650 return false;651 RenderText* renderText = toRenderText(r);652 if (pos >= renderText->textLength())653 return true;654 655 while (isASCIISpace(renderText->characters()[pos])) {656 pos++;657 if (pos >= renderText->textLength())658 return true;659 }660 return false;661 }662 663 664 inline BidiRun* RenderBlock::handleTrailingSpaces(BidiRunList<BidiRun>& bidiRuns, BidiContext* currentContext) 664 665 { … … 903 904 if (hyphenated) 904 905 bidiRuns.logicallyLastRun()->m_hasHyphen = true; 905 bool isLogicallyLastRunWrapped = bidiRuns.logicallyLastRun()->m_object && bidiRuns.logicallyLastRun()->m_object->isText() ? !reachedEndOfTextRenderer(bidiRuns) : true; 906 // FIXME: Clearly constructLine should just take a bidiRuns object. 907 lineBox = constructLine(bidiRuns.runCount(), bidiRuns.firstRun(), bidiRuns.lastRun(), firstLine, !end.m_obj, isLogicallyLastRunWrapped, bidiRuns.logicallyLastRun()->m_object); 906 lineBox = constructLine(bidiRuns, firstLine, !end.m_obj); 908 907 if (lineBox) { 909 908 lineBox->setEndsWithBreak(previousLineBrokeCleanly);
Note: See TracChangeset
for help on using the changeset viewer.