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

Side by Side Diff: third_party/WebKit/Source/core/editing/FindInPageCoordinates.cpp

Issue 2904833002: LayoutObject::AbsoluteBoundingBoxRectForRange() should take EphemeralRange (Closed)
Patch Set: updaredPatch Created 3 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
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 // Jump to the layoutObject owning the frame, if any. 140 // Jump to the layoutObject owning the frame, if any.
141 layout_object = layout_object->GetFrame() 141 layout_object = layout_object->GetFrame()
142 ? layout_object->GetFrame()->OwnerLayoutObject() 142 ? layout_object->GetFrame()->OwnerLayoutObject()
143 : 0; 143 : 0;
144 } 144 }
145 145
146 return normalized_rect; 146 return normalized_rect;
147 } 147 }
148 148
149 FloatRect FindInPageRectFromRange(Range* range) { 149 FloatRect FindInPageRectFromRange(const EphemeralRange& range) {
150 if (!range || !range->FirstNode()) 150 if (range.IsNull() || !range.StartPosition().NodeAsRangeFirstNode())
151 return FloatRect();
152
153 const LayoutObject* baseLayoutObject =
yosin_UTC9 2017/05/24 09:35:51 nit: s/const LayoutObject*/const LayoutObject* con
154 range.StartPosition().NodeAsRangeFirstNode()->GetLayoutObject();
155 if (!baseLayoutObject)
151 return FloatRect(); 156 return FloatRect();
152 157
153 return FindInPageRectFromAbsoluteRect( 158 return FindInPageRectFromAbsoluteRect(
154 LayoutObject::AbsoluteBoundingBoxRectForRange(range), 159 LayoutObject::AbsoluteBoundingBoxRectForRange(range), baseLayoutObject);
155 range->FirstNode()->GetLayoutObject());
156 } 160 }
157 161
158 } // namespace blink 162 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/FindInPageCoordinates.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698