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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 { | 687 { |
688 ASSERT(position.isNull() || position.anchorType() == Position::PositionIsOff
setInAnchor | 688 ASSERT(position.isNull() || position.anchorType() == Position::PositionIsOff
setInAnchor |
689 || position.containerNode() || !position.anchorNode()->shadowHost() | 689 || position.containerNode() || !position.anchorNode()->shadowHost() |
690 || (position.anchorNode()->parentNode() && position.anchorNode()->parent
Node()->isShadowRoot())); | 690 || (position.anchorNode()->parentNode() && position.anchorNode()->parent
Node()->isShadowRoot())); |
691 return enclosingTextFormControl(position.containerNode()); | 691 return enclosingTextFormControl(position.containerNode()); |
692 } | 692 } |
693 | 693 |
694 HTMLTextFormControlElement* enclosingTextFormControl(Node* container) | 694 HTMLTextFormControlElement* enclosingTextFormControl(Node* container) |
695 { | 695 { |
696 if (!container) | 696 if (!container) |
697 return 0; | 697 return nullptr; |
698 Element* ancestor = container->shadowHost(); | 698 Element* ancestor = container->shadowHost(); |
699 return ancestor && isHTMLTextFormControlElement(*ancestor) && container->con
tainingShadowRoot()->type() == ShadowRoot::UserAgentShadowRoot ? toHTMLTextFormC
ontrolElement(ancestor) : 0; | 699 return ancestor && isHTMLTextFormControlElement(*ancestor) && container->con
tainingShadowRoot()->type() == ShadowRoot::UserAgentShadowRoot ? toHTMLTextFormC
ontrolElement(ancestor) : 0; |
700 } | 700 } |
701 | 701 |
702 String HTMLTextFormControlElement::directionForFormData() const | 702 String HTMLTextFormControlElement::directionForFormData() const |
703 { | 703 { |
704 for (const HTMLElement* element = this; element; element = Traversal<HTMLEle
ment>::firstAncestor(*element)) { | 704 for (const HTMLElement* element = this; element; element = Traversal<HTMLEle
ment>::firstAncestor(*element)) { |
705 const AtomicString& dirAttributeValue = element->fastGetAttribute(dirAtt
r); | 705 const AtomicString& dirAttributeValue = element->fastGetAttribute(dirAtt
r); |
706 if (dirAttributeValue.isNull()) | 706 if (dirAttributeValue.isNull()) |
707 continue; | 707 continue; |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 Text* textNode = toText(node); | 957 Text* textNode = toText(node); |
958 size_t firstLineBreak = textNode->data().find('\n', isPivotNode ? pi
votPosition.offsetInContainerNode() : 0); | 958 size_t firstLineBreak = textNode->data().find('\n', isPivotNode ? pi
votPosition.offsetInContainerNode() : 0); |
959 if (firstLineBreak != kNotFound) | 959 if (firstLineBreak != kNotFound) |
960 return Position(textNode, firstLineBreak + 1); | 960 return Position(textNode, firstLineBreak + 1); |
961 } | 961 } |
962 } | 962 } |
963 return endOfInnerText(textFormControl); | 963 return endOfInnerText(textFormControl); |
964 } | 964 } |
965 | 965 |
966 } // namespace blink | 966 } // namespace blink |
OLD | NEW |