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

Side by Side Diff: third_party/WebKit/Source/web/FindInPageCoordinates.cpp

Issue 2775663008: LayoutObject::absoluteBoundingBoxRectForRange() should take EphemeralRange (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 DCHECK(layoutObject->isLayoutView()); 136 DCHECK(layoutObject->isLayoutView());
137 137
138 // Jump to the layoutObject owning the frame, if any. 138 // Jump to the layoutObject owning the frame, if any.
139 layoutObject = 139 layoutObject =
140 layoutObject->frame() ? layoutObject->frame()->ownerLayoutObject() : 0; 140 layoutObject->frame() ? layoutObject->frame()->ownerLayoutObject() : 0;
141 } 141 }
142 142
143 return normalizedRect; 143 return normalizedRect;
144 } 144 }
145 145
146 FloatRect findInPageRectFromRange(Range* range) { 146 FloatRect findInPageRectFromRange(EphemeralRange& range) {
147 if (!range || !range->firstNode()) 147 if (range.isNull() || !range.startPosition().nodeAsRangeFirstNode())
Xiaocheng 2017/03/24 18:19:26 Could you store the result of |range.startPosition
148 return FloatRect(); 148 return FloatRect();
149 149
150 return findInPageRectFromAbsoluteRect( 150 return findInPageRectFromAbsoluteRect(
151 LayoutObject::absoluteBoundingBoxRectForRange(range), 151 LayoutObject::absoluteBoundingBoxRectForRange(range),
152 range->firstNode()->layoutObject()); 152 range.startPosition().nodeAsRangeFirstNode()->layoutObject());
153 } 153 }
154 154
155 } // namespace blink 155 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698