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

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: Add a passing test in 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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 : Document::FinishingPrinting); 584 : Document::FinishingPrinting);
585 view()->adjustMediaTypeForPrinting(printing); 585 view()->adjustMediaTypeForPrinting(printing);
586 586
587 if (shouldUsePrintingLayout()) { 587 if (shouldUsePrintingLayout()) {
588 view()->forceLayoutForPagination(pageSize, originalPageSize, 588 view()->forceLayoutForPagination(pageSize, originalPageSize,
589 maximumShrinkRatio); 589 maximumShrinkRatio);
590 } else { 590 } else {
591 if (LayoutView* layoutView = view()->layoutView()) { 591 if (LayoutView* layoutView = view()->layoutView()) {
592 layoutView->setPreferredLogicalWidthsDirty(); 592 layoutView->setPreferredLogicalWidthsDirty();
593 layoutView->setNeedsLayout(LayoutInvalidationReason::PrintingChanged); 593 layoutView->setNeedsLayout(LayoutInvalidationReason::PrintingChanged);
594 layoutView->setShouldDoFullPaintInvalidationForViewAndAllDescendants(); 594 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
595 layoutView->setShouldDoFullPaintInvalidationForViewAndAllDescendants();
595 } 596 }
596 view()->layout(); 597 view()->layout();
597 view()->adjustViewSize(); 598 view()->adjustViewSize();
598 } 599 }
599 600
600 // Subframes of the one we're printing don't lay out to the page size. 601 // Subframes of the one we're printing don't lay out to the page size.
601 for (Frame* child = tree().firstChild(); child; 602 for (Frame* child = tree().firstChild(); child;
602 child = child->tree().nextSibling()) { 603 child = child->tree().nextSibling()) {
603 if (child->isLocalFrame()) 604 if (child->isLocalFrame())
604 toLocalFrame(child)->setPrinting(printing, FloatSize(), FloatSize(), 0); 605 toLocalFrame(child)->setPrinting(printing, FloatSize(), FloatSize(), 0);
605 } 606 }
606 607
608 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
609 view()->setShouldInvalidateAllPaintAndPaintProperties();
610
607 if (!printing) 611 if (!printing)
608 document()->setPrinting(Document::NotPrinting); 612 document()->setPrinting(Document::NotPrinting);
609 } 613 }
610 614
611 bool LocalFrame::shouldUsePrintingLayout() const { 615 bool LocalFrame::shouldUsePrintingLayout() const {
612 // Only top frame being printed should be fit to page size. 616 // Only top frame being printed should be fit to page size.
613 // Subframes should be constrained by parents only. 617 // Subframes should be constrained by parents only.
614 return document()->printing() && 618 return document()->printing() &&
615 (!tree().parent() || !tree().parent()->isLocalFrame() || 619 (!tree().parent() || !tree().parent()->isLocalFrame() ||
616 !toLocalFrame(tree().parent())->document()->printing()); 620 !toLocalFrame(tree().parent())->document()->printing());
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 936 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
933 m_frame->client()->frameBlameContext()->Enter(); 937 m_frame->client()->frameBlameContext()->Enter();
934 } 938 }
935 939
936 ScopedFrameBlamer::~ScopedFrameBlamer() { 940 ScopedFrameBlamer::~ScopedFrameBlamer() {
937 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 941 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
938 m_frame->client()->frameBlameContext()->Leave(); 942 m_frame->client()->frameBlameContext()->Leave();
939 } 943 }
940 944
941 } // namespace blink 945 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698