OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |