Chromium Code Reviews| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 #include "core/rendering/HitTestResult.h" | 65 #include "core/rendering/HitTestResult.h" |
| 66 #include "core/rendering/InlineTextBox.h" | 66 #include "core/rendering/InlineTextBox.h" |
| 67 #include "core/rendering/RenderLayer.h" | 67 #include "core/rendering/RenderLayer.h" |
| 68 #include "core/rendering/RenderPart.h" | 68 #include "core/rendering/RenderPart.h" |
| 69 #include "core/rendering/RenderText.h" | 69 #include "core/rendering/RenderText.h" |
| 70 #include "core/rendering/RenderTheme.h" | 70 #include "core/rendering/RenderTheme.h" |
| 71 #include "core/rendering/RenderView.h" | 71 #include "core/rendering/RenderView.h" |
| 72 #include "platform/SecureTextInput.h" | 72 #include "platform/SecureTextInput.h" |
| 73 #include "platform/geometry/FloatQuad.h" | 73 #include "platform/geometry/FloatQuad.h" |
| 74 #include "platform/graphics/GraphicsContext.h" | 74 #include "platform/graphics/GraphicsContext.h" |
| 75 #include "platform/text/UnicodeUtilities.h" | |
| 75 #include "wtf/text/CString.h" | 76 #include "wtf/text/CString.h" |
| 76 #include <stdio.h> | 77 #include <stdio.h> |
| 77 | 78 |
| 78 #define EDIT_DEBUG 0 | 79 #define EDIT_DEBUG 0 |
| 79 | 80 |
| 80 namespace blink { | 81 namespace blink { |
| 81 | 82 |
| 82 using namespace HTMLNames; | 83 using namespace HTMLNames; |
| 83 | 84 |
| 84 static inline LayoutUnit NoXPosForVerticalArrowNavigation() | 85 static inline LayoutUnit NoXPosForVerticalArrowNavigation() |
| (...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1923 } | 1924 } |
| 1924 | 1925 |
| 1925 void FrameSelection::scheduleVisualUpdate() const | 1926 void FrameSelection::scheduleVisualUpdate() const |
| 1926 { | 1927 { |
| 1927 if (!m_frame) | 1928 if (!m_frame) |
| 1928 return; | 1929 return; |
| 1929 if (Page* page = m_frame->page()) | 1930 if (Page* page = m_frame->page()) |
| 1930 page->animator().scheduleVisualUpdate(); | 1931 page->animator().scheduleVisualUpdate(); |
| 1931 } | 1932 } |
| 1932 | 1933 |
| 1934 bool FrameSelection::selectWordAroundPosition(const VisiblePosition& position) | |
| 1935 { | |
| 1936 EWordSide wordSideList[2] = { RightWordIfOnBoundary, LeftWordIfOnBoundary }; | |
|
Yuta Kitamura
2014/11/14 05:14:56
static const
yoichio
2014/11/14 06:19:58
Done.
| |
| 1937 for (EWordSide wordSide : wordSideList) { | |
| 1938 VisiblePosition start = startOfWord(position, wordSide); | |
| 1939 VisiblePosition end = endOfWord(position, wordSide); | |
| 1940 String text = plainText(start.deepEquivalent(), end.deepEquivalent()); | |
| 1941 if (!text.isEmpty() && !isSeparator(text.characterStartingAt(0))) { | |
| 1942 setSelection(VisibleSelection(start, end), WordGranularity); | |
| 1943 return true; | |
| 1944 } | |
| 1945 } | |
| 1946 | |
| 1947 return false; | |
| 1948 } | |
| 1949 | |
| 1933 } | 1950 } |
| 1934 | 1951 |
| 1935 #ifndef NDEBUG | 1952 #ifndef NDEBUG |
| 1936 | 1953 |
| 1937 void showTree(const blink::FrameSelection& sel) | 1954 void showTree(const blink::FrameSelection& sel) |
| 1938 { | 1955 { |
| 1939 sel.showTreeForThis(); | 1956 sel.showTreeForThis(); |
| 1940 } | 1957 } |
| 1941 | 1958 |
| 1942 void showTree(const blink::FrameSelection* sel) | 1959 void showTree(const blink::FrameSelection* sel) |
| 1943 { | 1960 { |
| 1944 if (sel) | 1961 if (sel) |
| 1945 sel->showTreeForThis(); | 1962 sel->showTreeForThis(); |
| 1946 } | 1963 } |
| 1947 | 1964 |
| 1948 #endif | 1965 #endif |
| OLD | NEW |