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

Side by Side Diff: Source/core/layout/line/EllipsisBox.cpp

Issue 1043643002: Switch line layout to LayoutUnit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More TestExpectations tweaks Created 5 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/line/EllipsisBox.h ('k') | Source/core/layout/line/FloatToLayoutUnit.h » ('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 30 matching lines...) Expand all
41 { 41 {
42 const ComputedStyle& style = layoutObject().styleRef(isFirstLineStyle()); 42 const ComputedStyle& style = layoutObject().styleRef(isFirstLineStyle());
43 const Font& font = style.font(); 43 const Font& font = style.font();
44 return enclosingIntRect(font.selectionRectForText(constructTextRun(&layoutOb ject(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(logicalLe ft(), logicalTop() + root().selectionTopAdjustedForPrecedingBlock()), root().sel ectionHeightAdjustedForPrecedingBlock())); 44 return enclosingIntRect(font.selectionRectForText(constructTextRun(&layoutOb ject(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(logicalLe ft(), logicalTop() + root().selectionTopAdjustedForPrecedingBlock()), root().sel ectionHeightAdjustedForPrecedingBlock()));
45 } 45 }
46 46
47 bool EllipsisBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& loca tionInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, Layou tUnit lineBottom) 47 bool EllipsisBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& loca tionInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, Layou tUnit lineBottom)
48 { 48 {
49 // FIXME: the call to roundedLayoutPoint() below is temporary and should be removed once 49 // FIXME: the call to roundedLayoutPoint() below is temporary and should be removed once
50 // the transition to LayoutUnit-based types is complete (crbug.com/321237) 50 // the transition to LayoutUnit-based types is complete (crbug.com/321237)
51 LayoutPoint adjustedLocation = accumulatedOffset + topLeft().roundedLayoutPo int(); 51 LayoutPoint adjustedLocation = accumulatedOffset + topLeft();
52 52
53 FloatPointWillBeLayoutPoint boxOrigin = locationIncludingFlipping(); 53 LayoutPoint boxOrigin = locationIncludingFlipping();
54 boxOrigin.moveBy(accumulatedOffset); 54 boxOrigin.moveBy(accumulatedOffset);
55 FloatRectWillBeLayoutRect boundsRect(boxOrigin, size()); 55 LayoutRect boundsRect(boxOrigin, size());
56 if (visibleToHitTestRequest(result.hitTestRequest()) && boundsRect.intersect s(FloatRectWillBeLayoutRect(HitTestLocation::rectForPoint(locationInContainer.po int(), 0, 0, 0, 0)))) { 56 if (visibleToHitTestRequest(result.hitTestRequest()) && boundsRect.intersect s(LayoutRect(HitTestLocation::rectForPoint(locationInContainer.point(), 0, 0, 0, 0)))) {
57 layoutObject().updateHitTestResult(result, locationInContainer.point() - toLayoutSize(adjustedLocation)); 57 layoutObject().updateHitTestResult(result, locationInContainer.point() - toLayoutSize(adjustedLocation));
58 // FIXME: the call to rawValue() below is temporary and should be remove d once the transition 58 // FIXME: the call to rawValue() below is temporary and should be remove d once the transition
59 // to LayoutUnit-based types is complete (crbug.com/321237) 59 // to LayoutUnit-based types is complete (crbug.com/321237)
60 if (!result.addNodeToListBasedTestResult(layoutObject().node(), location InContainer, boundsRect.rawValue())) 60 if (!result.addNodeToListBasedTestResult(layoutObject().node(), location InContainer, boundsRect))
61 return true; 61 return true;
62 } 62 }
63 63
64 return false; 64 return false;
65 } 65 }
66 66
67 const char* EllipsisBox::boxName() const 67 const char* EllipsisBox::boxName() const
68 { 68 {
69 return "EllipsisBox"; 69 return "EllipsisBox";
70 } 70 }
71 71
72 } // namespace blink 72 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/line/EllipsisBox.h ('k') | Source/core/layout/line/FloatToLayoutUnit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698