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

Side by Side Diff: Source/core/html/forms/TextFieldInputType.cpp

Issue 106503002: Let Node.textContent never throw (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLTextAreaElement.cpp ('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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 if (!placeholder) { 397 if (!placeholder) {
398 RefPtr<HTMLElement> newElement = HTMLDivElement::create(element().docume nt()); 398 RefPtr<HTMLElement> newElement = HTMLDivElement::create(element().docume nt());
399 placeholder = newElement.get(); 399 placeholder = newElement.get();
400 placeholder->setPseudo(AtomicString("-webkit-input-placeholder", AtomicS tring::ConstructFromLiteral)); 400 placeholder->setPseudo(AtomicString("-webkit-input-placeholder", AtomicS tring::ConstructFromLiteral));
401 placeholder->setAttribute(idAttr, ShadowElementNames::placeholder()); 401 placeholder->setAttribute(idAttr, ShadowElementNames::placeholder());
402 Element* container = containerElement(); 402 Element* container = containerElement();
403 Node* previous = container ? container : element().innerTextElement(); 403 Node* previous = container ? container : element().innerTextElement();
404 previous->parentNode()->insertBefore(placeholder, previous->nextSibling( )); 404 previous->parentNode()->insertBefore(placeholder, previous->nextSibling( ));
405 ASSERT_WITH_SECURITY_IMPLICATION(placeholder->parentNode() == previous-> parentNode()); 405 ASSERT_WITH_SECURITY_IMPLICATION(placeholder->parentNode() == previous-> parentNode());
406 } 406 }
407 placeholder->setTextContent(placeholderText, ASSERT_NO_EXCEPTION); 407 placeholder->setTextContent(placeholderText);
408 } 408 }
409 409
410 bool TextFieldInputType::appendFormData(FormDataList& list, bool multipart) cons t 410 bool TextFieldInputType::appendFormData(FormDataList& list, bool multipart) cons t
411 { 411 {
412 InputType::appendFormData(list, multipart); 412 InputType::appendFormData(list, multipart);
413 const AtomicString& dirnameAttrValue = element().fastGetAttribute(dirnameAtt r); 413 const AtomicString& dirnameAttrValue = element().fastGetAttribute(dirnameAtt r);
414 if (!dirnameAttrValue.isNull()) 414 if (!dirnameAttrValue.isNull())
415 list.appendData(dirnameAttrValue, element().directionForFormData()); 415 list.appendData(dirnameAttrValue, element().directionForFormData());
416 return true; 416 return true;
417 } 417 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 { 482 {
483 return !element().isDisabledOrReadOnly(); 483 return !element().isDisabledOrReadOnly();
484 } 484 }
485 485
486 bool TextFieldInputType::shouldSpinButtonRespondToWheelEvents() 486 bool TextFieldInputType::shouldSpinButtonRespondToWheelEvents()
487 { 487 {
488 return shouldSpinButtonRespondToMouseEvents() && element().focused(); 488 return shouldSpinButtonRespondToMouseEvents() && element().focused();
489 } 489 }
490 490
491 } // namespace WebCore 491 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTextAreaElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698