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

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

Issue 878303002: Remove more scrolling code from Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/engine/core/frame/FrameView.h ('k') | sky/engine/core/frame/LocalDOMWindow.cpp » ('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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 RenderLayer* layer; 320 RenderLayer* layer;
321 { 321 {
322 TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, false); 322 TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, false);
323 323
324 m_nestedLayoutCount++; 324 m_nestedLayoutCount++;
325 325
326 if (!inSubtreeLayout) { 326 if (!inSubtreeLayout) {
327 if (m_firstLayout) { 327 if (m_firstLayout) {
328 m_firstLayout = false; 328 m_firstLayout = false;
329 m_firstLayoutCallbackPending = true; 329 m_firstLayoutCallbackPending = true;
330 m_lastViewportSize = layoutSize(IncludeScrollbars); 330 m_lastViewportSize = layoutSize();
331 } 331 }
332 332
333 m_size = LayoutSize(layoutSize().width(), layoutSize().height()); 333 m_size = LayoutSize(layoutSize().width(), layoutSize().height());
334 } 334 }
335 335
336 layer = rootForThisLayout->enclosingLayer(); 336 layer = rootForThisLayout->enclosingLayer();
337 337
338 performLayout(rootForThisLayout, inSubtreeLayout); 338 performLayout(rootForThisLayout, inSubtreeLayout);
339 339
340 m_layoutSubtreeRoot = 0; 340 m_layoutSubtreeRoot = 0;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 return m_mediaType; 381 return m_mediaType;
382 } 382 }
383 383
384 bool FrameView::shouldSetCursor() const 384 bool FrameView::shouldSetCursor() const
385 { 385 {
386 Page* page = frame().page(); 386 Page* page = frame().page();
387 return page && page->visibilityState() != PageVisibilityStateHidden && page- >focusController().isActive() && page->settings().deviceSupportsMouse(); 387 return page && page->visibilityState() != PageVisibilityStateHidden && page- >focusController().isActive() && page->settings().deviceSupportsMouse();
388 } 388 }
389 389
390 // FIXME(sky): remove 390 // FIXME(sky): remove
391 IntSize FrameView::layoutSize(IncludeScrollbarsInRect) const 391 IntSize FrameView::layoutSize() const
392 { 392 {
393 return m_layoutSize; 393 return m_layoutSize;
394 } 394 }
395 395
396 void FrameView::setLayoutSize(const IntSize& size) 396 void FrameView::setLayoutSize(const IntSize& size)
397 { 397 {
398 ASSERT(!layoutSizeFixedToFrameSize()); 398 ASSERT(!layoutSizeFixedToFrameSize());
399 399
400 setLayoutSizeInternal(size); 400 setLayoutSizeInternal(size);
401 } 401 }
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 m_firstLayoutCallbackPending = false; 570 m_firstLayoutCallbackPending = false;
571 } 571 }
572 572
573 FontFaceSet::didLayout(*m_frame->document()); 573 FontFaceSet::didLayout(*m_frame->document());
574 574
575 sendResizeEventIfNeeded(); 575 sendResizeEventIfNeeded();
576 } 576 }
577 577
578 bool FrameView::wasViewportResized() 578 bool FrameView::wasViewportResized()
579 { 579 {
580 return layoutSize(IncludeScrollbars) != m_lastViewportSize; 580 return layoutSize() != m_lastViewportSize;
581 } 581 }
582 582
583 void FrameView::sendResizeEventIfNeeded() 583 void FrameView::sendResizeEventIfNeeded()
584 { 584 {
585 if (!wasViewportResized()) 585 if (!wasViewportResized())
586 return; 586 return;
587 587
588 m_lastViewportSize = layoutSize(IncludeScrollbars); 588 m_lastViewportSize = layoutSize();
589 m_frame->document()->enqueueResizeEvent(); 589 m_frame->document()->enqueueResizeEvent();
590 } 590 }
591 591
592 void FrameView::postLayoutTimerFired(Timer<FrameView>*) 592 void FrameView::postLayoutTimerFired(Timer<FrameView>*)
593 { 593 {
594 performPostLayoutTasks(); 594 performPostLayoutTasks();
595 } 595 }
596 596
597 IntRect FrameView::windowClipRect(IncludeScrollbarsInRect scrollbarInclusion) co nst 597 IntRect FrameView::windowClipRect() const
598 { 598 {
599 ASSERT(m_frame->view() == this); 599 ASSERT(m_frame->view() == this);
600 600
601 if (paintsEntireContents()) 601 if (paintsEntireContents())
602 return IntRect(IntPoint(), size()); 602 return IntRect(IntPoint(), size());
603 603
604 // Set our clip rect to be our contents. 604 // Set our clip rect to be our contents.
605 IntRect clipRect = contentsToWindow(visibleContentRect(scrollbarInclusion)); 605 IntRect clipRect = contentsToWindow(visibleContentRect());
606 return clipRect; 606 return clipRect;
607 } 607 }
608 608
609 bool FrameView::isActive() const 609 bool FrameView::isActive() const
610 { 610 {
611 Page* page = frame().page(); 611 Page* page = frame().page();
612 return page && page->focusController().isActive(); 612 return page && page->focusController().isActive();
613 } 613 }
614 614
615 void FrameView::setVisibleContentScaleFactor(float visibleContentScaleFactor) 615 void FrameView::setVisibleContentScaleFactor(float visibleContentScaleFactor)
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 totalObjects = 0; 847 totalObjects = 0;
848 848
849 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) { 849 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) {
850 ++totalObjects; 850 ++totalObjects;
851 if (o->needsLayout()) 851 if (o->needsLayout())
852 ++needsLayoutObjects; 852 ++needsLayoutObjects;
853 } 853 }
854 } 854 }
855 855
856 } // namespace blink 856 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/frame/FrameView.h ('k') | sky/engine/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698