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

Side by Side Diff: Source/core/frame/FrameView.cpp

Issue 59573002: Add Frame::isMainFrame and deploy it (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/Frame.cpp ('k') | Source/core/html/ImageDocument.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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 578
579 if (o->isSVGRoot()) { 579 if (o->isSVGRoot()) {
580 // overflow is ignored in stand-alone SVG documents. 580 // overflow is ignored in stand-alone SVG documents.
581 if (!toRenderSVGRoot(o)->isEmbeddedThroughFrameContainingSVGDocument()) 581 if (!toRenderSVGRoot(o)->isEmbeddedThroughFrameContainingSVGDocument())
582 return; 582 return;
583 overflowX = OHIDDEN; 583 overflowX = OHIDDEN;
584 overflowY = OHIDDEN; 584 overflowY = OHIDDEN;
585 } 585 }
586 586
587 bool ignoreOverflowHidden = false; 587 bool ignoreOverflowHidden = false;
588 if (m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && m_frame->pa ge()->mainFrame() == m_frame) 588 if (m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && m_frame->is MainFrame())
589 ignoreOverflowHidden = true; 589 ignoreOverflowHidden = true;
590 590
591 switch (overflowX) { 591 switch (overflowX) {
592 case OHIDDEN: 592 case OHIDDEN:
593 if (!ignoreOverflowHidden) 593 if (!ignoreOverflowHidden)
594 hMode = ScrollbarAlwaysOff; 594 hMode = ScrollbarAlwaysOff;
595 break; 595 break;
596 case OSCROLL: 596 case OSCROLL:
597 hMode = ScrollbarAlwaysOn; 597 hMode = ScrollbarAlwaysOn;
598 break; 598 break;
(...skipping 2872 matching lines...) Expand 10 before | Expand all | Expand 10 after
3471 void FrameView::setCursor(const Cursor& cursor) 3471 void FrameView::setCursor(const Cursor& cursor)
3472 { 3472 {
3473 Page* page = frame().page(); 3473 Page* page = frame().page();
3474 if (!page) 3474 if (!page)
3475 return; 3475 return;
3476 page->chrome().setCursor(cursor); 3476 page->chrome().setCursor(cursor);
3477 } 3477 }
3478 3478
3479 bool FrameView::isMainFrame() const 3479 bool FrameView::isMainFrame() const
3480 { 3480 {
3481 return m_frame->page() && m_frame->page()->mainFrame() == m_frame; 3481 return m_frame->isMainFrame();
3482 } 3482 }
3483 3483
3484 void FrameView::frameRectsChanged() 3484 void FrameView::frameRectsChanged()
3485 { 3485 {
3486 if (layoutSizeFixedToFrameSize()) 3486 if (layoutSizeFixedToFrameSize())
3487 setLayoutSizeInternal(frameRect().size()); 3487 setLayoutSizeInternal(frameRect().size());
3488 3488
3489 ScrollView::frameRectsChanged(); 3489 ScrollView::frameRectsChanged();
3490 } 3490 }
3491 3491
3492 void FrameView::setLayoutSizeInternal(const IntSize& size) 3492 void FrameView::setLayoutSizeInternal(const IntSize& size)
3493 { 3493 {
3494 if (m_layoutSize == size) 3494 if (m_layoutSize == size)
3495 return; 3495 return;
3496 3496
3497 m_layoutSize = size; 3497 m_layoutSize = size;
3498 contentsResized(); 3498 contentsResized();
3499 } 3499 }
3500 3500
3501 } // namespace WebCore 3501 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/Frame.cpp ('k') | Source/core/html/ImageDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698