| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 template <typename Strategy> | 154 template <typename Strategy> |
| 155 PositionTemplate<Strategy> EndOfParagraphAlgorithm( | 155 PositionTemplate<Strategy> EndOfParagraphAlgorithm( |
| 156 const PositionTemplate<Strategy>& position, | 156 const PositionTemplate<Strategy>& position, |
| 157 EditingBoundaryCrossingRule boundary_crossing_rule) { | 157 EditingBoundaryCrossingRule boundary_crossing_rule) { |
| 158 Node* const start_node = position.AnchorNode(); | 158 Node* const start_node = position.AnchorNode(); |
| 159 | 159 |
| 160 if (!start_node) | 160 if (!start_node) |
| 161 return PositionTemplate<Strategy>(); | 161 return PositionTemplate<Strategy>(); |
| 162 | 162 |
| 163 if (IsRenderedAsNonInlineTableImageOrHR(start_node)) | 163 if (IsRenderedAsNonInlineTableImageOrHR(start_node)) |
| 164 return PositionTemplate<Strategy>::AfterNode(start_node); | 164 return PositionTemplate<Strategy>::AfterNode(*start_node); |
| 165 | 165 |
| 166 Element* const start_block = EnclosingBlock( | 166 Element* const start_block = EnclosingBlock( |
| 167 PositionTemplate<Strategy>::FirstPositionInOrBeforeNode(start_node), | 167 PositionTemplate<Strategy>::FirstPositionInOrBeforeNode(start_node), |
| 168 kCannotCrossEditingBoundary); | 168 kCannotCrossEditingBoundary); |
| 169 ContainerNode* const highest_root = HighestEditableRoot(position); | 169 ContainerNode* const highest_root = HighestEditableRoot(position); |
| 170 const bool start_node_is_editable = HasEditableStyle(*start_node); | 170 const bool start_node_is_editable = HasEditableStyle(*start_node); |
| 171 | 171 |
| 172 Node* candidate_node = start_node; | 172 Node* candidate_node = start_node; |
| 173 PositionAnchorType candidate_type = position.AnchorType(); | 173 PositionAnchorType candidate_type = position.AnchorType(); |
| 174 int candidate_offset = position.ComputeEditingOffset(); | 174 int candidate_offset = position.ComputeEditingOffset(); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 ? paragraph_start | 399 ? paragraph_start |
| 400 : range.StartPosition(); | 400 : range.StartPosition(); |
| 401 const Position& result_end = | 401 const Position& result_end = |
| 402 paragraph_end.IsNotNull() && paragraph_end >= range.EndPosition() | 402 paragraph_end.IsNotNull() && paragraph_end >= range.EndPosition() |
| 403 ? paragraph_end | 403 ? paragraph_end |
| 404 : range.EndPosition(); | 404 : range.EndPosition(); |
| 405 return EphemeralRange(result_start, result_end); | 405 return EphemeralRange(result_start, result_end); |
| 406 } | 406 } |
| 407 | 407 |
| 408 } // namespace blink | 408 } // namespace blink |
| OLD | NEW |