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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2575653002: [SPInvalidation] Invalidate all paint and properties for printing (Closed)
Patch Set: Rebase on third_party/WebKit/LayoutTests/TestExpectations Created 4 years 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 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 : Document::FinishingPrinting); 581 : Document::FinishingPrinting);
582 view()->adjustMediaTypeForPrinting(printing); 582 view()->adjustMediaTypeForPrinting(printing);
583 583
584 if (shouldUsePrintingLayout()) { 584 if (shouldUsePrintingLayout()) {
585 view()->forceLayoutForPagination(pageSize, originalPageSize, 585 view()->forceLayoutForPagination(pageSize, originalPageSize,
586 maximumShrinkRatio); 586 maximumShrinkRatio);
587 } else { 587 } else {
588 if (LayoutView* layoutView = view()->layoutView()) { 588 if (LayoutView* layoutView = view()->layoutView()) {
589 layoutView->setPreferredLogicalWidthsDirty(); 589 layoutView->setPreferredLogicalWidthsDirty();
590 layoutView->setNeedsLayout(LayoutInvalidationReason::PrintingChanged); 590 layoutView->setNeedsLayout(LayoutInvalidationReason::PrintingChanged);
591 layoutView->setShouldDoFullPaintInvalidationForViewAndAllDescendants(); 591 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
592 layoutView->setShouldDoFullPaintInvalidationForViewAndAllDescendants();
592 } 593 }
593 view()->layout(); 594 view()->layout();
594 view()->adjustViewSize(); 595 view()->adjustViewSize();
595 } 596 }
596 597
597 // Subframes of the one we're printing don't lay out to the page size. 598 // Subframes of the one we're printing don't lay out to the page size.
598 for (Frame* child = tree().firstChild(); child; 599 for (Frame* child = tree().firstChild(); child;
599 child = child->tree().nextSibling()) { 600 child = child->tree().nextSibling()) {
600 if (child->isLocalFrame()) 601 if (child->isLocalFrame())
601 toLocalFrame(child)->setPrinting(printing, FloatSize(), FloatSize(), 0); 602 toLocalFrame(child)->setPrinting(printing, FloatSize(), FloatSize(), 0);
602 } 603 }
603 604
605 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
606 view()->setShouldInvalidateAllPaintAndPaintProperties();
607
604 if (!printing) 608 if (!printing)
605 document()->setPrinting(Document::NotPrinting); 609 document()->setPrinting(Document::NotPrinting);
606 } 610 }
607 611
608 bool LocalFrame::shouldUsePrintingLayout() const { 612 bool LocalFrame::shouldUsePrintingLayout() const {
609 // Only top frame being printed should be fit to page size. 613 // Only top frame being printed should be fit to page size.
610 // Subframes should be constrained by parents only. 614 // Subframes should be constrained by parents only.
611 return document()->printing() && 615 return document()->printing() &&
612 (!tree().parent() || !tree().parent()->isLocalFrame() || 616 (!tree().parent() || !tree().parent()->isLocalFrame() ||
613 !toLocalFrame(tree().parent())->document()->printing()); 617 !toLocalFrame(tree().parent())->document()->printing());
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 933 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
930 m_frame->client()->frameBlameContext()->Enter(); 934 m_frame->client()->frameBlameContext()->Enter();
931 } 935 }
932 936
933 ScopedFrameBlamer::~ScopedFrameBlamer() { 937 ScopedFrameBlamer::~ScopedFrameBlamer() {
934 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 938 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
935 m_frame->client()->frameBlameContext()->Leave(); 939 m_frame->client()->frameBlameContext()->Leave();
936 } 940 }
937 941
938 } // namespace blink 942 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698