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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 | 858 |
859 TextControlElement* enclosingTextControl(const Position& position) { | 859 TextControlElement* enclosingTextControl(const Position& position) { |
860 DCHECK(position.isNull() || position.isOffsetInAnchor() || | 860 DCHECK(position.isNull() || position.isOffsetInAnchor() || |
861 position.computeContainerNode() || | 861 position.computeContainerNode() || |
862 !position.anchorNode()->ownerShadowHost() || | 862 !position.anchorNode()->ownerShadowHost() || |
863 (position.anchorNode()->parentNode() && | 863 (position.anchorNode()->parentNode() && |
864 position.anchorNode()->parentNode()->isShadowRoot())); | 864 position.anchorNode()->parentNode()->isShadowRoot())); |
865 return enclosingTextControl(position.computeContainerNode()); | 865 return enclosingTextControl(position.computeContainerNode()); |
866 } | 866 } |
867 | 867 |
868 TextControlElement* enclosingTextControl(Node* container) { | 868 TextControlElement* enclosingTextControl(const Node* container) { |
869 if (!container) | 869 if (!container) |
870 return nullptr; | 870 return nullptr; |
871 Element* ancestor = container->ownerShadowHost(); | 871 Element* ancestor = container->ownerShadowHost(); |
872 return ancestor && isTextControlElement(*ancestor) && | 872 return ancestor && isTextControlElement(*ancestor) && |
873 container->containingShadowRoot()->type() == | 873 container->containingShadowRoot()->type() == |
874 ShadowRootType::UserAgent | 874 ShadowRootType::UserAgent |
875 ? toTextControlElement(ancestor) | 875 ? toTextControlElement(ancestor) |
876 : 0; | 876 : 0; |
877 } | 877 } |
878 | 878 |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 | 1164 |
1165 void TextControlElement::copyNonAttributePropertiesFromElement( | 1165 void TextControlElement::copyNonAttributePropertiesFromElement( |
1166 const Element& source) { | 1166 const Element& source) { |
1167 const TextControlElement& sourceElement = | 1167 const TextControlElement& sourceElement = |
1168 static_cast<const TextControlElement&>(source); | 1168 static_cast<const TextControlElement&>(source); |
1169 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; | 1169 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; |
1170 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); | 1170 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); |
1171 } | 1171 } |
1172 | 1172 |
1173 } // namespace blink | 1173 } // namespace blink |
OLD | NEW |