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 10 matching lines...) Expand all Loading... |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 #include "core/editing/FrameSelection.h" | 27 #include "core/editing/FrameSelection.h" |
28 | 28 |
29 #include "bindings/core/v8/ExceptionState.h" | 29 #include "bindings/core/v8/ExceptionState.h" |
30 #include "core/HTMLNames.h" | 30 #include "core/HTMLNames.h" |
| 31 #include "core/InputTypeNames.h" |
31 #include "core/accessibility/AXObjectCache.h" | 32 #include "core/accessibility/AXObjectCache.h" |
32 #include "core/css/StylePropertySet.h" | 33 #include "core/css/StylePropertySet.h" |
33 #include "core/dom/CharacterData.h" | 34 #include "core/dom/CharacterData.h" |
34 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
35 #include "core/dom/Element.h" | 36 #include "core/dom/Element.h" |
36 #include "core/dom/ElementTraversal.h" | 37 #include "core/dom/ElementTraversal.h" |
37 #include "core/dom/NodeTraversal.h" | 38 #include "core/dom/NodeTraversal.h" |
38 #include "core/dom/Text.h" | 39 #include "core/dom/Text.h" |
39 #include "core/editing/Editor.h" | 40 #include "core/editing/Editor.h" |
40 #include "core/editing/InputMethodController.h" | 41 #include "core/editing/InputMethodController.h" |
(...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1425 PassRefPtrWillBeRawPtr<Range> FrameSelection::firstRange() const | 1426 PassRefPtrWillBeRawPtr<Range> FrameSelection::firstRange() const |
1426 { | 1427 { |
1427 if (m_logicalRange) | 1428 if (m_logicalRange) |
1428 return m_logicalRange->cloneRange(); | 1429 return m_logicalRange->cloneRange(); |
1429 return m_selection.firstRange(); | 1430 return m_selection.firstRange(); |
1430 } | 1431 } |
1431 | 1432 |
1432 bool FrameSelection::isInPasswordField() const | 1433 bool FrameSelection::isInPasswordField() const |
1433 { | 1434 { |
1434 HTMLTextFormControlElement* textControl = enclosingTextFormControl(start()); | 1435 HTMLTextFormControlElement* textControl = enclosingTextFormControl(start()); |
1435 return isHTMLInputElement(textControl) && toHTMLInputElement(textControl)->i
sPasswordField(); | 1436 return isHTMLInputElement(textControl) && toHTMLInputElement(textControl)->t
ype() == InputTypeNames::password; |
1436 } | 1437 } |
1437 | 1438 |
1438 void FrameSelection::notifyAccessibilityForSelectionChange() | 1439 void FrameSelection::notifyAccessibilityForSelectionChange() |
1439 { | 1440 { |
1440 if (m_selection.start().isNotNull() && m_selection.end().isNotNull()) { | 1441 if (m_selection.start().isNotNull() && m_selection.end().isNotNull()) { |
1441 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) | 1442 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) |
1442 cache->selectionChanged(m_selection.start().containerNode()); | 1443 cache->selectionChanged(m_selection.start().containerNode()); |
1443 } | 1444 } |
1444 } | 1445 } |
1445 | 1446 |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1924 sel.showTreeForThis(); | 1925 sel.showTreeForThis(); |
1925 } | 1926 } |
1926 | 1927 |
1927 void showTree(const blink::FrameSelection* sel) | 1928 void showTree(const blink::FrameSelection* sel) |
1928 { | 1929 { |
1929 if (sel) | 1930 if (sel) |
1930 sel->showTreeForThis(); | 1931 sel->showTreeForThis(); |
1931 } | 1932 } |
1932 | 1933 |
1933 #endif | 1934 #endif |
OLD | NEW |