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

Side by Side Diff: third_party/WebKit/Source/core/page/SpatialNavigation.cpp

Issue 2900513002: Move CalculateScrollbarModes from FrameView to LayoutView. (Closed)
Patch Set: Created 3 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
3 * Copyright (C) 2009 Antonio Gomes <tonikitoo@webkit.org> 3 * Copyright (C) 2009 Antonio Gomes <tonikitoo@webkit.org>
4 * 4 *
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 19 matching lines...) Expand all
30 30
31 #include "core/HTMLNames.h" 31 #include "core/HTMLNames.h"
32 #include "core/dom/NodeTraversal.h" 32 #include "core/dom/NodeTraversal.h"
33 #include "core/frame/FrameView.h" 33 #include "core/frame/FrameView.h"
34 #include "core/frame/LocalFrame.h" 34 #include "core/frame/LocalFrame.h"
35 #include "core/frame/Settings.h" 35 #include "core/frame/Settings.h"
36 #include "core/html/HTMLAreaElement.h" 36 #include "core/html/HTMLAreaElement.h"
37 #include "core/html/HTMLFrameOwnerElement.h" 37 #include "core/html/HTMLFrameOwnerElement.h"
38 #include "core/html/HTMLImageElement.h" 38 #include "core/html/HTMLImageElement.h"
39 #include "core/layout/LayoutBox.h" 39 #include "core/layout/LayoutBox.h"
40 #include "core/layout/LayoutView.h"
40 #include "core/page/FrameTree.h" 41 #include "core/page/FrameTree.h"
41 #include "core/page/Page.h" 42 #include "core/page/Page.h"
42 #include "platform/geometry/IntRect.h" 43 #include "platform/geometry/IntRect.h"
43 44
44 namespace blink { 45 namespace blink {
45 46
46 using namespace HTMLNames; 47 using namespace HTMLNames;
47 48
48 static void DeflateIfOverlapped(LayoutRect&, LayoutRect&); 49 static void DeflateIfOverlapped(LayoutRect&, LayoutRect&);
49 static LayoutRect RectToAbsoluteCoordinates(LocalFrame* initial_frame, 50 static LayoutRect RectToAbsoluteCoordinates(LocalFrame* initial_frame,
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 container->GetLayoutBox()->ScrollHeight()); 353 container->GetLayoutBox()->ScrollHeight());
353 default: 354 default:
354 NOTREACHED(); 355 NOTREACHED();
355 return false; 356 return false;
356 } 357 }
357 } 358 }
358 359
359 bool CanScrollInDirection(const LocalFrame* frame, WebFocusType type) { 360 bool CanScrollInDirection(const LocalFrame* frame, WebFocusType type) {
360 if (!frame->View()) 361 if (!frame->View())
361 return false; 362 return false;
363 LayoutView* layoutView = frame->ContentLayoutObject();
364 if (!layoutView)
365 return false;
362 ScrollbarMode vertical_mode; 366 ScrollbarMode vertical_mode;
363 ScrollbarMode horizontal_mode; 367 ScrollbarMode horizontal_mode;
364 frame->View()->CalculateScrollbarModes(horizontal_mode, vertical_mode); 368 layoutView->CalculateScrollbarModes(horizontal_mode, vertical_mode);
365 if ((type == kWebFocusTypeLeft || type == kWebFocusTypeRight) && 369 if ((type == kWebFocusTypeLeft || type == kWebFocusTypeRight) &&
366 kScrollbarAlwaysOff == horizontal_mode) 370 kScrollbarAlwaysOff == horizontal_mode)
367 return false; 371 return false;
368 if ((type == kWebFocusTypeUp || type == kWebFocusTypeDown) && 372 if ((type == kWebFocusTypeUp || type == kWebFocusTypeDown) &&
369 kScrollbarAlwaysOff == vertical_mode) 373 kScrollbarAlwaysOff == vertical_mode)
370 return false; 374 return false;
371 LayoutSize size(frame->View()->ContentsSize()); 375 LayoutSize size(frame->View()->ContentsSize());
372 LayoutSize offset(frame->View()->ScrollOffsetInt()); 376 LayoutSize offset(frame->View()->ScrollOffsetInt());
373 LayoutRect rect(frame->View()->VisibleContentRect(kIncludeScrollbars)); 377 LayoutRect rect(frame->View()->VisibleContentRect(kIncludeScrollbars));
374 378
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 return rect; 693 return rect;
690 } 694 }
691 695
692 HTMLFrameOwnerElement* FrameOwnerElement(FocusCandidate& candidate) { 696 HTMLFrameOwnerElement* FrameOwnerElement(FocusCandidate& candidate) {
693 return candidate.IsFrameOwnerElement() 697 return candidate.IsFrameOwnerElement()
694 ? ToHTMLFrameOwnerElement(candidate.visible_node) 698 ? ToHTMLFrameOwnerElement(candidate.visible_node)
695 : nullptr; 699 : nullptr;
696 }; 700 };
697 701
698 } // namespace blink 702 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698