Chromium Code Reviews| 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 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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 593 ResourceCacheValidationSuppressor validation_suppressor( | 593 ResourceCacheValidationSuppressor validation_suppressor( |
| 594 GetDocument()->Fetcher()); | 594 GetDocument()->Fetcher()); |
| 595 | 595 |
| 596 GetDocument()->SetPrinting(printing ? Document::kPrinting | 596 GetDocument()->SetPrinting(printing ? Document::kPrinting |
| 597 : Document::kFinishingPrinting); | 597 : Document::kFinishingPrinting); |
| 598 View()->AdjustMediaTypeForPrinting(printing); | 598 View()->AdjustMediaTypeForPrinting(printing); |
| 599 | 599 |
| 600 if (ShouldUsePrintingLayout()) { | 600 if (ShouldUsePrintingLayout()) { |
| 601 View()->ForceLayoutForPagination(page_size, original_page_size, | 601 View()->ForceLayoutForPagination(page_size, original_page_size, |
| 602 maximum_shrink_ratio); | 602 maximum_shrink_ratio); |
| 603 } else { | 603 } else if (!RuntimeEnabledFeatures::printBrowserEnabled()) { |
|
pdr.
2017/04/14 23:28:04
I see what you mean. Hmm... I don't know this code
nainar
2017/04/14 23:43:33
No we want that layout to happen so that we force
pdr.
2017/04/14 23:54:00
Couldn't UpdateLayout get called later? SetPrintin
nainar
2017/04/15 00:13:45
Yup, I see what you mean - we can indeed force a L
| |
| 604 if (LayoutView* layout_view = View()->GetLayoutView()) { | 604 if (LayoutView* layout_view = View()->GetLayoutView()) { |
| 605 layout_view->SetPreferredLogicalWidthsDirty(); | 605 layout_view->SetPreferredLogicalWidthsDirty(); |
| 606 layout_view->SetNeedsLayout(LayoutInvalidationReason::kPrintingChanged); | 606 layout_view->SetNeedsLayout(LayoutInvalidationReason::kPrintingChanged); |
| 607 layout_view->SetShouldDoFullPaintInvalidationForViewAndAllDescendants(); | 607 layout_view->SetShouldDoFullPaintInvalidationForViewAndAllDescendants(); |
| 608 } | 608 } |
| 609 View()->UpdateLayout(); | 609 View()->UpdateLayout(); |
| 610 View()->AdjustViewSize(); | 610 View()->AdjustViewSize(); |
| 611 } | 611 } |
| 612 | 612 |
| 613 // Subframes of the one we're printing don't lay out to the page size. | 613 // Subframes of the one we're printing don't lay out to the page size. |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 946 if (frame_ && frame_->Client() && frame_->Client()->GetFrameBlameContext()) | 946 if (frame_ && frame_->Client() && frame_->Client()->GetFrameBlameContext()) |
| 947 frame_->Client()->GetFrameBlameContext()->Enter(); | 947 frame_->Client()->GetFrameBlameContext()->Enter(); |
| 948 } | 948 } |
| 949 | 949 |
| 950 ScopedFrameBlamer::~ScopedFrameBlamer() { | 950 ScopedFrameBlamer::~ScopedFrameBlamer() { |
| 951 if (frame_ && frame_->Client() && frame_->Client()->GetFrameBlameContext()) | 951 if (frame_ && frame_->Client() && frame_->Client()->GetFrameBlameContext()) |
| 952 frame_->Client()->GetFrameBlameContext()->Leave(); | 952 frame_->Client()->GetFrameBlameContext()->Leave(); |
| 953 } | 953 } |
| 954 | 954 |
| 955 } // namespace blink | 955 } // namespace blink |
| OLD | NEW |