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