| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 Color c = renderer().selectionBackgroundColor(); | 126 Color c = renderer().selectionBackgroundColor(); |
| 127 if (!c.alpha()) | 127 if (!c.alpha()) |
| 128 return; | 128 return; |
| 129 | 129 |
| 130 // If the text color ends up being the same as the selection background, inv
ert the selection | 130 // If the text color ends up being the same as the selection background, inv
ert the selection |
| 131 // background. | 131 // background. |
| 132 if (textColor == c) | 132 if (textColor == c) |
| 133 c = Color(0xff - c.red(), 0xff - c.green(), 0xff - c.blue()); | 133 c = Color(0xff - c.red(), 0xff - c.green(), 0xff - c.blue()); |
| 134 | 134 |
| 135 GraphicsContextStateSaver stateSaver(*context); | 135 GraphicsContextStateSaver stateSaver(*context); |
| 136 LayoutUnit selectionBottom = root().selectionBottom(); | |
| 137 LayoutUnit top = root().selectionTop(); | 136 LayoutUnit top = root().selectionTop(); |
| 138 LayoutUnit h = root().selectionHeight(); | 137 LayoutUnit h = root().selectionHeight(); |
| 139 const int deltaY = roundToInt(renderer().style()->isFlippedLinesWritingMode(
) ? selectionBottom - logicalBottom() : logicalTop() - top); | 138 const int deltaY = roundToInt(logicalTop() - top); |
| 140 const FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY); | 139 const FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY); |
| 141 FloatRect clipRect(localOrigin, FloatSize(m_logicalWidth, h.toFloat())); | 140 FloatRect clipRect(localOrigin, FloatSize(m_logicalWidth, h.toFloat())); |
| 142 context->clip(clipRect); | 141 context->clip(clipRect); |
| 143 context->drawHighlightForText(font, constructTextRun(&renderer(), font, m_st
r, style, TextRun::AllowTrailingExpansion), localOrigin, h, c); | 142 context->drawHighlightForText(font, constructTextRun(&renderer(), font, m_st
r, style, TextRun::AllowTrailingExpansion), localOrigin, h, c); |
| 144 } | 143 } |
| 145 | 144 |
| 146 bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
lt, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOf
fset, LayoutUnit lineTop, LayoutUnit lineBottom) | 145 bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
lt, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOf
fset, LayoutUnit lineTop, LayoutUnit lineBottom) |
| 147 { | 146 { |
| 148 LayoutPoint adjustedLocation = accumulatedOffset + roundedLayoutPoint(topLef
t()); | 147 LayoutPoint adjustedLocation = accumulatedOffset + roundedLayoutPoint(topLef
t()); |
| 149 | 148 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 164 if (visibleToHitTestRequest(request) && boundsRect.intersects(HitTestLocatio
n::rectForPoint(locationInContainer.point(), 0, 0, 0, 0))) { | 163 if (visibleToHitTestRequest(request) && boundsRect.intersects(HitTestLocatio
n::rectForPoint(locationInContainer.point(), 0, 0, 0, 0))) { |
| 165 renderer().updateHitTestResult(result, locationInContainer.point() - toL
ayoutSize(adjustedLocation)); | 164 renderer().updateHitTestResult(result, locationInContainer.point() - toL
ayoutSize(adjustedLocation)); |
| 166 if (!result.addNodeToRectBasedTestResult(renderer().node(), request, loc
ationInContainer, boundsRect)) | 165 if (!result.addNodeToRectBasedTestResult(renderer().node(), request, loc
ationInContainer, boundsRect)) |
| 167 return true; | 166 return true; |
| 168 } | 167 } |
| 169 | 168 |
| 170 return false; | 169 return false; |
| 171 } | 170 } |
| 172 | 171 |
| 173 } // namespace blink | 172 } // namespace blink |
| OLD | NEW |