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

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

Issue 928393003: Remove the concept of document.documentElement (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.h » ('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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 { 614 {
615 return m_inputEventsOffsetForEmulation; 615 return m_inputEventsOffsetForEmulation;
616 } 616 }
617 617
618 float FrameView::inputEventsScaleFactor() const 618 float FrameView::inputEventsScaleFactor() const
619 { 619 {
620 float pageScale = visibleContentScaleFactor(); 620 float pageScale = visibleContentScaleFactor();
621 return pageScale * m_inputEventsScaleFactorForEmulation; 621 return pageScale * m_inputEventsScaleFactorForEmulation;
622 } 622 }
623 623
624 Color FrameView::documentBackgroundColor() const
625 {
626 // <https://bugs.webkit.org/show_bug.cgi?id=59540> We blend the background c olor of
627 // the document and the body against the base background color of the frame view.
628 // Background images are unfortunately impractical to include.
629
630 Color result = baseBackgroundColor();
631 if (!frame().document())
632 return result;
633
634 Element* htmlElement = frame().document()->documentElement();
635
636 // We take the aggregate of the base background color
637 // the <html> background color, and the <body>
638 // background color to find the document color. The
639 // addition of the base background color is not
640 // technically part of the document background, but it
641 // otherwise poses problems when the aggregate is not
642 // fully opaque.
643 if (htmlElement && htmlElement->renderer())
644 result = result.blend(htmlElement->renderer()->style()->colorIncludingFa llback(CSSPropertyBackgroundColor));
645
646 return result;
647 }
648
649 void FrameView::paint(GraphicsContext* context, const IntRect& rect) 624 void FrameView::paint(GraphicsContext* context, const IntRect& rect)
650 { 625 {
651 #ifndef NDEBUG 626 #ifndef NDEBUG
652 bool fillWithRed; 627 bool fillWithRed;
653 if (isTransparent()) 628 if (isTransparent())
654 fillWithRed = false; // Transparent, don't fill with red. 629 fillWithRed = false; // Transparent, don't fill with red.
655 else 630 else
656 fillWithRed = true; 631 fillWithRed = true;
657 632
658 if (fillWithRed) 633 if (fillWithRed)
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 totalObjects = 0; 789 totalObjects = 0;
815 790
816 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) { 791 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) {
817 ++totalObjects; 792 ++totalObjects;
818 if (o->needsLayout()) 793 if (o->needsLayout())
819 ++needsLayoutObjects; 794 ++needsLayoutObjects;
820 } 795 }
821 } 796 }
822 797
823 } // namespace blink 798 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/frame/FrameView.h ('k') | sky/engine/core/frame/LocalDOMWindow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698