Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Side by Side Diff: sky/engine/core/rendering/EllipsisBox.cpp

Issue 684383002: Delete a ton more dead vertical writing mode code. (Closed) Base URL: git@github.com:domokit/mojo.git@writingmode1
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | sky/engine/core/rendering/InlineBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/rendering/InlineBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698