| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/EllipsisBoxPainter.h" | 5 #include "core/paint/EllipsisBoxPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/TextRunConstructor.h" | 7 #include "core/layout/TextRunConstructor.h" |
| 8 #include "core/layout/api/LineLayoutItem.h" | 8 #include "core/layout/api/LineLayoutItem.h" |
| 9 #include "core/layout/api/SelectionState.h" | 9 #include "core/layout/api/SelectionState.h" |
| 10 #include "core/layout/line/EllipsisBox.h" | 10 #include "core/layout/line/EllipsisBox.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 c = Color(0xff - c.red(), 0xff - c.green(), 0xff - c.blue()); | 77 c = Color(0xff - c.red(), 0xff - c.green(), 0xff - c.blue()); |
| 78 | 78 |
| 79 GraphicsContextStateSaver stateSaver(context); | 79 GraphicsContextStateSaver stateSaver(context); |
| 80 LayoutUnit selectionBottom = m_ellipsisBox.root().selectionBottom(); | 80 LayoutUnit selectionBottom = m_ellipsisBox.root().selectionBottom(); |
| 81 LayoutUnit top = m_ellipsisBox.root().selectionTop(); | 81 LayoutUnit top = m_ellipsisBox.root().selectionTop(); |
| 82 LayoutUnit h = m_ellipsisBox.root().selectionHeight(); | 82 LayoutUnit h = m_ellipsisBox.root().selectionHeight(); |
| 83 const int deltaY = roundToInt(m_ellipsisBox.getLineLayoutItem().styleRef().i
sFlippedLinesWritingMode() ? selectionBottom - m_ellipsisBox.logicalBottom() : m
_ellipsisBox.logicalTop() - top); | 83 const int deltaY = roundToInt(m_ellipsisBox.getLineLayoutItem().styleRef().i
sFlippedLinesWritingMode() ? selectionBottom - m_ellipsisBox.logicalBottom() : m
_ellipsisBox.logicalTop() - top); |
| 84 const FloatPoint localOrigin(LayoutPoint(boxOrigin.x(), boxOrigin.y() - delt
aY)); | 84 const FloatPoint localOrigin(LayoutPoint(boxOrigin.x(), boxOrigin.y() - delt
aY)); |
| 85 FloatRect clipRect(localOrigin, FloatSize(LayoutSize(m_ellipsisBox.logicalWi
dth(), h))); | 85 FloatRect clipRect(localOrigin, FloatSize(LayoutSize(m_ellipsisBox.logicalWi
dth(), h))); |
| 86 context.clip(clipRect); | 86 context.clip(clipRect); |
| 87 context.drawHighlightForText(font, constructTextRun(font, m_ellipsisBox.elli
psisStr(), style, TextRun::AllowTrailingExpansion), localOrigin, h, c); | 87 context.drawHighlightForText(font, constructTextRun(font, m_ellipsisBox.elli
psisStr(), style, TextRun::AllowTrailingExpansion), localOrigin, h.toInt(), c); |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace blink | 90 } // namespace blink |
| OLD | NEW |