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

Side by Side Diff: Source/core/editing/EditorCommand.cpp

Issue 16982005: Allow objects without scrollbars to be scrollable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed ScrollbarGroup pageStep Created 7 years, 4 months 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
« no previous file with comments | « no previous file | Source/core/page/FrameView.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 return 0; 252 return 0;
253 RenderObject* renderer = focusedElement->renderer(); 253 RenderObject* renderer = focusedElement->renderer();
254 if (!renderer || !renderer->isBox()) 254 if (!renderer || !renderer->isBox())
255 return 0; 255 return 0;
256 RenderStyle* style = renderer->style(); 256 RenderStyle* style = renderer->style();
257 if (!style) 257 if (!style)
258 return 0; 258 return 0;
259 if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || focuse dElement->rendererIsEditable())) 259 if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || focuse dElement->rendererIsEditable()))
260 return 0; 260 return 0;
261 int height = std::min<int>(toRenderBox(renderer)->clientHeight(), frame->vie w()->visibleHeight()); 261 int height = std::min<int>(toRenderBox(renderer)->clientHeight(), frame->vie w()->visibleHeight());
262 return static_cast<unsigned>(max(max<int>(height * Scrollbar::minFractionToS tepWhenPaging(), height - Scrollbar::maxOverlapBetweenPages()), 1)); 262 return static_cast<unsigned>(max(max<int>(height * ScrollableArea::minFracti onToStepWhenPaging(), height - ScrollableArea::maxOverlapBetweenPages()), 1));
263 } 263 }
264 264
265 static RefPtr<Range> unionDOMRanges(Range* a, Range* b) 265 static RefPtr<Range> unionDOMRanges(Range* a, Range* b)
266 { 266 {
267 Range* start = a->compareBoundaryPoints(Range::START_TO_START, b, ASSERT_NO_ EXCEPTION) <= 0 ? a : b; 267 Range* start = a->compareBoundaryPoints(Range::START_TO_START, b, ASSERT_NO_ EXCEPTION) <= 0 ? a : b;
268 Range* end = a->compareBoundaryPoints(Range::END_TO_END, b, ASSERT_NO_EXCEPT ION) <= 0 ? b : a; 268 Range* end = a->compareBoundaryPoints(Range::END_TO_END, b, ASSERT_NO_EXCEPT ION) <= 0 ? b : a;
269 269
270 return Range::create(a->ownerDocument(), start->startContainer(), start->sta rtOffset(), end->endContainer(), end->endOffset()); 270 return Range::create(a->ownerDocument(), start->startContainer(), start->sta rtOffset(), end->endContainer(), end->endOffset());
271 } 271 }
272 272
(...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1741 return m_command->state(m_frame.get(), triggeringEvent) == TrueTriState ? "true" : "false"; 1741 return m_command->state(m_frame.get(), triggeringEvent) == TrueTriState ? "true" : "false";
1742 return m_command->value(m_frame.get(), triggeringEvent); 1742 return m_command->value(m_frame.get(), triggeringEvent);
1743 } 1743 }
1744 1744
1745 bool Editor::Command::isTextInsertion() const 1745 bool Editor::Command::isTextInsertion() const
1746 { 1746 {
1747 return m_command && m_command->isTextInsertion; 1747 return m_command && m_command->isTextInsertion;
1748 } 1748 }
1749 1749
1750 } // namespace WebCore 1750 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/page/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698