| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. | 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 namespace blink { | 31 namespace blink { |
| 32 | 32 |
| 33 void EllipsisBox::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffs
et, LayoutUnit lineTop, LayoutUnit lineBottom) const | 33 void EllipsisBox::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffs
et, LayoutUnit lineTop, LayoutUnit lineBottom) const |
| 34 { | 34 { |
| 35 EllipsisBoxPainter(*this).paint(paintInfo, paintOffset, lineTop, lineBottom)
; | 35 EllipsisBoxPainter(*this).paint(paintInfo, paintOffset, lineTop, lineBottom)
; |
| 36 } | 36 } |
| 37 | 37 |
| 38 IntRect EllipsisBox::selectionRect() const | 38 IntRect EllipsisBox::selectionRect() const |
| 39 { | 39 { |
| 40 const ComputedStyle& style = lineLayoutItem().styleRef(isFirstLineStyle()); | 40 const ComputedStyle& style = getLineLayoutItem().styleRef(isFirstLineStyle()
); |
| 41 const Font& font = style.font(); | 41 const Font& font = style.font(); |
| 42 return enclosingIntRect(font.selectionRectForText(constructTextRun(font, m_s
tr, style, TextRun::AllowTrailingExpansion), IntPoint(logicalLeft(), logicalTop(
) + root().selectionTop()), root().selectionHeight())); | 42 return enclosingIntRect(font.selectionRectForText(constructTextRun(font, m_s
tr, style, TextRun::AllowTrailingExpansion), IntPoint(logicalLeft(), logicalTop(
) + root().selectionTop()), root().selectionHeight())); |
| 43 } | 43 } |
| 44 | 44 |
| 45 bool EllipsisBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& loca
tionInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, Layou
tUnit lineBottom) | 45 bool EllipsisBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& loca
tionInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, Layou
tUnit lineBottom) |
| 46 { | 46 { |
| 47 // FIXME: the call to roundedLayoutPoint() below is temporary and should be
removed once | 47 // FIXME: the call to roundedLayoutPoint() below is temporary and should be
removed once |
| 48 // the transition to LayoutUnit-based types is complete (crbug.com/321237) | 48 // the transition to LayoutUnit-based types is complete (crbug.com/321237) |
| 49 LayoutPoint adjustedLocation = accumulatedOffset + topLeft(); | 49 LayoutPoint adjustedLocation = accumulatedOffset + topLeft(); |
| 50 | 50 |
| 51 LayoutPoint boxOrigin = locationIncludingFlipping(); | 51 LayoutPoint boxOrigin = locationIncludingFlipping(); |
| 52 boxOrigin.moveBy(accumulatedOffset); | 52 boxOrigin.moveBy(accumulatedOffset); |
| 53 LayoutRect boundsRect(boxOrigin, size()); | 53 LayoutRect boundsRect(boxOrigin, size()); |
| 54 if (visibleToHitTestRequest(result.hitTestRequest()) && boundsRect.intersect
s(LayoutRect(HitTestLocation::rectForPoint(locationInContainer.point(), 0, 0, 0,
0)))) { | 54 if (visibleToHitTestRequest(result.hitTestRequest()) && boundsRect.intersect
s(LayoutRect(HitTestLocation::rectForPoint(locationInContainer.point(), 0, 0, 0,
0)))) { |
| 55 lineLayoutItem().updateHitTestResult(result, locationInContainer.point()
- toLayoutSize(adjustedLocation)); | 55 getLineLayoutItem().updateHitTestResult(result, locationInContainer.poin
t() - toLayoutSize(adjustedLocation)); |
| 56 if (result.addNodeToListBasedTestResult(lineLayoutItem().node(), locatio
nInContainer, boundsRect) == StopHitTesting) | 56 if (result.addNodeToListBasedTestResult(getLineLayoutItem().node(), loca
tionInContainer, boundsRect) == StopHitTesting) |
| 57 return true; | 57 return true; |
| 58 } | 58 } |
| 59 | 59 |
| 60 return false; | 60 return false; |
| 61 } | 61 } |
| 62 | 62 |
| 63 const char* EllipsisBox::boxName() const | 63 const char* EllipsisBox::boxName() const |
| 64 { | 64 { |
| 65 return "EllipsisBox"; | 65 return "EllipsisBox"; |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace blink | 68 } // namespace blink |
| OLD | NEW |