OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |