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

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

Issue 1896793002: Rename (updateLayout/updateStyle).*.() to updateStyleAndLayout.*.() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 continue; 534 continue;
535 write(ts, *child, indent + 1, behavior); 535 write(ts, *child, indent + 1, behavior);
536 } 536 }
537 537
538 if (o.isLayoutPart()) { 538 if (o.isLayoutPart()) {
539 Widget* widget = toLayoutPart(o).widget(); 539 Widget* widget = toLayoutPart(o).widget();
540 if (widget && widget->isFrameView()) { 540 if (widget && widget->isFrameView()) {
541 FrameView* view = toFrameView(widget); 541 FrameView* view = toFrameView(widget);
542 LayoutView* root = view->layoutView(); 542 LayoutView* root = view->layoutView();
543 if (root) { 543 if (root) {
544 root->document().updateLayout(); 544 root->document().updateStyleAndLayout();
545 PaintLayer* layer = root->layer(); 545 PaintLayer* layer = root->layer();
546 if (layer) 546 if (layer)
547 LayoutTreeAsText::writeLayers(ts, layer, layer, layer->rect( ), indent + 1, behavior); 547 LayoutTreeAsText::writeLayers(ts, layer, layer, layer->rect( ), indent + 1, behavior);
548 } 548 }
549 } 549 }
550 } 550 }
551 } 551 }
552 552
553 enum LayerPaintPhase { 553 enum LayerPaintPhase {
554 LayerPaintPhaseAll = 0, 554 LayerPaintPhaseAll = 0,
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 779
780 PaintLayer* layer = layoutObject->layer(); 780 PaintLayer* layer = layoutObject->layer();
781 LayoutTreeAsText::writeLayers(ts, layer, layer, layer->rect(), 0, behavior, markedLayer); 781 LayoutTreeAsText::writeLayers(ts, layer, layer, layer->rect(), 0, behavior, markedLayer);
782 writeSelection(ts, layoutObject); 782 writeSelection(ts, layoutObject);
783 return ts.release(); 783 return ts.release();
784 } 784 }
785 785
786 String externalRepresentation(LocalFrame* frame, LayoutAsTextBehavior behavior, const PaintLayer* markedLayer) 786 String externalRepresentation(LocalFrame* frame, LayoutAsTextBehavior behavior, const PaintLayer* markedLayer)
787 { 787 {
788 if (!(behavior & LayoutAsTextDontUpdateLayout)) 788 if (!(behavior & LayoutAsTextDontUpdateLayout))
789 frame->document()->updateLayout(); 789 frame->document()->updateStyleAndLayout();
790 790
791 LayoutObject* layoutObject = frame->contentLayoutObject(); 791 LayoutObject* layoutObject = frame->contentLayoutObject();
792 if (!layoutObject || !layoutObject->isBox()) 792 if (!layoutObject || !layoutObject->isBox())
793 return String(); 793 return String();
794 794
795 PrintContext printContext(frame); 795 PrintContext printContext(frame);
796 if (behavior & LayoutAsTextPrintingMode) { 796 if (behavior & LayoutAsTextPrintingMode) {
797 FloatSize size(toLayoutBox(layoutObject)->size()); 797 FloatSize size(toLayoutBox(layoutObject)->size());
798 printContext.begin(size.width(), size.height()); 798 printContext.begin(size.width(), size.height());
799 } 799 }
800 800
801 return externalRepresentation(toLayoutBox(layoutObject), behavior, markedLay er); 801 return externalRepresentation(toLayoutBox(layoutObject), behavior, markedLay er);
802 } 802 }
803 803
804 String externalRepresentation(Element* element, LayoutAsTextBehavior behavior) 804 String externalRepresentation(Element* element, LayoutAsTextBehavior behavior)
805 { 805 {
806 // Doesn't support printing mode. 806 // Doesn't support printing mode.
807 ASSERT(!(behavior & LayoutAsTextPrintingMode)); 807 ASSERT(!(behavior & LayoutAsTextPrintingMode));
808 if (!(behavior & LayoutAsTextDontUpdateLayout)) 808 if (!(behavior & LayoutAsTextDontUpdateLayout))
809 element->document().updateLayout(); 809 element->document().updateStyleAndLayout();
810 810
811 LayoutObject* layoutObject = element->layoutObject(); 811 LayoutObject* layoutObject = element->layoutObject();
812 if (!layoutObject || !layoutObject->isBox()) 812 if (!layoutObject || !layoutObject->isBox())
813 return String(); 813 return String();
814 814
815 return externalRepresentation(toLayoutBox(layoutObject), behavior | LayoutAs TextShowAllLayers); 815 return externalRepresentation(toLayoutBox(layoutObject), behavior | LayoutAs TextShowAllLayers);
816 } 816 }
817 817
818 static void writeCounterValuesFromChildren(TextStream& stream, LayoutObject* par ent, bool& isFirstCounter) 818 static void writeCounterValuesFromChildren(TextStream& stream, LayoutObject* par ent, bool& isFirstCounter)
819 { 819 {
820 for (LayoutObject* child = parent->slowFirstChild(); child; child = child->n extSibling()) { 820 for (LayoutObject* child = parent->slowFirstChild(); child; child = child->n extSibling()) {
821 if (child->isCounter()) { 821 if (child->isCounter()) {
822 if (!isFirstCounter) 822 if (!isFirstCounter)
823 stream << " "; 823 stream << " ";
824 isFirstCounter = false; 824 isFirstCounter = false;
825 String str(toLayoutText(child)->text()); 825 String str(toLayoutText(child)->text());
826 stream << str; 826 stream << str;
827 } 827 }
828 } 828 }
829 } 829 }
830 830
831 String counterValueForElement(Element* element) 831 String counterValueForElement(Element* element)
832 { 832 {
833 element->document().updateLayout(); 833 element->document().updateStyleAndLayout();
834 TextStream stream; 834 TextStream stream;
835 bool isFirstCounter = true; 835 bool isFirstCounter = true;
836 // The counter layoutObjects should be children of :before or :after pseudo- elements. 836 // The counter layoutObjects should be children of :before or :after pseudo- elements.
837 if (LayoutObject* before = element->pseudoElementLayoutObject(PseudoIdBefore )) 837 if (LayoutObject* before = element->pseudoElementLayoutObject(PseudoIdBefore ))
838 writeCounterValuesFromChildren(stream, before, isFirstCounter); 838 writeCounterValuesFromChildren(stream, before, isFirstCounter);
839 if (LayoutObject* after = element->pseudoElementLayoutObject(PseudoIdAfter)) 839 if (LayoutObject* after = element->pseudoElementLayoutObject(PseudoIdAfter))
840 writeCounterValuesFromChildren(stream, after, isFirstCounter); 840 writeCounterValuesFromChildren(stream, after, isFirstCounter);
841 return stream.release(); 841 return stream.release();
842 } 842 }
843 843
844 String markerTextForListItem(Element* element) 844 String markerTextForListItem(Element* element)
845 { 845 {
846 element->document().updateLayout(); 846 element->document().updateStyleAndLayout();
847 847
848 LayoutObject* layoutObject = element->layoutObject(); 848 LayoutObject* layoutObject = element->layoutObject();
849 if (!layoutObject || !layoutObject->isListItem()) 849 if (!layoutObject || !layoutObject->isListItem())
850 return String(); 850 return String();
851 851
852 return toLayoutListItem(layoutObject)->markerText(); 852 return toLayoutListItem(layoutObject)->markerText();
853 } 853 }
854 854
855 } // namespace blink 855 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | third_party/WebKit/Source/core/page/FocusController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698