OLD | NEW |
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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 { | 235 { |
236 return true; | 236 return true; |
237 } | 237 } |
238 | 238 |
239 bool HTMLTextAreaElement::isKeyboardFocusable(KeyboardEvent*) const | 239 bool HTMLTextAreaElement::isKeyboardFocusable(KeyboardEvent*) const |
240 { | 240 { |
241 // If a given text area can be focused at all, then it will always be keyboa
rd focusable. | 241 // If a given text area can be focused at all, then it will always be keyboa
rd focusable. |
242 return isFocusable(); | 242 return isFocusable(); |
243 } | 243 } |
244 | 244 |
245 bool HTMLTextAreaElement::isMouseFocusable() const | |
246 { | |
247 return isFocusable(); | |
248 } | |
249 | |
250 void HTMLTextAreaElement::updateFocusAppearance(bool restorePreviousSelection) | 245 void HTMLTextAreaElement::updateFocusAppearance(bool restorePreviousSelection) |
251 { | 246 { |
252 if (!restorePreviousSelection || !hasCachedSelection()) { | 247 if (!restorePreviousSelection || !hasCachedSelection()) { |
253 // If this is the first focus, set a caret at the beginning of the text.
| 248 // If this is the first focus, set a caret at the beginning of the text.
|
254 // This matches some browsers' behavior; see bug 11746 Comment #15. | 249 // This matches some browsers' behavior; see bug 11746 Comment #15. |
255 // http://bugs.webkit.org/show_bug.cgi?id=11746#c15 | 250 // http://bugs.webkit.org/show_bug.cgi?id=11746#c15 |
256 setSelectionRange(0, 0); | 251 setSelectionRange(0, 0); |
257 } else | 252 } else |
258 restoreCachedSelection(); | 253 restoreCachedSelection(); |
259 | 254 |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 RefPtr<HTMLDivElement> placeholder = HTMLDivElement::create(document()); | 547 RefPtr<HTMLDivElement> placeholder = HTMLDivElement::create(document()); |
553 m_placeholder = placeholder.get(); | 548 m_placeholder = placeholder.get(); |
554 m_placeholder->setPseudo(AtomicString("-webkit-input-placeholder", Atomi
cString::ConstructFromLiteral)); | 549 m_placeholder->setPseudo(AtomicString("-webkit-input-placeholder", Atomi
cString::ConstructFromLiteral)); |
555 userAgentShadowRoot()->insertBefore(m_placeholder, innerTextElement()->n
extSibling(), ASSERT_NO_EXCEPTION); | 550 userAgentShadowRoot()->insertBefore(m_placeholder, innerTextElement()->n
extSibling(), ASSERT_NO_EXCEPTION); |
556 } | 551 } |
557 m_placeholder->setInnerText(placeholderText, ASSERT_NO_EXCEPTION); | 552 m_placeholder->setInnerText(placeholderText, ASSERT_NO_EXCEPTION); |
558 fixPlaceholderRenderer(m_placeholder, innerTextElement()); | 553 fixPlaceholderRenderer(m_placeholder, innerTextElement()); |
559 } | 554 } |
560 | 555 |
561 } | 556 } |
OLD | NEW |