Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(774)

Side by Side Diff: Source/core/html/HTMLTextFormControlElement.cpp

Issue 656723005: Use C++11 features in core/html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: mike's comments Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/html/HTMLTextAreaElement.cpp ('k') | Source/core/html/HTMLTrackElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTextAreaElement.cpp ('k') | Source/core/html/HTMLTrackElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698