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

Side by Side Diff: Source/core/rendering/RenderTreeAsText.cpp

Issue 23717008: Remove useless null checks from Node::document() call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/svg/SVGElementRareData.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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 if (behavior & RenderAsTextPrintingMode) 797 if (behavior & RenderAsTextPrintingMode)
798 printContext.begin(toRenderBox(renderer)->width()); 798 printContext.begin(toRenderBox(renderer)->width());
799 799
800 return externalRepresentation(toRenderBox(renderer), behavior); 800 return externalRepresentation(toRenderBox(renderer), behavior);
801 } 801 }
802 802
803 String externalRepresentation(Element* element, RenderAsTextBehavior behavior) 803 String externalRepresentation(Element* element, RenderAsTextBehavior behavior)
804 { 804 {
805 // Doesn't support printing mode. 805 // Doesn't support printing mode.
806 ASSERT(!(behavior & RenderAsTextPrintingMode)); 806 ASSERT(!(behavior & RenderAsTextPrintingMode));
807 if (!(behavior & RenderAsTextDontUpdateLayout) && element->document()) 807 if (!(behavior & RenderAsTextDontUpdateLayout))
808 element->document()->updateLayout(); 808 element->document()->updateLayout();
809 809
810 RenderObject* renderer = element->renderer(); 810 RenderObject* renderer = element->renderer();
811 if (!renderer || !renderer->isBox()) 811 if (!renderer || !renderer->isBox())
812 return String(); 812 return String();
813 813
814 return externalRepresentation(toRenderBox(renderer), behavior | RenderAsText ShowAllLayers); 814 return externalRepresentation(toRenderBox(renderer), behavior | RenderAsText ShowAllLayers);
815 } 815 }
816 816
817 static void writeCounterValuesFromChildren(TextStream& stream, RenderObject* par ent, bool& isFirstCounter) 817 static void writeCounterValuesFromChildren(TextStream& stream, RenderObject* par ent, bool& isFirstCounter)
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 element->document()->updateLayout(); 849 element->document()->updateLayout();
850 850
851 RenderObject* renderer = element->renderer(); 851 RenderObject* renderer = element->renderer();
852 if (!renderer || !renderer->isListItem()) 852 if (!renderer || !renderer->isListItem())
853 return String(); 853 return String();
854 854
855 return toRenderListItem(renderer)->markerText(); 855 return toRenderListItem(renderer)->markerText();
856 } 856 }
857 857
858 } // namespace WebCore 858 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/svg/SVGElementRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698