| 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 23 matching lines...) Expand all Loading... |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 void EllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, La
youtUnit lineTop, LayoutUnit lineBottom) | 36 void EllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, La
youtUnit lineTop, LayoutUnit lineBottom) |
| 37 { | 37 { |
| 38 GraphicsContext* context = paintInfo.context; | 38 GraphicsContext* context = paintInfo.context; |
| 39 RenderStyle* style = renderer().style(isFirstLineStyle()); | 39 RenderStyle* style = renderer().style(isFirstLineStyle()); |
| 40 | 40 |
| 41 const Font& font = style->font(); | 41 const Font& font = style->font(); |
| 42 FloatPoint boxOrigin = locationIncludingFlipping(); | 42 FloatPoint boxOrigin = locationIncludingFlipping(); |
| 43 boxOrigin.moveBy(FloatPoint(paintOffset)); | 43 boxOrigin.moveBy(FloatPoint(paintOffset)); |
| 44 if (!isHorizontal()) | |
| 45 boxOrigin.move(0, -virtualLogicalHeight()); | |
| 46 FloatRect boxRect(boxOrigin, LayoutSize(logicalWidth(), virtualLogicalHeight
())); | 44 FloatRect boxRect(boxOrigin, LayoutSize(logicalWidth(), virtualLogicalHeight
())); |
| 47 GraphicsContextStateSaver stateSaver(*context); | 45 GraphicsContextStateSaver stateSaver(*context); |
| 48 if (!isHorizontal()) | |
| 49 context->concatCTM(InlineTextBox::rotation(boxRect, InlineTextBox::Clock
wise)); | |
| 50 FloatPoint textOrigin = FloatPoint(boxOrigin.x(), boxOrigin.y() + font.fontM
etrics().ascent()); | 46 FloatPoint textOrigin = FloatPoint(boxOrigin.x(), boxOrigin.y() + font.fontM
etrics().ascent()); |
| 51 | 47 |
| 52 Color styleTextColor = renderer().resolveColor(style, CSSPropertyWebkitTextF
illColor); | 48 Color styleTextColor = renderer().resolveColor(style, CSSPropertyWebkitTextF
illColor); |
| 53 if (styleTextColor != context->fillColor()) | 49 if (styleTextColor != context->fillColor()) |
| 54 context->setFillColor(styleTextColor); | 50 context->setFillColor(styleTextColor); |
| 55 | 51 |
| 56 if (selectionState() != RenderObject::SelectionNone) { | 52 if (selectionState() != RenderObject::SelectionNone) { |
| 57 paintSelection(context, boxOrigin, style, font); | 53 paintSelection(context, boxOrigin, style, font); |
| 58 | 54 |
| 59 // Select the correct color for painting the text. | 55 // Select the correct color for painting the text. |
| 60 Color foreground = paintInfo.forceBlackText() ? Color::black : renderer(
).selectionForegroundColor(); | 56 Color foreground = paintInfo.forceBlackText() ? Color::black : renderer(
).selectionForegroundColor(); |
| 61 if (foreground != styleTextColor) | 57 if (foreground != styleTextColor) |
| 62 context->setFillColor(foreground); | 58 context->setFillColor(foreground); |
| 63 } | 59 } |
| 64 | 60 |
| 65 const ShadowList* shadowList = style->textShadow(); | 61 const ShadowList* shadowList = style->textShadow(); |
| 66 bool hasShadow = shadowList; | 62 bool hasShadow = shadowList; |
| 67 if (hasShadow) | 63 if (hasShadow) |
| 68 context->setDrawLooper(shadowList->createDrawLooper(DrawLooperBuilder::S
hadowIgnoresAlpha, isHorizontal())); | 64 context->setDrawLooper(shadowList->createDrawLooper(DrawLooperBuilder::S
hadowIgnoresAlpha)); |
| 69 | 65 |
| 70 TextRun textRun = constructTextRun(&renderer(), font, m_str, style, TextRun:
:AllowTrailingExpansion); | 66 TextRun textRun = constructTextRun(&renderer(), font, m_str, style, TextRun:
:AllowTrailingExpansion); |
| 71 TextRunPaintInfo textRunPaintInfo(textRun); | 67 TextRunPaintInfo textRunPaintInfo(textRun); |
| 72 textRunPaintInfo.bounds = boxRect; | 68 textRunPaintInfo.bounds = boxRect; |
| 73 context->drawText(font, textRunPaintInfo, textOrigin); | 69 context->drawText(font, textRunPaintInfo, textOrigin); |
| 74 | 70 |
| 75 // Restore the regular fill color. | 71 // Restore the regular fill color. |
| 76 if (styleTextColor != context->fillColor()) | 72 if (styleTextColor != context->fillColor()) |
| 77 context->setFillColor(styleTextColor); | 73 context->setFillColor(styleTextColor); |
| 78 | 74 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 if (visibleToHitTestRequest(request) && boundsRect.intersects(HitTestLocatio
n::rectForPoint(locationInContainer.point(), 0, 0, 0, 0))) { | 159 if (visibleToHitTestRequest(request) && boundsRect.intersects(HitTestLocatio
n::rectForPoint(locationInContainer.point(), 0, 0, 0, 0))) { |
| 164 renderer().updateHitTestResult(result, locationInContainer.point() - toL
ayoutSize(adjustedLocation)); | 160 renderer().updateHitTestResult(result, locationInContainer.point() - toL
ayoutSize(adjustedLocation)); |
| 165 if (!result.addNodeToRectBasedTestResult(renderer().node(), request, loc
ationInContainer, boundsRect)) | 161 if (!result.addNodeToRectBasedTestResult(renderer().node(), request, loc
ationInContainer, boundsRect)) |
| 166 return true; | 162 return true; |
| 167 } | 163 } |
| 168 | 164 |
| 169 return false; | 165 return false; |
| 170 } | 166 } |
| 171 | 167 |
| 172 } // namespace blink | 168 } // namespace blink |
| OLD | NEW |