Changeset 139135 in webkit
- Timestamp:
- Jan 8, 2013 4:59:43 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r139132 r139135 1 2013-01-08 Elliott Sprehn <esprehn@chromium.org> 2 3 Merge getLineAtIndex into RenderBlock::lineAtIndex 4 https://bugs.webkit.org/show_bug.cgi?id=106379 5 6 Reviewed by Eric Seidel. 7 8 getLineAtIndex can be merged into lineAtIndex, which was it's only caller. 9 10 No new tests, just refactoring. 11 12 * rendering/RenderBlock.cpp: 13 (WebCore::RenderBlock::lineAtIndex): 14 (WebCore::RenderBlock::lineCount): 15 * rendering/RenderBlock.h: 16 (RenderBlock): 17 1 18 2013-01-08 Rafael Weinstein <rafaelw@chromium.org> 2 19 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r139040 r139135 6559 6559 } 6560 6560 6561 static RootInlineBox* getLineAtIndex(RenderBlock* block, int i, int& count)6562 {6563 if (block->style()->visibility() == VISIBLE) {6564 if (block->childrenInline()) {6565 for (RootInlineBox* box = block->firstRootBox(); box; box = box->nextRootBox()) {6566 if (count++ == i)6567 return box;6568 }6569 }6570 else {6571 for (RenderObject* obj = block->firstChild(); obj; obj = obj->nextSibling()) {6572 if (shouldCheckLines(obj)) {6573 RootInlineBox *box = getLineAtIndex(toRenderBlock(obj), i, count);6574 if (box)6575 return box;6576 }6577 }6578 }6579 }6580 return 0;6581 }6582 6583 6561 static int getHeightForLineCount(RenderBlock* block, int l, bool includeBottom, int& count) 6584 6562 { … … 6608 6586 } 6609 6587 6610 RootInlineBox* RenderBlock::lineAtIndex(int i) 6611 { 6612 int count = 0; 6613 return getLineAtIndex(this, i, count); 6614 } 6615 6616 int RenderBlock::lineCount() 6588 RootInlineBox* RenderBlock::lineAtIndex(int i) const 6589 { 6590 ASSERT(i >= 0); 6591 6592 if (style()->visibility() != VISIBLE) 6593 return 0; 6594 6595 if (childrenInline()) { 6596 for (RootInlineBox* box = firstRootBox(); box; box = box->nextRootBox()) 6597 if (!i--) 6598 return box; 6599 } else { 6600 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 6601 if (!shouldCheckLines(child)) 6602 continue; 6603 if (RootInlineBox* box = toRenderBlock(child)->lineAtIndex(i)) 6604 return box; 6605 } 6606 } 6607 6608 return 0; 6609 } 6610 6611 int RenderBlock::lineCount() const 6617 6612 { 6618 6613 int count = 0; -
trunk/Source/WebCore/rendering/RenderBlock.h
r138196 r139135 239 239 240 240 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, const LayoutRect& logicalRect); 241 241 242 242 // Helper methods for computing line counts and heights for line counts. 243 RootInlineBox* lineAtIndex(int) ;244 int lineCount() ;243 RootInlineBox* lineAtIndex(int) const; 244 int lineCount() const; 245 245 int heightForLineCount(int); 246 246 void clearTruncation();
Note: See TracChangeset
for help on using the changeset viewer.