OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2009 Igalia S.L. | 4 * Copyright (C) 2009 Igalia S.L. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 return 0; | 97 return 0; |
98 RenderObject* renderer = focusedElement->renderer(); | 98 RenderObject* renderer = focusedElement->renderer(); |
99 if (!renderer || !renderer->isBox()) | 99 if (!renderer || !renderer->isBox()) |
100 return 0; | 100 return 0; |
101 RenderBox& renderBox = toRenderBox(*renderer); | 101 RenderBox& renderBox = toRenderBox(*renderer); |
102 RenderStyle* style = renderBox.style(); | 102 RenderStyle* style = renderBox.style(); |
103 if (!style) | 103 if (!style) |
104 return 0; | 104 return 0; |
105 if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || focuse
dElement->hasEditableStyle())) | 105 if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || focuse
dElement->hasEditableStyle())) |
106 return 0; | 106 return 0; |
107 int height = std::min<int>(renderBox.clientHeight(), frame.view()->visibleHe
ight()); | 107 int height = std::min<int>(renderBox.clientHeight(), |
| 108 frame.view()->height()); |
108 return static_cast<unsigned>(max(max<int>(height * ScrollableArea::minFracti
onToStepWhenPaging(), height - ScrollableArea::maxOverlapBetweenPages()), 1)); | 109 return static_cast<unsigned>(max(max<int>(height * ScrollableArea::minFracti
onToStepWhenPaging(), height - ScrollableArea::maxOverlapBetweenPages()), 1)); |
109 } | 110 } |
110 | 111 |
111 static bool executeCopy(LocalFrame& frame, Event*, EditorCommandSource, const St
ring&) | 112 static bool executeCopy(LocalFrame& frame, Event*, EditorCommandSource, const St
ring&) |
112 { | 113 { |
113 frame.editor().copy(); | 114 frame.editor().copy(); |
114 return true; | 115 return true; |
115 } | 116 } |
116 | 117 |
117 static bool executeCut(LocalFrame& frame, Event*, EditorCommandSource, const Str
ing&) | 118 static bool executeCut(LocalFrame& frame, Event*, EditorCommandSource, const Str
ing&) |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 { | 667 { |
667 return m_command && m_command->isTextInsertion; | 668 return m_command && m_command->isTextInsertion; |
668 } | 669 } |
669 | 670 |
670 int Editor::Command::idForHistogram() const | 671 int Editor::Command::idForHistogram() const |
671 { | 672 { |
672 return isSupported() ? m_command->idForUserMetrics : 0; | 673 return isSupported() ? m_command->idForUserMetrics : 0; |
673 } | 674 } |
674 | 675 |
675 } // namespace blink | 676 } // namespace blink |
OLD | NEW |