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

Side by Side Diff: Source/core/page/Frame.cpp

Issue 23819019: Refactor fixed layout mode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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) 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 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 if (RefPtr<Range> nextCharacterRange = makeRange(position, next)) { 453 if (RefPtr<Range> nextCharacterRange = makeRange(position, next)) {
454 LayoutRect rect = editor().firstRectForRange(nextCharacterRange.get()); 454 LayoutRect rect = editor().firstRectForRange(nextCharacterRange.get());
455 if (rect.contains(framePoint)) 455 if (rect.contains(framePoint))
456 return nextCharacterRange.release(); 456 return nextCharacterRange.release();
457 } 457 }
458 458
459 return 0; 459 return 0;
460 } 460 }
461 461
462 void Frame::createView(const IntSize& viewportSize, const StyleColor& background Color, bool transparent, 462 void Frame::createView(const IntSize& viewportSize, const StyleColor& background Color, bool transparent,
463 const IntSize& fixedLayoutSize, bool useFixedLayout, ScrollbarMode horizonta lScrollbarMode, bool horizontalLock, 463 ScrollbarMode horizontalScrollbarMode, bool horizontalLock,
464 ScrollbarMode verticalScrollbarMode, bool verticalLock) 464 ScrollbarMode verticalScrollbarMode, bool verticalLock)
465 { 465 {
466 ASSERT(this); 466 ASSERT(this);
467 ASSERT(m_page); 467 ASSERT(m_page);
468 468
469 bool isMainFrame = this == m_page->mainFrame(); 469 bool isMainFrame = this == m_page->mainFrame();
470 470
471 if (isMainFrame && view()) 471 if (isMainFrame && view())
472 view()->setParentVisible(false); 472 view()->setParentVisible(false);
473 473
474 setView(0); 474 setView(0);
475 475
476 RefPtr<FrameView> frameView; 476 RefPtr<FrameView> frameView;
477 if (isMainFrame) { 477 if (isMainFrame)
478 frameView = FrameView::create(this, viewportSize); 478 frameView = FrameView::create(this, viewportSize);
479 frameView->setFixedLayoutSize(fixedLayoutSize); 479 else
480 frameView->setUseFixedLayout(useFixedLayout);
481 } else
482 frameView = FrameView::create(this); 480 frameView = FrameView::create(this);
483 481
484 frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode, horizontalLock, verticalLock); 482 frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode, horizontalLock, verticalLock);
485 483
486 setView(frameView); 484 setView(frameView);
487 485
488 if (backgroundColor.isValid()) 486 if (backgroundColor.isValid())
489 frameView->updateBackgroundRecursively(backgroundColor.color(), transpar ent); 487 frameView->updateBackgroundRecursively(backgroundColor.color(), transpar ent);
490 488
491 if (isMainFrame) 489 if (isMainFrame)
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 if (!m_page) 706 if (!m_page)
709 return 0; 707 return 0;
710 708
711 double ratio = m_page->deviceScaleFactor(); 709 double ratio = m_page->deviceScaleFactor();
712 if (RuntimeEnabledFeatures::devicePixelRatioIncludesZoomEnabled()) 710 if (RuntimeEnabledFeatures::devicePixelRatioIncludesZoomEnabled())
713 ratio *= pageZoomFactor(); 711 ratio *= pageZoomFactor();
714 return ratio; 712 return ratio;
715 } 713 }
716 714
717 } // namespace WebCore 715 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698