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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 for (unsigned i = 0; i < newLength; ++i) { | 266 for (unsigned i = 0; i < newLength; ++i) { |
267 const UChar current = string[i]; | 267 const UChar current = string[i]; |
268 if (current < ' ' && current != '\t') { | 268 if (current < ' ' && current != '\t') { |
269 newLength = i; | 269 newLength = i; |
270 break; | 270 break; |
271 } | 271 } |
272 } | 272 } |
273 return string.left(newLength); | 273 return string.left(newLength); |
274 } | 274 } |
275 | 275 |
276 String TextFieldInputType::sanitizeValue(const String& proposedValue) | 276 String TextFieldInputType::sanitizeValue(const String& proposedValue) const |
277 { | 277 { |
278 #if ENABLE(WCSS) | 278 #if ENABLE(WCSS) |
279 if (!element()->isConformToInputMask(proposedValue)) { | 279 if (!element()->isConformToInputMask(proposedValue)) { |
280 if (isConformToInputMask(element()->value())) | 280 if (isConformToInputMask(element()->value())) |
281 return element->value(); | 281 return element->value(); |
282 return String(); | 282 return String(); |
283 } | 283 } |
284 #endif | 284 #endif |
285 return limitLength(proposedValue.removeCharacters(isASCIILineBreak), HTMLInp
utElement::maximumLength); | 285 return limitLength(proposedValue.removeCharacters(isASCIILineBreak), HTMLInp
utElement::maximumLength); |
286 } | 286 } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 m_placeholder = HTMLDivElement::create(element()->document()); | 352 m_placeholder = HTMLDivElement::create(element()->document()); |
353 m_placeholder->setShadowPseudoId("-webkit-input-placeholder"); | 353 m_placeholder->setShadowPseudoId("-webkit-input-placeholder"); |
354 element()->shadowRoot()->insertBefore(m_placeholder, m_container ? m_con
tainer->nextSibling() : innerTextElement()->nextSibling(), ec); | 354 element()->shadowRoot()->insertBefore(m_placeholder, m_container ? m_con
tainer->nextSibling() : innerTextElement()->nextSibling(), ec); |
355 ASSERT(!ec); | 355 ASSERT(!ec); |
356 } | 356 } |
357 m_placeholder->setInnerText(placeholderText, ec); | 357 m_placeholder->setInnerText(placeholderText, ec); |
358 ASSERT(!ec); | 358 ASSERT(!ec); |
359 } | 359 } |
360 | 360 |
361 } // namespace WebCore | 361 } // namespace WebCore |
OLD | NEW |