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

Side by Side Diff: sky/engine/core/css/resolver/StyleAdjuster.cpp

Issue 1060223002: Remove parsing for display:block/inline-block. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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/css/CSSValueKeywords.in ('k') | sky/engine/core/css/resolver/StyleResolver.cpp » ('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 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 30 matching lines...) Expand all
41 41
42 namespace blink { 42 namespace blink {
43 43
44 static EDisplay equivalentInlineDisplay(EDisplay display) 44 static EDisplay equivalentInlineDisplay(EDisplay display)
45 { 45 {
46 switch (display) { 46 switch (display) {
47 // TODO(ojan): Do we need an INLINE_PARAGRAPH display? 47 // TODO(ojan): Do we need an INLINE_PARAGRAPH display?
48 case PARAGRAPH: 48 case PARAGRAPH:
49 return INLINE; 49 return INLINE;
50 50
51 case BLOCK:
52 return INLINE_BLOCK;
53
54 case FLEX: 51 case FLEX:
55 return INLINE_FLEX; 52 return INLINE_FLEX;
56 53
57 case INLINE: 54 case INLINE:
58 case INLINE_FLEX: 55 case INLINE_FLEX:
59 case INLINE_BLOCK:
60 return display; 56 return display;
61 57
62 case NONE: 58 case NONE:
63 ASSERT_NOT_REACHED(); 59 ASSERT_NOT_REACHED();
64 return NONE; 60 return NONE;
65 } 61 }
66 62
67 ASSERT_NOT_REACHED(); 63 ASSERT_NOT_REACHED();
68 return NONE; 64 return NONE;
69 } 65 }
70 66
71 static EDisplay equivalentBlockDisplay(EDisplay display) 67 static EDisplay equivalentBlockDisplay(EDisplay display)
72 { 68 {
73 switch (display) { 69 switch (display) {
74 case PARAGRAPH: 70 case PARAGRAPH:
75 case BLOCK:
76 case FLEX: 71 case FLEX:
77 return display; 72 return display;
78 73
74 case INLINE:
79 case INLINE_FLEX: 75 case INLINE_FLEX:
80 return FLEX; 76 return FLEX;
81 77
82 case INLINE:
83 case INLINE_BLOCK:
84 return BLOCK;
85
86 case NONE: 78 case NONE:
87 ASSERT_NOT_REACHED(); 79 ASSERT_NOT_REACHED();
88 return NONE; 80 return NONE;
89 } 81 }
90 82
91 ASSERT_NOT_REACHED(); 83 ASSERT_NOT_REACHED();
92 return NONE; 84 return NONE;
93 } 85 }
94 86
95 // CSS requires text-decoration to be reset at each DOM element for tables, 87 // CSS requires text-decoration to be reset at each DOM element for tables,
96 // inline blocks, inline tables, shadow DOM crossings, floating elements, 88 // inline blocks, inline tables, shadow DOM crossings, floating elements,
97 // and absolute or relatively positioned elements. 89 // and absolute or relatively positioned elements.
98 static bool doesNotInheritTextDecoration(const RenderStyle* style, const Element & e) 90 static bool doesNotInheritTextDecoration(const RenderStyle* style, const Element & e)
99 { 91 {
100 return style->display() == INLINE_BLOCK || isAtShadowBoundary(&e) || style-> hasOutOfFlowPosition(); 92 return isAtShadowBoundary(&e) || style->hasOutOfFlowPosition();
101 } 93 }
102 94
103 static bool parentStyleForcesZIndexToCreateStackingContext(const RenderStyle* pa rentStyle) 95 static bool parentStyleForcesZIndexToCreateStackingContext(const RenderStyle* pa rentStyle)
104 { 96 {
105 return parentStyle->isDisplayFlexibleBox(); 97 return parentStyle->isDisplayFlexibleBox();
106 } 98 }
107 99
108 static bool hasWillChangeThatCreatesStackingContext(const RenderStyle* style) 100 static bool hasWillChangeThatCreatesStackingContext(const RenderStyle* style)
109 { 101 {
110 for (size_t i = 0; i < style->willChangeProperties().size(); ++i) { 102 for (size_t i = 0; i < style->willChangeProperties().size(); ++i) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 // FIXME: Once we implement pagination controls, overflow-x should defau lt to hidden 201 // FIXME: Once we implement pagination controls, overflow-x should defau lt to hidden
210 // if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, w e'll let it 202 // if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, w e'll let it
211 // default to auto so we can at least scroll through the pages. 203 // default to auto so we can at least scroll through the pages.
212 style->setOverflowX(OAUTO); 204 style->setOverflowX(OAUTO);
213 } else if (style->overflowY() == OVISIBLE && style->overflowX() != OVISIBLE) { 205 } else if (style->overflowY() == OVISIBLE && style->overflowX() != OVISIBLE) {
214 style->setOverflowY(OAUTO); 206 style->setOverflowY(OAUTO);
215 } 207 }
216 } 208 }
217 209
218 } 210 }
OLDNEW
« no previous file with comments | « sky/engine/core/css/CSSValueKeywords.in ('k') | sky/engine/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698