OLD | NEW |
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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 if (behavior & kLayoutAsTextPrintingMode) { |
822 FloatSize size(ToLayoutBox(layout_object)->Size()); | 822 FloatSize size(ToLayoutBox(layout_object)->Size()); |
823 print_context.begin(size.Width(), size.Height()); | 823 print_context.BeginPrintMode(size.Width(), size.Height()); |
824 } | 824 } |
825 | 825 |
826 return ExternalRepresentation(ToLayoutBox(layout_object), behavior, | 826 return ExternalRepresentation(ToLayoutBox(layout_object), behavior, |
827 marked_layer); | 827 marked_layer); |
828 } | 828 } |
829 | 829 |
830 String ExternalRepresentation(Element* element, LayoutAsTextBehavior behavior) { | 830 String ExternalRepresentation(Element* element, LayoutAsTextBehavior behavior) { |
831 // Doesn't support printing mode. | 831 // Doesn't support printing mode. |
832 DCHECK(!(behavior & kLayoutAsTextPrintingMode)); | 832 DCHECK(!(behavior & kLayoutAsTextPrintingMode)); |
833 if (!(behavior & kLayoutAsTextDontUpdateLayout)) | 833 if (!(behavior & kLayoutAsTextDontUpdateLayout)) |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 element->GetDocument().UpdateStyleAndLayout(); | 874 element->GetDocument().UpdateStyleAndLayout(); |
875 | 875 |
876 LayoutObject* layout_object = element->GetLayoutObject(); | 876 LayoutObject* layout_object = element->GetLayoutObject(); |
877 if (!layout_object || !layout_object->IsListItem()) | 877 if (!layout_object || !layout_object->IsListItem()) |
878 return String(); | 878 return String(); |
879 | 879 |
880 return ToLayoutListItem(layout_object)->MarkerText(); | 880 return ToLayoutListItem(layout_object)->MarkerText(); |
881 } | 881 } |
882 | 882 |
883 } // namespace blink | 883 } // namespace blink |
OLD | NEW |