Changeset 96546 in webkit
- Timestamp:
- Oct 3, 2011 3:00:25 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96545 r96546 1 2011-09-27 Ojan Vafai <ojan@chromium.org> 2 3 remove dead code in flipForWritingMode 4 https://bugs.webkit.org/show_bug.cgi?id=68948 5 6 Reviewed by Hajime Morita. 7 8 ChildToParentFlippingAdjustment is never used, so the third argument 9 to flipForWritingMode always has the same value. 10 11 In addition, renamed to flipForWritingModeForChild to be more clear 12 that it's operating on the child and renamed flipFloatForWritingMode to match. 13 14 No new tests. This is just a code cleanup. No functional changes. 15 16 * rendering/InlineBox.cpp: 17 (WebCore::InlineBox::paint): 18 * rendering/RenderBlock.cpp: 19 (WebCore::RenderBlock::paintChildren): 20 (WebCore::RenderBlock::flipFloatForWritingModeForChild): 21 (WebCore::RenderBlock::paintFloats): 22 (WebCore::RenderBlock::hitTestFloats): 23 (WebCore::RenderBlock::hitTestContents): 24 * rendering/RenderBlock.h: 25 * rendering/RenderBox.cpp: 26 (WebCore::RenderBox::flipForWritingModeForChild): 27 (WebCore::RenderBox::topLeftLocation): 28 * rendering/RenderBox.h: 29 * rendering/RenderTable.cpp: 30 (WebCore::RenderTable::paintObject): 31 (WebCore::RenderTable::nodeAtPoint): 32 * rendering/RenderTableRow.cpp: 33 (WebCore::RenderTableRow::nodeAtPoint): 34 * rendering/RenderTableSection.cpp: 35 (WebCore::RenderTableSection::paintCell): 36 (WebCore::RenderTableSection::nodeAtPoint): 37 1 38 2011-10-03 Jer Noble <jer.noble@apple.com> 2 39 -
trunk/Source/WebCore/rendering/InlineBox.cpp
r96425 r96546 199 199 LayoutPoint childPoint = paintOffset; 200 200 if (parent()->renderer()->style()->isFlippedBlocksWritingMode()) // Faster than calling containingBlock(). 201 childPoint = renderer()->containingBlock()->flipForWritingMode (toRenderBox(renderer()), childPoint, RenderBox::ParentToChildFlippingAdjustment);201 childPoint = renderer()->containingBlock()->flipForWritingModeForChild(toRenderBox(renderer()), childPoint); 202 202 203 203 // Paint all phases of replaced elements atomically, as though the replaced element established its -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r96452 r96546 2458 2458 } 2459 2459 2460 LayoutPoint childPoint = flipForWritingMode (child, paintOffset, ParentToChildFlippingAdjustment);2460 LayoutPoint childPoint = flipForWritingModeForChild(child, paintOffset); 2461 2461 if (!child->hasSelfPaintingLayer() && !child->isFloating()) 2462 2462 child->paint(info, childPoint); … … 2584 2584 } 2585 2585 2586 LayoutPoint RenderBlock::flipFloatForWritingMode (const FloatingObject* child, const LayoutPoint& point) const2586 LayoutPoint RenderBlock::flipFloatForWritingModeForChild(const FloatingObject* child, const LayoutPoint& point) const 2587 2587 { 2588 2588 if (!style()->isFlippedBlocksWritingMode()) 2589 2589 return point; 2590 2590 2591 // This is similar to the ParentToChildFlippingAdjustment in RenderBox::flipForWritingMode.We have to subtract out our left/top offsets twice, since2592 // it's going to get added back in. 2591 // This is similar to RenderBox::flipForWritingModeForChild. We have to subtract out our left/top offsets twice, since 2592 // it's going to get added back in. We hide this complication here so that the calling code looks normal for the unflipped 2593 2593 // case. 2594 2594 if (isHorizontalWritingMode()) … … 2610 2610 PaintInfo currentPaintInfo(paintInfo); 2611 2611 currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground; 2612 LayoutPoint childPoint = flipFloatForWritingMode (r, LayoutPoint(paintOffset.x() + xPositionForFloatIncludingMargin(r) - r->m_renderer->x(), paintOffset.y() + yPositionForFloatIncludingMargin(r) - r->m_renderer->y()));2612 LayoutPoint childPoint = flipFloatForWritingModeForChild(r, LayoutPoint(paintOffset.x() + xPositionForFloatIncludingMargin(r) - r->m_renderer->x(), paintOffset.y() + yPositionForFloatIncludingMargin(r) - r->m_renderer->y())); 2613 2613 r->m_renderer->paint(currentPaintInfo, childPoint); 2614 2614 if (!preservePhase) { … … 4138 4138 LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject) - floatingObject->m_renderer->x(); 4139 4139 LayoutUnit yOffset = yPositionForFloatIncludingMargin(floatingObject) - floatingObject->m_renderer->y(); 4140 LayoutPoint childPoint = flipFloatForWritingMode (floatingObject, adjustedLocation + LayoutSize(xOffset, yOffset));4140 LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject, adjustedLocation + LayoutSize(xOffset, yOffset)); 4141 4141 if (floatingObject->m_renderer->hitTest(request, result, pointInContainer, childPoint)) { 4142 4142 updateHitTestResult(result, pointInContainer - toLayoutSize(childPoint)); … … 4207 4207 childHitTest = HitTestChildBlockBackground; 4208 4208 for (RenderBox* child = lastChildBox(); child; child = child->previousSiblingBox()) { 4209 LayoutPoint childPoint = flipForWritingMode (child, accumulatedOffset, ParentToChildFlippingAdjustment);4209 LayoutPoint childPoint = flipForWritingModeForChild(child, accumulatedOffset); 4210 4210 if (!child->hasSelfPaintingLayer() && !child->isFloating() && child->nodeAtPoint(request, result, pointInContainer, childPoint, childHitTest)) 4211 4211 return true; -
trunk/Source/WebCore/rendering/RenderBlock.h
r96452 r96546 508 508 }; 509 509 510 LayoutPoint flipFloatForWritingMode (const FloatingObject*, const LayoutPoint&) const;510 LayoutPoint flipFloatForWritingModeForChild(const FloatingObject*, const LayoutPoint&) const; 511 511 512 512 LayoutUnit logicalTopForFloat(const FloatingObject* child) const { return isHorizontalWritingMode() ? child->y() : child->x(); } -
trunk/Source/WebCore/rendering/RenderBox.cpp
r96452 r96546 3694 3694 } 3695 3695 3696 LayoutPoint RenderBox::flipForWritingMode (const RenderBox* child, const LayoutPoint& point, FlippingAdjustment adjustment) const3696 LayoutPoint RenderBox::flipForWritingModeForChild(const RenderBox* child, const LayoutPoint& point) const 3697 3697 { 3698 3698 if (!style()->isFlippedBlocksWritingMode()) … … 3702 3702 // the right place. 3703 3703 if (isHorizontalWritingMode()) 3704 return LayoutPoint(point.x(), point.y() + height() - child->height() - child->y() - (adjustment == ParentToChildFlippingAdjustment ? child->y() : 0));3705 return LayoutPoint(point.x() + width() - child->width() - child->x() - (adjustment == ParentToChildFlippingAdjustment ? child->x() : 0), point.y());3704 return LayoutPoint(point.x(), point.y() + height() - child->height() - (2 * child->y())); 3705 return LayoutPoint(point.x() + width() - child->width() - (2 * child->x()), point.y()); 3706 3706 } 3707 3707 … … 3768 3768 if (!containerBlock || containerBlock == this) 3769 3769 return location(); 3770 return containerBlock->flipForWritingMode (this, location(), RenderBox::ParentToChildFlippingAdjustment);3770 return containerBlock->flipForWritingModeForChild(this, location()); 3771 3771 } 3772 3772 -
trunk/Source/WebCore/rendering/RenderBox.h
r96408 r96546 406 406 virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; 407 407 408 enum FlippingAdjustment { ChildToParentFlippingAdjustment, ParentToChildFlippingAdjustment }; 409 LayoutPoint flipForWritingMode(const RenderBox* child, const LayoutPoint&, FlippingAdjustment) const; 408 LayoutPoint flipForWritingModeForChild(const RenderBox* child, const LayoutPoint&) const; 410 409 int flipForWritingMode(int position) const; // The offset is in the block direction (y for horizontal writing modes, x for vertical writing modes). 411 410 IntPoint flipForWritingMode(const IntPoint&) const; -
trunk/Source/WebCore/rendering/RenderTable.cpp
r96509 r96546 523 523 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 524 524 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child == m_caption)) { 525 LayoutPoint childPoint = flipForWritingMode (toRenderBox(child), paintOffset, ParentToChildFlippingAdjustment);525 LayoutPoint childPoint = flipForWritingModeForChild(toRenderBox(child), paintOffset); 526 526 child->paint(info, childPoint); 527 527 } … … 538 538 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) 539 539 if (child->isTableSection()) { 540 LayoutPoint childPoint = flipForWritingMode (toRenderTableSection(child), paintOffset, ParentToChildFlippingAdjustment);540 LayoutPoint childPoint = flipForWritingModeForChild(toRenderTableSection(child), paintOffset); 541 541 child->paint(info, childPoint); 542 542 } … … 1199 1199 for (RenderObject* child = lastChild(); child; child = child->previousSibling()) { 1200 1200 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child == m_caption)) { 1201 LayoutPoint childPoint = flipForWritingMode (toRenderBox(child), adjustedLocation, ParentToChildFlippingAdjustment);1201 LayoutPoint childPoint = flipForWritingModeForChild(toRenderBox(child), adjustedLocation); 1202 1202 if (child->nodeAtPoint(request, result, pointInContainer, childPoint, action)) { 1203 1203 updateHitTestResult(result, toLayoutPoint(pointInContainer - childPoint)); -
trunk/Source/WebCore/rendering/RenderTableRow.cpp
r95852 r96546 205 205 // then we can remove this check. 206 206 if (child->isTableCell() && !toRenderBox(child)->hasSelfPaintingLayer()) { 207 LayoutPoint cellPoint = flipForWritingMode (toRenderTableCell(child), accumulatedOffset, ParentToChildFlippingAdjustment);207 LayoutPoint cellPoint = flipForWritingModeForChild(toRenderTableCell(child), accumulatedOffset); 208 208 if (child->nodeAtPoint(request, result, pointInContainer, cellPoint, action)) { 209 209 updateHitTestResult(result, pointInContainer - toLayoutSize(cellPoint)); -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r95852 r96546 961 961 void RenderTableSection::paintCell(RenderTableCell* cell, PaintInfo& paintInfo, const LayoutPoint& paintOffset) 962 962 { 963 LayoutPoint cellPoint = flipForWritingMode (cell, paintOffset, ParentToChildFlippingAdjustment);963 LayoutPoint cellPoint = flipForWritingModeForChild(cell, paintOffset); 964 964 PaintPhase paintPhase = paintInfo.phase; 965 965 RenderTableRow* row = toRenderTableRow(cell->parent()); … … 1220 1220 // then we can remove this check. 1221 1221 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer()) { 1222 LayoutPoint childPoint = flipForWritingMode (toRenderBox(child), adjustedLocation, ParentToChildFlippingAdjustment);1222 LayoutPoint childPoint = flipForWritingModeForChild(toRenderBox(child), adjustedLocation); 1223 1223 if (child->nodeAtPoint(request, result, pointInContainer, childPoint, action)) { 1224 1224 updateHitTestResult(result, toLayoutPoint(pointInContainer - childPoint)); … … 1264 1264 for (int i = current.cells.size() - 1; i >= 0; --i) { 1265 1265 RenderTableCell* cell = current.cells[i]; 1266 LayoutPoint cellPoint = flipForWritingMode (cell, adjustedLocation, ParentToChildFlippingAdjustment);1266 LayoutPoint cellPoint = flipForWritingModeForChild(cell, adjustedLocation); 1267 1267 if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, pointInContainer, cellPoint, action)) { 1268 1268 updateHitTestResult(result, toLayoutPoint(pointInContainer - cellPoint));
Note: See TracChangeset
for help on using the changeset viewer.