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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master 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
OLDNEW
1 /* 1 /*
2 * This file is part of the render object implementation for KHTML. 2 * This file is part of the render object implementation for KHTML.
3 * 3 *
4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
5 * (C) 1999 Antti Koivisto (koivisto@kde.org) 5 * (C) 1999 Antti Koivisto (koivisto@kde.org)
6 * Copyright (C) 2003 Apple Computer, Inc. 6 * Copyright (C) 2003 Apple Computer, Inc.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 Vector<unsigned int> m_sortedOrdinalValues; 119 Vector<unsigned int> m_sortedOrdinalValues;
120 int m_ordinalIteration; 120 int m_ordinalIteration;
121 }; 121 };
122 122
123 RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox(Element* element) 123 RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox(Element* element)
124 : RenderBlock(element) 124 : RenderBlock(element)
125 { 125 {
126 setChildrenInline(false); // All of our children must be block-level 126 setChildrenInline(false); // All of our children must be block-level
127 m_stretchingChildren = false; 127 m_stretchingChildren = false;
128 if (!isAnonymous()) { 128 if (!isAnonymous()) {
129 const KURL& url = document()->url(); 129 const KURL& url = document().url();
130 if (url.protocolIs("chrome")) 130 if (url.protocolIs("chrome"))
131 UseCounter::count(document(), UseCounter::DeprecatedFlexboxChrome); 131 UseCounter::count(&document(), UseCounter::DeprecatedFlexboxChrome);
132 else if (url.protocolIs("chrome-extension")) 132 else if (url.protocolIs("chrome-extension"))
133 UseCounter::count(document(), UseCounter::DeprecatedFlexboxChromeExt ension); 133 UseCounter::count(&document(), UseCounter::DeprecatedFlexboxChromeEx tension);
134 else 134 else
135 UseCounter::count(document(), UseCounter::DeprecatedFlexboxWebConten t); 135 UseCounter::count(&document(), UseCounter::DeprecatedFlexboxWebConte nt);
136 } 136 }
137 } 137 }
138 138
139 RenderDeprecatedFlexibleBox::~RenderDeprecatedFlexibleBox() 139 RenderDeprecatedFlexibleBox::~RenderDeprecatedFlexibleBox()
140 { 140 {
141 } 141 }
142 142
143 RenderDeprecatedFlexibleBox* RenderDeprecatedFlexibleBox::createAnonymous(Docume nt* document) 143 RenderDeprecatedFlexibleBox* RenderDeprecatedFlexibleBox::createAnonymous(Docume nt* document)
144 { 144 {
145 RenderDeprecatedFlexibleBox* renderer = new RenderDeprecatedFlexibleBox(0); 145 RenderDeprecatedFlexibleBox* renderer = new RenderDeprecatedFlexibleBox(0);
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 } 893 }
894 894
895 // So that the computeLogicalHeight in layoutBlock() knows to relayout posit ioned objects because of 895 // So that the computeLogicalHeight in layoutBlock() knows to relayout posit ioned objects because of
896 // a height change, we revert our height back to the intrinsic height before returning. 896 // a height change, we revert our height back to the intrinsic height before returning.
897 if (heightSpecified) 897 if (heightSpecified)
898 setHeight(oldHeight); 898 setHeight(oldHeight);
899 } 899 }
900 900
901 void RenderDeprecatedFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool relayoutChildren) 901 void RenderDeprecatedFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool relayoutChildren)
902 { 902 {
903 UseCounter::count(document(), UseCounter::LineClamp); 903 UseCounter::count(&document(), UseCounter::LineClamp);
904 904
905 int maxLineCount = 0; 905 int maxLineCount = 0;
906 for (RenderBox* child = iterator.first(); child; child = iterator.next()) { 906 for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
907 if (childDoesNotAffectWidthOrFlexing(child)) 907 if (childDoesNotAffectWidthOrFlexing(child))
908 continue; 908 continue;
909 909
910 child->clearOverrideSize(); 910 child->clearOverrideSize();
911 if (relayoutChildren || (child->isReplaced() && (child->style()->width() .isPercent() || child->style()->height().isPercent())) 911 if (relayoutChildren || (child->isReplaced() && (child->style()->width() .isPercent() || child->style()->height().isPercent()))
912 || (child->style()->height().isAuto() && child->isBlockFlow())) { 912 || (child->style()->height().isAuto() && child->isBlockFlow())) {
913 child->setChildNeedsLayout(MarkOnlyThis); 913 child->setChildNeedsLayout(MarkOnlyThis);
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 if (isPseudoElement()) 1101 if (isPseudoElement())
1102 return "RenderDeprecatedFlexibleBox (generated)"; 1102 return "RenderDeprecatedFlexibleBox (generated)";
1103 if (isAnonymous()) 1103 if (isAnonymous())
1104 return "RenderDeprecatedFlexibleBox (generated)"; 1104 return "RenderDeprecatedFlexibleBox (generated)";
1105 if (isRelPositioned()) 1105 if (isRelPositioned())
1106 return "RenderDeprecatedFlexibleBox (relative positioned)"; 1106 return "RenderDeprecatedFlexibleBox (relative positioned)";
1107 return "RenderDeprecatedFlexibleBox"; 1107 return "RenderDeprecatedFlexibleBox";
1108 } 1108 }
1109 1109
1110 } // namespace WebCore 1110 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBoxModelObject.cpp ('k') | Source/core/rendering/RenderEmbeddedObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698