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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 getNextSoftBreak(line, breakNode, breakOffset); | 633 getNextSoftBreak(line, breakNode, breakOffset); |
634 } | 634 } |
635 result.append(data.characters() + position, length - position); | 635 result.append(data.characters() + position, length - position); |
636 } | 636 } |
637 while (breakNode == node) | 637 while (breakNode == node) |
638 getNextSoftBreak(line, breakNode, breakOffset); | 638 getNextSoftBreak(line, breakNode, breakOffset); |
639 } | 639 } |
640 return finishText(result); | 640 return finishText(result); |
641 } | 641 } |
642 | 642 |
643 HTMLTextFormControlElement* enclosingTextFormControl(const Position& position) | 643 Result<HTMLTextFormControlElement> enclosingTextFormControl(const Position& posi
tion) |
644 { | 644 { |
645 ASSERT(position.isNull() || position.anchorType() == Position::PositionIsOff
setInAnchor | 645 ASSERT(position.isNull() || position.anchorType() == Position::PositionIsOff
setInAnchor |
646 || position.containerNode() || !position.anchorNode()->shadowHost() | 646 || position.containerNode() || !position.anchorNode()->shadowHost() |
647 || (position.anchorNode()->parentNode() && position.anchorNode()->parent
Node()->isShadowRoot())); | 647 || (position.anchorNode()->parentNode() && position.anchorNode()->parent
Node()->isShadowRoot())); |
648 | 648 |
649 Node* container = position.containerNode(); | 649 Node* container = position.containerNode(); |
650 if (!container) | 650 if (!container) |
651 return 0; | 651 return nullptr; |
652 Element* ancestor = container->shadowHost(); | 652 Element* ancestor = container->shadowHost(); |
653 return ancestor && isHTMLTextFormControlElement(ancestor) ? toHTMLTextFormCo
ntrolElement(ancestor) : 0; | 653 return ancestor && isHTMLTextFormControlElement(ancestor) ? toHTMLTextFormCo
ntrolElement(ancestor) : nullptr; |
654 } | 654 } |
655 | 655 |
656 static const Element* parentHTMLElement(const Element* element) | 656 static const Element* parentHTMLElement(const Element* element) |
657 { | 657 { |
658 while (element) { | 658 while (element) { |
659 element = element->parentElement(); | 659 element = element->parentElement(); |
660 if (element && element->isHTMLElement()) | 660 if (element && element->isHTMLElement()) |
661 return element; | 661 return element; |
662 } | 662 } |
663 return 0; | 663 return 0; |
(...skipping 19 matching lines...) Expand all Loading... |
683 return "ltr"; | 683 return "ltr"; |
684 } | 684 } |
685 | 685 |
686 void HTMLTextFormControlElement::reportMemoryUsage(MemoryObjectInfo* memoryObjec
tInfo) const | 686 void HTMLTextFormControlElement::reportMemoryUsage(MemoryObjectInfo* memoryObjec
tInfo) const |
687 { | 687 { |
688 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); | 688 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); |
689 HTMLFormControlElementWithState::reportMemoryUsage(memoryObjectInfo); | 689 HTMLFormControlElementWithState::reportMemoryUsage(memoryObjectInfo); |
690 info.addMember(m_textAsOfLastFormControlChangeEvent, "textAsOfLastFormContro
lChangeEvent"); | 690 info.addMember(m_textAsOfLastFormControlChangeEvent, "textAsOfLastFormContro
lChangeEvent"); |
691 } | 691 } |
692 | 692 |
| 693 void HTMLTextFormControlElement::acceptHeapVisitor(Visitor* visitor) const |
| 694 { |
| 695 HTMLFormControlElementWithState::acceptHeapVisitor(visitor); |
| 696 } |
| 697 |
693 } // namespace Webcore | 698 } // namespace Webcore |
OLD | NEW |