| 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) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 | 436 |
| 437 if (!innerText->firstChild()) | 437 if (!innerText->firstChild()) |
| 438 return Range::create(document(), innerText, 0, innerText, 0); | 438 return Range::create(document(), innerText, 0, innerText, 0); |
| 439 | 439 |
| 440 int offset = 0; | 440 int offset = 0; |
| 441 Node* startNode = 0; | 441 Node* startNode = 0; |
| 442 Node* endNode = 0; | 442 Node* endNode = 0; |
| 443 for (Node* node = innerText->firstChild(); node; node = NodeTraversal::next(
*node, innerText)) { | 443 for (Node* node = innerText->firstChild(); node; node = NodeTraversal::next(
*node, innerText)) { |
| 444 ASSERT(!node->firstChild()); | 444 ASSERT(!node->firstChild()); |
| 445 ASSERT(node->isTextNode() || node->hasTagName(brTag)); | 445 ASSERT(node->isTextNode() || node->hasTagName(brTag)); |
| 446 int length = node->isTextNode() ? lastOffsetInNode(node) : 1; | 446 int length = node->isTextNode() ? lastOffsetInNode(*node) : 1; |
| 447 | 447 |
| 448 if (offset <= start && start <= offset + length) | 448 if (offset <= start && start <= offset + length) |
| 449 setContainerAndOffsetForRange(node, start - offset, startNode, start
); | 449 setContainerAndOffsetForRange(node, start - offset, startNode, start
); |
| 450 | 450 |
| 451 if (offset <= end && end <= offset + length) { | 451 if (offset <= end && end <= offset + length) { |
| 452 setContainerAndOffsetForRange(node, end - offset, endNode, end); | 452 setContainerAndOffsetForRange(node, end - offset, endNode, end); |
| 453 break; | 453 break; |
| 454 } | 454 } |
| 455 | 455 |
| 456 offset += length; | 456 offset += length; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 | 647 |
| 648 return "ltr"; | 648 return "ltr"; |
| 649 } | 649 } |
| 650 | 650 |
| 651 HTMLElement* HTMLTextFormControlElement::innerTextElement() const | 651 HTMLElement* HTMLTextFormControlElement::innerTextElement() const |
| 652 { | 652 { |
| 653 return toHTMLElement(userAgentShadowRoot()->getElementById(ShadowElementName
s::innerEditor())); | 653 return toHTMLElement(userAgentShadowRoot()->getElementById(ShadowElementName
s::innerEditor())); |
| 654 } | 654 } |
| 655 | 655 |
| 656 } // namespace Webcore | 656 } // namespace Webcore |
| OLD | NEW |