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

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

Issue 16194013: Mouse press should focus on any types of form controls. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLTextAreaElement.h ('k') | Source/core/html/InputType.h » ('j') | 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 { 234 {
235 return true; 235 return true;
236 } 236 }
237 237
238 bool HTMLTextAreaElement::isKeyboardFocusable(KeyboardEvent*) const 238 bool HTMLTextAreaElement::isKeyboardFocusable(KeyboardEvent*) const
239 { 239 {
240 // If a given text area can be focused at all, then it will always be keyboa rd focusable. 240 // If a given text area can be focused at all, then it will always be keyboa rd focusable.
241 return isFocusable(); 241 return isFocusable();
242 } 242 }
243 243
244 bool HTMLTextAreaElement::isMouseFocusable() const 244 bool HTMLTextAreaElement::shouldShowFocusRingOnMouseFocus() const
245 { 245 {
246 return isFocusable(); 246 return true;
247 } 247 }
248 248
249 void HTMLTextAreaElement::updateFocusAppearance(bool restorePreviousSelection) 249 void HTMLTextAreaElement::updateFocusAppearance(bool restorePreviousSelection)
250 { 250 {
251 if (!restorePreviousSelection || !hasCachedSelection()) { 251 if (!restorePreviousSelection || !hasCachedSelection()) {
252 // If this is the first focus, set a caret at the beginning of the text. 252 // If this is the first focus, set a caret at the beginning of the text.
253 // This matches some browsers' behavior; see bug 11746 Comment #15. 253 // This matches some browsers' behavior; see bug 11746 Comment #15.
254 // http://bugs.webkit.org/show_bug.cgi?id=11746#c15 254 // http://bugs.webkit.org/show_bug.cgi?id=11746#c15
255 setSelectionRange(0, 0); 255 setSelectionRange(0, 0);
256 } else 256 } else
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 RefPtr<HTMLDivElement> placeholder = HTMLDivElement::create(document()); 549 RefPtr<HTMLDivElement> placeholder = HTMLDivElement::create(document());
550 m_placeholder = placeholder.get(); 550 m_placeholder = placeholder.get();
551 m_placeholder->setPseudo(AtomicString("-webkit-input-placeholder", Atomi cString::ConstructFromLiteral)); 551 m_placeholder->setPseudo(AtomicString("-webkit-input-placeholder", Atomi cString::ConstructFromLiteral));
552 userAgentShadowRoot()->insertBefore(m_placeholder, innerTextElement()->n extSibling(), ASSERT_NO_EXCEPTION); 552 userAgentShadowRoot()->insertBefore(m_placeholder, innerTextElement()->n extSibling(), ASSERT_NO_EXCEPTION);
553 } 553 }
554 m_placeholder->setInnerText(placeholderText, ASSERT_NO_EXCEPTION); 554 m_placeholder->setInnerText(placeholderText, ASSERT_NO_EXCEPTION);
555 fixPlaceholderRenderer(m_placeholder, innerTextElement()); 555 fixPlaceholderRenderer(m_placeholder, innerTextElement());
556 } 556 }
557 557
558 } 558 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTextAreaElement.h ('k') | Source/core/html/InputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698