Chromium Code Reviews| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 |
| OLD | NEW |