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

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

Issue 6592050: Merge 77273 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 9 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 | « LayoutTests/fast/css/counters/deep-before-expected.txt ('k') | no next file » | 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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 } 762 }
763 } 763 }
764 764
765 String counterValueForElement(Element* element) 765 String counterValueForElement(Element* element)
766 { 766 {
767 // Make sure the element is not freed during the layout. 767 // Make sure the element is not freed during the layout.
768 RefPtr<Element> elementRef(element); 768 RefPtr<Element> elementRef(element);
769 element->document()->updateLayout(); 769 element->document()->updateLayout();
770 TextStream stream; 770 TextStream stream;
771 bool isFirstCounter = true; 771 bool isFirstCounter = true;
772 // The counter renderers should be children of anonymous children 772 // The counter renderers should be children of :before or :after pseudo-elem ents.
773 // (i.e., :before or :after pseudo-elements).
774 if (RenderObject* renderer = element->renderer()) { 773 if (RenderObject* renderer = element->renderer()) {
775 for (RenderObject* child = renderer->firstChild(); child; child = child- >nextSibling()) { 774 if (RenderObject* pseudoElement = renderer->beforePseudoElementRenderer( ))
776 if (child->isAnonymous()) 775 writeCounterValuesFromChildren(stream, pseudoElement, isFirstCounter );
777 writeCounterValuesFromChildren(stream, child, isFirstCounter); 776 if (RenderObject* pseudoElement = renderer->afterPseudoElementRenderer() )
778 } 777 writeCounterValuesFromChildren(stream, pseudoElement, isFirstCounter );
779 } 778 }
780 return stream.release(); 779 return stream.release();
781 } 780 }
782 781
783 String markerTextForListItem(Element* element) 782 String markerTextForListItem(Element* element)
784 { 783 {
785 // Make sure the element is not freed during the layout. 784 // Make sure the element is not freed during the layout.
786 RefPtr<Element> elementRef(element); 785 RefPtr<Element> elementRef(element);
787 element->document()->updateLayout(); 786 element->document()->updateLayout();
788 787
789 RenderObject* renderer = element->renderer(); 788 RenderObject* renderer = element->renderer();
790 if (!renderer || !renderer->isListItem()) 789 if (!renderer || !renderer->isListItem())
791 return String(); 790 return String();
792 791
793 return toRenderListItem(renderer)->markerText(); 792 return toRenderListItem(renderer)->markerText();
794 } 793 }
795 794
796 } // namespace WebCore 795 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/counters/deep-before-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698