OLD | NEW |
---|---|
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 Loading... | |
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 |
OLD | NEW |