| 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 3011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3022 // find a single non-anonymous renderer. | 3022 // find a single non-anonymous renderer. |
| 3023 | 3023 |
| 3024 // Find a nearby non-anonymous renderer. | 3024 // Find a nearby non-anonymous renderer. |
| 3025 RenderObject* child = this; | 3025 RenderObject* child = this; |
| 3026 while (RenderObject* parent = child->parent()) { | 3026 while (RenderObject* parent = child->parent()) { |
| 3027 // Find non-anonymous content after. | 3027 // Find non-anonymous content after. |
| 3028 RenderObject* renderer = child; | 3028 RenderObject* renderer = child; |
| 3029 while ((renderer = renderer->nextInPreOrder(parent))) { | 3029 while ((renderer = renderer->nextInPreOrder(parent))) { |
| 3030 HandleScope scope; | 3030 HandleScope scope; |
| 3031 if (Handle<Node> node = renderer->nonPseudoNode()) | 3031 if (Handle<Node> node = renderer->nonPseudoNode()) |
| 3032 return VisiblePosition(firstPositionInOrBeforeNode(node.raw()),
DOWNSTREAM); | 3032 return VisiblePosition(firstPositionInOrBeforeNode(node), DOWNST
REAM); |
| 3033 } | 3033 } |
| 3034 | 3034 |
| 3035 // Find non-anonymous content before. | 3035 // Find non-anonymous content before. |
| 3036 renderer = child; | 3036 renderer = child; |
| 3037 while ((renderer = renderer->previousInPreOrder())) { | 3037 while ((renderer = renderer->previousInPreOrder())) { |
| 3038 HandleScope scope; | 3038 HandleScope scope; |
| 3039 if (renderer == parent) | 3039 if (renderer == parent) |
| 3040 break; | 3040 break; |
| 3041 if (Handle<Node> node = renderer->nonPseudoNode()) | 3041 if (Handle<Node> node = renderer->nonPseudoNode()) |
| 3042 return VisiblePosition(lastPositionInOrAfterNode(node.raw()), DO
WNSTREAM); | 3042 return VisiblePosition(lastPositionInOrAfterNode(node), DOWNSTRE
AM); |
| 3043 } | 3043 } |
| 3044 | 3044 |
| 3045 // Use the parent itself unless it too is anonymous. | 3045 // Use the parent itself unless it too is anonymous. |
| 3046 if (Handle<Node> node = parent->nonPseudoNode()) | 3046 if (Handle<Node> node = parent->nonPseudoNode()) |
| 3047 return VisiblePosition(firstPositionInOrBeforeNode(node.raw()), DOWN
STREAM); | 3047 return VisiblePosition(firstPositionInOrBeforeNode(node), DOWNSTREAM
); |
| 3048 | 3048 |
| 3049 // Repeat at the next level up. | 3049 // Repeat at the next level up. |
| 3050 child = parent; | 3050 child = parent; |
| 3051 } | 3051 } |
| 3052 | 3052 |
| 3053 // Everything was anonymous. Give up. | 3053 // Everything was anonymous. Give up. |
| 3054 return VisiblePosition(); | 3054 return VisiblePosition(); |
| 3055 } | 3055 } |
| 3056 | 3056 |
| 3057 VisiblePosition RenderObject::createVisiblePosition(const Position& position) | 3057 VisiblePosition RenderObject::createVisiblePosition(const Position& position) |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3182 { | 3182 { |
| 3183 if (object1) { | 3183 if (object1) { |
| 3184 const WebCore::RenderObject* root = object1; | 3184 const WebCore::RenderObject* root = object1; |
| 3185 while (root->parent()) | 3185 while (root->parent()) |
| 3186 root = root->parent(); | 3186 root = root->parent(); |
| 3187 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3187 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 3188 } | 3188 } |
| 3189 } | 3189 } |
| 3190 | 3190 |
| 3191 #endif | 3191 #endif |
| OLD | NEW |