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

Side by Side Diff: sky/engine/core/frame/LocalDOMWindow.cpp

Issue 646273006: Get rid of ScrollView. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: merge to ToT Created 6 years, 1 month 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, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 ASSERT(init.frame() == m_frame); 234 ASSERT(init.frame() == m_frame);
235 235
236 clearDocument(); 236 clearDocument();
237 237
238 m_document = HTMLDocument::create(init); 238 m_document = HTMLDocument::create(init);
239 m_eventQueue = DOMWindowEventQueue::create(m_document.get()); 239 m_eventQueue = DOMWindowEventQueue::create(m_document.get());
240 m_document->attach(); 240 m_document->attach();
241 241
242 m_frame->script().updateDocument(); 242 m_frame->script().updateDocument();
243 m_document->updateViewportDescription(); 243 m_document->updateViewportDescription();
244
245 if (m_frame->page() && m_frame->view()) {
246 if (ScrollingCoordinator* scrollingCoordinator = m_frame->page()->scroll ingCoordinator()) {
247 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame- >view(), HorizontalScrollbar);
248 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame- >view(), VerticalScrollbar);
249 scrollingCoordinator->scrollableAreaScrollLayerDidChange(m_frame->vi ew());
250 }
251 }
252
253 return m_document; 244 return m_document;
254 } 245 }
255 246
256 EventQueue* LocalDOMWindow::eventQueue() const 247 EventQueue* LocalDOMWindow::eventQueue() const
257 { 248 {
258 return m_eventQueue.get(); 249 return m_eventQueue.get();
259 } 250 }
260 251
261 void LocalDOMWindow::enqueueWindowEvent(PassRefPtrWillBeRawPtr<Event> event) 252 void LocalDOMWindow::enqueueWindowEvent(PassRefPtrWillBeRawPtr<Event> event)
262 { 253 {
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 662
672 if (ScrollableArea::scrollBehaviorFromString(scrollBehaviorString, scrollBeh avior)) 663 if (ScrollableArea::scrollBehaviorFromString(scrollBehaviorString, scrollBeh avior))
673 return true; 664 return true;
674 665
675 exceptionState.throwTypeError("The ScrollBehavior provided is invalid."); 666 exceptionState.throwTypeError("The ScrollBehavior provided is invalid.");
676 return false; 667 return false;
677 } 668 }
678 669
679 void LocalDOMWindow::scrollBy(int x, int y, ScrollBehavior scrollBehavior) const 670 void LocalDOMWindow::scrollBy(int x, int y, ScrollBehavior scrollBehavior) const
680 { 671 {
681 document()->updateLayoutIgnorePendingStylesheets(); 672 // FIXME(sky): Remove
682
683 FrameView* view = m_frame->view();
684 if (!view)
685 return;
686
687 IntSize scaledOffset(x * m_frame->pageZoomFactor(), y * m_frame->pageZoomFac tor());
688 view->scrollBy(scaledOffset, scrollBehavior);
689 } 673 }
690 674
691 void LocalDOMWindow::scrollBy(int x, int y, const Dictionary& scrollOptions, Exc eptionState &exceptionState) const 675 void LocalDOMWindow::scrollBy(int x, int y, const Dictionary& scrollOptions, Exc eptionState &exceptionState) const
692 { 676 {
693 ScrollBehavior scrollBehavior = ScrollBehaviorAuto; 677 ScrollBehavior scrollBehavior = ScrollBehaviorAuto;
694 if (!scrollBehaviorFromScrollOptions(scrollOptions, scrollBehavior, exceptio nState)) 678 if (!scrollBehaviorFromScrollOptions(scrollOptions, scrollBehavior, exceptio nState))
695 return; 679 return;
696 scrollBy(x, y, scrollBehavior); 680 scrollBy(x, y, scrollBehavior);
697 } 681 }
698 682
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 visitor->trace(m_location); 902 visitor->trace(m_location);
919 visitor->trace(m_media); 903 visitor->trace(m_media);
920 visitor->trace(m_css); 904 visitor->trace(m_css);
921 visitor->trace(m_eventQueue); 905 visitor->trace(m_eventQueue);
922 WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor); 906 WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor);
923 EventTargetWithInlineData::trace(visitor); 907 EventTargetWithInlineData::trace(visitor);
924 LifecycleContext<LocalDOMWindow>::trace(visitor); 908 LifecycleContext<LocalDOMWindow>::trace(visitor);
925 } 909 }
926 910
927 } // namespace blink 911 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698