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

Side by Side Diff: sky/engine/core/rendering/style/RenderStyle.cpp

Issue 1077473002: Stop rendering text inside flex boxes. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: make p default to display: paragraph Created 5 years, 8 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 | « sky/engine/core/rendering/style/RenderStyle.h ('k') | sky/examples/home.sky » ('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) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 PassRefPtr<RenderStyle> RenderStyle::create() 71 PassRefPtr<RenderStyle> RenderStyle::create()
72 { 72 {
73 return adoptRef(new RenderStyle()); 73 return adoptRef(new RenderStyle());
74 } 74 }
75 75
76 PassRefPtr<RenderStyle> RenderStyle::createDefaultStyle() 76 PassRefPtr<RenderStyle> RenderStyle::createDefaultStyle()
77 { 77 {
78 return adoptRef(new RenderStyle(DefaultStyle)); 78 return adoptRef(new RenderStyle(DefaultStyle));
79 } 79 }
80 80
81 PassRefPtr<RenderStyle> RenderStyle::createAnonymousStyleWithDisplay(const Rende rStyle* parentStyle, EDisplay display)
82 {
83 RefPtr<RenderStyle> newStyle = RenderStyle::create();
84 newStyle->inheritFrom(parentStyle);
85 newStyle->inheritUnicodeBidiFrom(parentStyle);
86 newStyle->setDisplay(display);
87 return newStyle;
88 }
89
90 PassRefPtr<RenderStyle> RenderStyle::clone(const RenderStyle* other) 81 PassRefPtr<RenderStyle> RenderStyle::clone(const RenderStyle* other)
91 { 82 {
92 return adoptRef(new RenderStyle(*other)); 83 return adoptRef(new RenderStyle(*other));
93 } 84 }
94 85
95 ALWAYS_INLINE RenderStyle::RenderStyle() 86 ALWAYS_INLINE RenderStyle::RenderStyle()
96 : m_box(defaultStyle()->m_box) 87 : m_box(defaultStyle()->m_box)
97 , visual(defaultStyle()->visual) 88 , visual(defaultStyle()->visual)
98 , m_background(defaultStyle()->m_background) 89 , m_background(defaultStyle()->m_background)
99 , surround(defaultStyle()->surround) 90 , surround(defaultStyle()->surround)
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 211 }
221 212
222 bool RenderStyle::inheritedDataShared(const RenderStyle* other) const 213 bool RenderStyle::inheritedDataShared(const RenderStyle* other) const
223 { 214 {
224 // This is a fast check that only looks if the data structures are shared. 215 // This is a fast check that only looks if the data structures are shared.
225 return inherited_flags == other->inherited_flags 216 return inherited_flags == other->inherited_flags
226 && inherited.get() == other->inherited.get() 217 && inherited.get() == other->inherited.get()
227 && rareInheritedData.get() == other->rareInheritedData.get(); 218 && rareInheritedData.get() == other->rareInheritedData.get();
228 } 219 }
229 220
230 bool RenderStyle::requiresOnlyBlockChildren() 221 bool RenderStyle::requiresOnlyBlockChildren() const
231 { 222 {
232 switch (display()) { 223 switch (display()) {
233 case PARAGRAPH: 224 case PARAGRAPH:
234 case INLINE: 225 case INLINE:
235 return false; 226 return false;
236 227
237 case FLEX: 228 case FLEX:
238 case INLINE_FLEX: 229 case INLINE_FLEX:
239 return true; 230 return true;
240 231
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 // right 1177 // right
1187 radiiSum = radii.topRight().height() + radii.bottomRight().height(); 1178 radiiSum = radii.topRight().height() + radii.bottomRight().height();
1188 if (radiiSum > rect.height()) 1179 if (radiiSum > rect.height())
1189 factor = std::min(rect.height() / radiiSum, factor); 1180 factor = std::min(rect.height() / radiiSum, factor);
1190 1181
1191 ASSERT(factor <= 1); 1182 ASSERT(factor <= 1);
1192 return factor; 1183 return factor;
1193 } 1184 }
1194 1185
1195 } // namespace blink 1186 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/style/RenderStyle.h ('k') | sky/examples/home.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698