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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp

Issue 2569013006: Changed EOverflow to an enum class and renamed its members (Closed)
Patch Set: Rebase Created 4 years 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
OLDNEW
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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 Element* focusedElement = frame.document()->focusedElement(); 470 Element* focusedElement = frame.document()->focusedElement();
471 if (!focusedElement) 471 if (!focusedElement)
472 return 0; 472 return 0;
473 LayoutObject* layoutObject = focusedElement->layoutObject(); 473 LayoutObject* layoutObject = focusedElement->layoutObject();
474 if (!layoutObject || !layoutObject->isBox()) 474 if (!layoutObject || !layoutObject->isBox())
475 return 0; 475 return 0;
476 LayoutBox& layoutBox = toLayoutBox(*layoutObject); 476 LayoutBox& layoutBox = toLayoutBox(*layoutObject);
477 const ComputedStyle* style = layoutBox.style(); 477 const ComputedStyle* style = layoutBox.style();
478 if (!style) 478 if (!style)
479 return 0; 479 return 0;
480 if (!(style->overflowY() == OverflowScroll || 480 if (!(style->overflowY() == EOverflow::Scroll ||
481 style->overflowY() == OverflowAuto || 481 style->overflowY() == EOverflow::Auto ||
482 hasEditableStyle(*focusedElement))) 482 hasEditableStyle(*focusedElement)))
483 return 0; 483 return 0;
484 int height = std::min<int>(layoutBox.clientHeight().toInt(), 484 int height = std::min<int>(layoutBox.clientHeight().toInt(),
485 frame.view()->visibleHeight()); 485 frame.view()->visibleHeight());
486 return static_cast<unsigned>( 486 return static_cast<unsigned>(
487 max(max<int>(height * ScrollableArea::minFractionToStepWhenPaging(), 487 max(max<int>(height * ScrollableArea::minFractionToStepWhenPaging(),
488 height - ScrollableArea::maxOverlapBetweenPages()), 488 height - ScrollableArea::maxOverlapBetweenPages()),
489 1)); 489 1));
490 } 490 }
491 491
(...skipping 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after
2735 *m_frame, DirectionBackward, WordGranularity); 2735 *m_frame, DirectionBackward, WordGranularity);
2736 case WebEditingCommandType::DeleteWordForward: 2736 case WebEditingCommandType::DeleteWordForward:
2737 return RangesFromCurrentSelectionOrExtendCaret(*m_frame, DirectionForward, 2737 return RangesFromCurrentSelectionOrExtendCaret(*m_frame, DirectionForward,
2738 WordGranularity); 2738 WordGranularity);
2739 default: 2739 default:
2740 return nullptr; 2740 return nullptr;
2741 } 2741 }
2742 } 2742 }
2743 2743
2744 } // namespace blink 2744 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698