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

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

Issue 253853002: PlaceHolder in TextArea should allow carriage return and line feed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added rendering test and also added test for carriage return Created 6 years, 7 months 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 | « LayoutTests/fast/forms/placeholder-stripped-expected.txt ('k') | no next file » | 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, 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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 } 534 }
535 535
536 bool HTMLTextAreaElement::matchesReadWritePseudoClass() const 536 bool HTMLTextAreaElement::matchesReadWritePseudoClass() const
537 { 537 {
538 return !isReadOnly(); 538 return !isReadOnly();
539 } 539 }
540 540
541 void HTMLTextAreaElement::updatePlaceholderText() 541 void HTMLTextAreaElement::updatePlaceholderText()
542 { 542 {
543 HTMLElement* placeholder = placeholderElement(); 543 HTMLElement* placeholder = placeholderElement();
544 String placeholderText = strippedPlaceholder(); 544 const AtomicString& placeholderText = fastGetAttribute(placeholderAttr);
545 if (placeholderText.isEmpty()) { 545 if (placeholderText.isEmpty()) {
546 if (placeholder) 546 if (placeholder)
547 userAgentShadowRoot()->removeChild(placeholder); 547 userAgentShadowRoot()->removeChild(placeholder);
548 return; 548 return;
549 } 549 }
550 if (!placeholder) { 550 if (!placeholder) {
551 RefPtr<HTMLDivElement> newElement = HTMLDivElement::create(document()); 551 RefPtr<HTMLDivElement> newElement = HTMLDivElement::create(document());
552 placeholder = newElement.get(); 552 placeholder = newElement.get();
553 placeholder->setShadowPseudoId(AtomicString("-webkit-input-placeholder", AtomicString::ConstructFromLiteral)); 553 placeholder->setShadowPseudoId(AtomicString("-webkit-input-placeholder", AtomicString::ConstructFromLiteral));
554 placeholder->setAttribute(idAttr, ShadowElementNames::placeholder()); 554 placeholder->setAttribute(idAttr, ShadowElementNames::placeholder());
555 userAgentShadowRoot()->insertBefore(placeholder, innerTextElement()->nex tSibling()); 555 userAgentShadowRoot()->insertBefore(placeholder, innerTextElement()->nex tSibling());
556 } 556 }
557 placeholder->setTextContent(placeholderText); 557 placeholder->setTextContent(placeholderText);
558 } 558 }
559 559
560 bool HTMLTextAreaElement::isInteractiveContent() const 560 bool HTMLTextAreaElement::isInteractiveContent() const
561 { 561 {
562 return true; 562 return true;
563 } 563 }
564 564
565 bool HTMLTextAreaElement::supportsAutofocus() const 565 bool HTMLTextAreaElement::supportsAutofocus() const
566 { 566 {
567 return true; 567 return true;
568 } 568 }
569 569
570 } 570 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/placeholder-stripped-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698