| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 2981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2992 // If it can be found, we prefer a visually equivalent position that
is editable. | 2992 // If it can be found, we prefer a visually equivalent position that
is editable. |
| 2993 const Position position = Position(node, offset); | 2993 const Position position = Position(node, offset); |
| 2994 Position candidate = position.downstream(CanCrossEditingBoundary); | 2994 Position candidate = position.downstream(CanCrossEditingBoundary); |
| 2995 if (candidate.anchorNode()->hasEditableStyle()) | 2995 if (candidate.anchorNode()->hasEditableStyle()) |
| 2996 return PositionWithAffinity(candidate, affinity); | 2996 return PositionWithAffinity(candidate, affinity); |
| 2997 candidate = position.upstream(CanCrossEditingBoundary); | 2997 candidate = position.upstream(CanCrossEditingBoundary); |
| 2998 if (candidate.anchorNode()->hasEditableStyle()) | 2998 if (candidate.anchorNode()->hasEditableStyle()) |
| 2999 return PositionWithAffinity(candidate, affinity); | 2999 return PositionWithAffinity(candidate, affinity); |
| 3000 } | 3000 } |
| 3001 // FIXME: Eliminate legacy editing positions | 3001 // FIXME: Eliminate legacy editing positions |
| 3002 return PositionWithAffinity(createLegacyEditingPosition(node, offset), a
ffinity); | 3002 return PositionWithAffinity(Position::editingPositionOf(node, offset), a
ffinity); |
| 3003 } | 3003 } |
| 3004 | 3004 |
| 3005 // We don't want to cross the boundary between editable and non-editable | 3005 // We don't want to cross the boundary between editable and non-editable |
| 3006 // regions of the document, but that is either impossible or at least | 3006 // regions of the document, but that is either impossible or at least |
| 3007 // extremely unlikely in any normal case because we stop as soon as we | 3007 // extremely unlikely in any normal case because we stop as soon as we |
| 3008 // find a single non-anonymous layoutObject. | 3008 // find a single non-anonymous layoutObject. |
| 3009 | 3009 |
| 3010 // Find a nearby non-anonymous layoutObject. | 3010 // Find a nearby non-anonymous layoutObject. |
| 3011 LayoutObject* child = this; | 3011 LayoutObject* child = this; |
| 3012 while (LayoutObject* parent = child->parent()) { | 3012 while (LayoutObject* parent = child->parent()) { |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3397 const blink::LayoutObject* root = object1; | 3397 const blink::LayoutObject* root = object1; |
| 3398 while (root->parent()) | 3398 while (root->parent()) |
| 3399 root = root->parent(); | 3399 root = root->parent(); |
| 3400 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3400 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3401 } else { | 3401 } else { |
| 3402 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3402 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3403 } | 3403 } |
| 3404 } | 3404 } |
| 3405 | 3405 |
| 3406 #endif | 3406 #endif |
| OLD | NEW |