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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp

Issue 1478573002: Double-clicking whitespace after value text should select the last word in INPUT/TEXTAREA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
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, 2008, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 if (placeholder) 621 if (placeholder)
622 userAgentShadowRoot()->removeChild(placeholder); 622 userAgentShadowRoot()->removeChild(placeholder);
623 return; 623 return;
624 } 624 }
625 if (!placeholder) { 625 if (!placeholder) {
626 RefPtrWillBeRawPtr<HTMLDivElement> newElement = HTMLDivElement::create(d ocument()); 626 RefPtrWillBeRawPtr<HTMLDivElement> newElement = HTMLDivElement::create(d ocument());
627 placeholder = newElement.get(); 627 placeholder = newElement.get();
628 placeholder->setShadowPseudoId(AtomicString("-webkit-input-placeholder", AtomicString::ConstructFromLiteral)); 628 placeholder->setShadowPseudoId(AtomicString("-webkit-input-placeholder", AtomicString::ConstructFromLiteral));
629 placeholder->setAttribute(idAttr, ShadowElementNames::placeholder()); 629 placeholder->setAttribute(idAttr, ShadowElementNames::placeholder());
630 placeholder->setInlineStyleProperty(CSSPropertyDisplay, isPlaceholderVis ible() ? CSSValueBlock : CSSValueNone, true); 630 placeholder->setInlineStyleProperty(CSSPropertyDisplay, isPlaceholderVis ible() ? CSSValueBlock : CSSValueNone, true);
631 userAgentShadowRoot()->insertBefore(placeholder, innerEditorElement()->n extSibling()); 631 userAgentShadowRoot()->insertBefore(placeholder, innerEditorElement());
632 } 632 }
633 placeholder->setTextContent(placeholderText); 633 placeholder->setTextContent(placeholderText);
634 } 634 }
635 635
636 bool HTMLTextAreaElement::isInteractiveContent() const 636 bool HTMLTextAreaElement::isInteractiveContent() const
637 { 637 {
638 return true; 638 return true;
639 } 639 }
640 640
641 bool HTMLTextAreaElement::supportsAutofocus() const 641 bool HTMLTextAreaElement::supportsAutofocus() const
642 { 642 {
643 return true; 643 return true;
644 } 644 }
645 645
646 const AtomicString& HTMLTextAreaElement::defaultAutocapitalize() const 646 const AtomicString& HTMLTextAreaElement::defaultAutocapitalize() const
647 { 647 {
648 DEFINE_STATIC_LOCAL(const AtomicString, sentences, ("sentences", AtomicStrin g::ConstructFromLiteral)); 648 DEFINE_STATIC_LOCAL(const AtomicString, sentences, ("sentences", AtomicStrin g::ConstructFromLiteral));
649 return sentences; 649 return sentences;
650 } 650 }
651 651
652 void HTMLTextAreaElement::copyNonAttributePropertiesFromElement(const Element& s ource) 652 void HTMLTextAreaElement::copyNonAttributePropertiesFromElement(const Element& s ource)
653 { 653 {
654 const HTMLTextAreaElement& sourceElement = static_cast<const HTMLTextAreaEle ment&>(source); 654 const HTMLTextAreaElement& sourceElement = static_cast<const HTMLTextAreaEle ment&>(source);
655 setValueCommon(sourceElement.value(), DispatchNoEvent, SetSeletion); 655 setValueCommon(sourceElement.value(), DispatchNoEvent, SetSeletion);
656 m_isDirty = sourceElement.m_isDirty; 656 m_isDirty = sourceElement.m_isDirty;
657 HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(source); 657 HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(source);
658 } 658 }
659 659
660 } // namespace blink 660 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698