| 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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 String externalRepresentation(LocalFrame* frame, LayoutAsTextBehavior behavior) | 782 String externalRepresentation(LocalFrame* frame, LayoutAsTextBehavior behavior) |
| 783 { | 783 { |
| 784 if (!(behavior & LayoutAsTextDontUpdateLayout)) | 784 if (!(behavior & LayoutAsTextDontUpdateLayout)) |
| 785 frame->document()->updateLayout(); | 785 frame->document()->updateLayout(); |
| 786 | 786 |
| 787 LayoutObject* layoutObject = frame->contentLayoutObject(); | 787 LayoutObject* layoutObject = frame->contentLayoutObject(); |
| 788 if (!layoutObject || !layoutObject->isBox()) | 788 if (!layoutObject || !layoutObject->isBox()) |
| 789 return String(); | 789 return String(); |
| 790 | 790 |
| 791 PrintContext printContext(frame); | 791 PrintContext printContext(frame); |
| 792 if (behavior & LayoutAsTextPrintingMode) | 792 if (behavior & LayoutAsTextPrintingMode) { |
| 793 printContext.begin(toLayoutBox(layoutObject)->size().width().toFloat()); | 793 FloatSize size(toLayoutBox(layoutObject)->size()); |
| 794 printContext.begin(size.width(), size.height()); |
| 795 } |
| 794 | 796 |
| 795 return externalRepresentation(toLayoutBox(layoutObject), behavior); | 797 return externalRepresentation(toLayoutBox(layoutObject), behavior); |
| 796 } | 798 } |
| 797 | 799 |
| 798 String externalRepresentation(Element* element, LayoutAsTextBehavior behavior) | 800 String externalRepresentation(Element* element, LayoutAsTextBehavior behavior) |
| 799 { | 801 { |
| 800 // Doesn't support printing mode. | 802 // Doesn't support printing mode. |
| 801 ASSERT(!(behavior & LayoutAsTextPrintingMode)); | 803 ASSERT(!(behavior & LayoutAsTextPrintingMode)); |
| 802 if (!(behavior & LayoutAsTextDontUpdateLayout)) | 804 if (!(behavior & LayoutAsTextDontUpdateLayout)) |
| 803 element->document().updateLayout(); | 805 element->document().updateLayout(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 element->document().updateLayout(); | 846 element->document().updateLayout(); |
| 845 | 847 |
| 846 LayoutObject* layoutObject = element->layoutObject(); | 848 LayoutObject* layoutObject = element->layoutObject(); |
| 847 if (!layoutObject || !layoutObject->isListItem()) | 849 if (!layoutObject || !layoutObject->isListItem()) |
| 848 return String(); | 850 return String(); |
| 849 | 851 |
| 850 return toLayoutListItem(layoutObject)->markerText(); | 852 return toLayoutListItem(layoutObject)->markerText(); |
| 851 } | 853 } |
| 852 | 854 |
| 853 } // namespace blink | 855 } // namespace blink |
| OLD | NEW |