Changeset 142335 in webkit
- Timestamp:
- Feb 8, 2013 5:48:09 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r142332 r142335 1 2013-02-08 Andy Estes <aestes@apple.com> 2 3 Restore pre-r118852 behavior for EllipsisBox::nodeAtPoint() 4 https://bugs.webkit.org/show_bug.cgi?id=109277 5 6 Reviewed by Simon Fraser. 7 8 Remove test added by r118852 and add a test that verifies the original 9 expected behavior. 10 11 * fast/css/text-overflow-ellipsis-hit-test-expected.txt: Removed. 12 * fast/css/text-overflow-ellipsis-hit-test.html: Removed. 13 * fast/flexbox/line-clamp-link-after-ellipsis-expected.txt: Added. 14 * fast/flexbox/line-clamp-link-after-ellipsis.html: Added. 15 1 16 2013-02-08 Stephen Chenney <schenney@chromium.org> 2 17 -
trunk/Source/WebCore/ChangeLog
r142334 r142335 1 2013-02-08 Andy Estes <aestes@apple.com> 2 3 Restore pre-r118852 behavior for EllipsisBox::nodeAtPoint() 4 https://bugs.webkit.org/show_bug.cgi?id=109277 5 6 Reviewed by Simon Fraser. 7 8 Test: fast/flexbox/line-clamp-link-after-ellipsis.html 9 10 Roll out r118852. Enough time has passed that this can't be done 11 mechanically, so transcribe the old method definition to current 12 WebCore interfaces. 13 14 * rendering/EllipsisBox.cpp: 15 (WebCore::EllipsisBox::markupBox): EllipsisBox no longer has 16 m_markupBox, so break the logic for finding the markup box from 17 paintMarkupBox() into its own function. 18 (WebCore::EllipsisBox::paintMarkupBox): Call markupBox(). 19 (WebCore::EllipsisBox::nodeAtPoint): Transcribe the pre-r118852 implementation. 20 * rendering/EllipsisBox.h: 21 (EllipsisBox): Declare markupBox(). 22 1 23 2013-02-08 Eric Carlson <eric.carlson@apple.com> 2 24 -
trunk/Source/WebCore/rendering/EllipsisBox.cpp
r139908 r142335 70 70 } 71 71 72 void EllipsisBox::paintMarkupBox(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom, RenderStyle* style) 72 InlineBox* EllipsisBox::markupBox() const 73 73 { 74 74 if (!m_shouldPaintMarkupBox || !m_renderer->isRenderBlock()) 75 return ;75 return 0; 76 76 77 77 RenderBlock* block = toRenderBlock(m_renderer); 78 78 RootInlineBox* lastLine = block->lineAtIndex(block->lineCount() - 1); 79 79 if (!lastLine) 80 return ;80 return 0; 81 81 82 82 // If the last line-box on the last line of a block is a link, -webkit-line-clamp paints that box after the ellipsis. … … 84 84 InlineBox* anchorBox = lastLine->lastChild(); 85 85 if (!anchorBox || !anchorBox->renderer()->style()->isLink()) 86 return 0; 87 88 return anchorBox; 89 } 90 91 void EllipsisBox::paintMarkupBox(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom, RenderStyle* style) 92 { 93 InlineBox* markupBox = this->markupBox(); 94 if (!markupBox) 86 95 return; 87 96 88 97 LayoutPoint adjustedPaintOffset = paintOffset; 89 adjustedPaintOffset.move(x() + m_logicalWidth - anchorBox->x(),90 y() + style->fontMetrics().ascent() - ( anchorBox->y() + anchorBox->renderer()->style(isFirstLineStyle())->fontMetrics().ascent()));91 anchorBox->paint(paintInfo, adjustedPaintOffset, lineTop, lineBottom);98 adjustedPaintOffset.move(x() + m_logicalWidth - markupBox->x(), 99 y() + style->fontMetrics().ascent() - (markupBox->y() + markupBox->renderer()->style(isFirstLineStyle())->fontMetrics().ascent())); 100 markupBox->paint(paintInfo, adjustedPaintOffset, lineTop, lineBottom); 92 101 } 93 102 … … 122 131 } 123 132 124 bool EllipsisBox::nodeAtPoint(const HitTestRequest& , HitTestResult&, const HitTestLocation&, const LayoutPoint&, LayoutUnit, LayoutUnit)133 bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom) 125 134 { 135 LayoutPoint adjustedLocation = accumulatedOffset + roundedLayoutPoint(topLeft()); 136 137 // Hit test the markup box. 138 if (InlineBox* markupBox = this->markupBox()) { 139 RenderStyle* style = m_renderer->style(isFirstLineStyle()); 140 LayoutUnit mtx = adjustedLocation.x() + m_logicalWidth - markupBox->x(); 141 LayoutUnit mty = adjustedLocation.y() + style->fontMetrics().ascent() - (markupBox->y() + markupBox->renderer()->style(isFirstLineStyle())->fontMetrics().ascent()); 142 if (markupBox->nodeAtPoint(request, result, locationInContainer, LayoutPoint(mtx, mty), lineTop, lineBottom)) { 143 renderer()->updateHitTestResult(result, locationInContainer.point() - LayoutSize(mtx, mty)); 144 return true; 145 } 146 } 147 148 LayoutRect boundsRect(adjustedLocation, LayoutSize(m_logicalWidth, m_height)); 149 if (visibleToHitTesting() && boundsRect.intersects(HitTestLocation::rectForPoint(locationInContainer.point(), 0, 0, 0, 0))) { 150 renderer()->updateHitTestResult(result, locationInContainer.point() - toLayoutSize(adjustedLocation)); 151 if (!result.addNodeToRectBasedTestResult(renderer()->node(), request, locationInContainer, boundsRect)) 152 return true; 153 } 154 126 155 return false; 127 156 } -
trunk/Source/WebCore/rendering/EllipsisBox.h
r126859 r142335 50 50 virtual RenderObject::SelectionState selectionState() { return m_selectionState; } 51 51 void paintSelection(GraphicsContext*, const LayoutPoint&, RenderStyle*, const Font&); 52 InlineBox* markupBox() const; 52 53 53 54 bool m_shouldPaintMarkupBox;
Note: See TracChangeset
for help on using the changeset viewer.