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

Side by Side Diff: Source/core/editing/FrameSelection.cpp

Issue 16081007: Introduce toHTMLInputElement(Node*), and use it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/dom/Node.h ('k') | Source/core/editing/ReplaceSelectionCommand.cpp » ('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) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 // FIXME: Can we provide extentAffinity? 1674 // FIXME: Can we provide extentAffinity?
1675 VisiblePosition visibleStart(range->startPosition(), collapsed ? affinity : DOWNSTREAM); 1675 VisiblePosition visibleStart(range->startPosition(), collapsed ? affinity : DOWNSTREAM);
1676 VisiblePosition visibleEnd(range->endPosition(), SEL_DEFAULT_AFFINITY); 1676 VisiblePosition visibleEnd(range->endPosition(), SEL_DEFAULT_AFFINITY);
1677 setSelection(VisibleSelection(visibleStart, visibleEnd), ClearTypingStyle | (closeTyping ? CloseTyping : 0)); 1677 setSelection(VisibleSelection(visibleStart, visibleEnd), ClearTypingStyle | (closeTyping ? CloseTyping : 0));
1678 return true; 1678 return true;
1679 } 1679 }
1680 1680
1681 bool FrameSelection::isInPasswordField() const 1681 bool FrameSelection::isInPasswordField() const
1682 { 1682 {
1683 HTMLTextFormControlElement* textControl = enclosingTextFormControl(start()); 1683 HTMLTextFormControlElement* textControl = enclosingTextFormControl(start());
1684 return textControl && textControl->hasTagName(inputTag) && static_cast<HTMLI nputElement*>(textControl)->isPasswordField(); 1684 return textControl && textControl->hasTagName(inputTag) && toHTMLInputElemen t(textControl)->isPasswordField();
1685 } 1685 }
1686 1686
1687 void FrameSelection::focusedOrActiveStateChanged() 1687 void FrameSelection::focusedOrActiveStateChanged()
1688 { 1688 {
1689 bool activeAndFocused = isFocusedAndActive(); 1689 bool activeAndFocused = isFocusedAndActive();
1690 1690
1691 // Because RenderObject::selectionBackgroundColor() and 1691 // Because RenderObject::selectionBackgroundColor() and
1692 // RenderObject::selectionForegroundColor() check if the frame is active, 1692 // RenderObject::selectionForegroundColor() check if the frame is active,
1693 // we have to update places those colors were painted. 1693 // we have to update places those colors were painted.
1694 if (RenderView* view = m_frame->document()->renderView()) 1694 if (RenderView* view = m_frame->document()->renderView())
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
2068 sel.showTreeForThis(); 2068 sel.showTreeForThis();
2069 } 2069 }
2070 2070
2071 void showTree(const WebCore::FrameSelection* sel) 2071 void showTree(const WebCore::FrameSelection* sel)
2072 { 2072 {
2073 if (sel) 2073 if (sel)
2074 sel->showTreeForThis(); 2074 sel->showTreeForThis();
2075 } 2075 }
2076 2076
2077 #endif 2077 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/editing/ReplaceSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698