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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp

Issue 2864753004: M59: Clear the PrintContext in WebLocalFrameImpl::Close(). (Closed)
Patch Set: fix Created 3 years, 7 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 | « no previous file | third_party/WebKit/Source/core/page/PrintContext.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) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 LayoutAsTextBehavior behavior, 811 LayoutAsTextBehavior behavior,
812 const PaintLayer* marked_layer) { 812 const PaintLayer* marked_layer) {
813 if (!(behavior & kLayoutAsTextDontUpdateLayout)) 813 if (!(behavior & kLayoutAsTextDontUpdateLayout))
814 frame->GetDocument()->UpdateStyleAndLayout(); 814 frame->GetDocument()->UpdateStyleAndLayout();
815 815
816 LayoutObject* layout_object = frame->ContentLayoutObject(); 816 LayoutObject* layout_object = frame->ContentLayoutObject();
817 if (!layout_object || !layout_object->IsBox()) 817 if (!layout_object || !layout_object->IsBox())
818 return String(); 818 return String();
819 819
820 PrintContext print_context(frame); 820 PrintContext print_context(frame);
821 if (behavior & kLayoutAsTextPrintingMode) { 821 bool is_text_printing_mode = !!(behavior & kLayoutAsTextPrintingMode);
822 if (is_text_printing_mode) {
822 FloatSize size(ToLayoutBox(layout_object)->Size()); 823 FloatSize size(ToLayoutBox(layout_object)->Size());
823 print_context.begin(size.Width(), size.Height()); 824 print_context.begin(size.Width(), size.Height());
824 } 825 }
825 826
826 return ExternalRepresentation(ToLayoutBox(layout_object), behavior, 827 String representation = ExternalRepresentation(ToLayoutBox(layout_object),
827 marked_layer); 828 behavior, marked_layer);
829 if (is_text_printing_mode)
830 print_context.end();
831 return representation;
828 } 832 }
829 833
830 String ExternalRepresentation(Element* element, LayoutAsTextBehavior behavior) { 834 String ExternalRepresentation(Element* element, LayoutAsTextBehavior behavior) {
831 // Doesn't support printing mode. 835 // Doesn't support printing mode.
832 DCHECK(!(behavior & kLayoutAsTextPrintingMode)); 836 DCHECK(!(behavior & kLayoutAsTextPrintingMode));
833 if (!(behavior & kLayoutAsTextDontUpdateLayout)) 837 if (!(behavior & kLayoutAsTextDontUpdateLayout))
834 element->GetDocument().UpdateStyleAndLayout(); 838 element->GetDocument().UpdateStyleAndLayout();
835 839
836 LayoutObject* layout_object = element->GetLayoutObject(); 840 LayoutObject* layout_object = element->GetLayoutObject();
837 if (!layout_object || !layout_object->IsBox()) 841 if (!layout_object || !layout_object->IsBox())
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 element->GetDocument().UpdateStyleAndLayout(); 878 element->GetDocument().UpdateStyleAndLayout();
875 879
876 LayoutObject* layout_object = element->GetLayoutObject(); 880 LayoutObject* layout_object = element->GetLayoutObject();
877 if (!layout_object || !layout_object->IsListItem()) 881 if (!layout_object || !layout_object->IsListItem())
878 return String(); 882 return String();
879 883
880 return ToLayoutListItem(layout_object)->MarkerText(); 884 return ToLayoutListItem(layout_object)->MarkerText();
881 } 885 }
882 886
883 } // namespace blink 887 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/PrintContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698