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

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

Issue 928393003: Remove the concept of document.documentElement (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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) 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 } 126 }
127 } 127 }
128 return false; 128 return false;
129 } 129 }
130 130
131 void StyleAdjuster::adjustRenderStyle(RenderStyle* style, RenderStyle* parentSty le, Element& element) 131 void StyleAdjuster::adjustRenderStyle(RenderStyle* style, RenderStyle* parentSty le, Element& element)
132 { 132 {
133 ASSERT(parentStyle); 133 ASSERT(parentStyle);
134 134
135 if (style->display() != NONE) { 135 if (style->display() != NONE) {
136 // Absolute/fixed positioned elements, floating elements and the documen t element need block-like outside display. 136 if (style->hasOutOfFlowPosition() || parentStyle->requiresOnlyBlockChild ren())
137 if (style->hasOutOfFlowPosition() || element.document().documentElement( ) == element)
138 style->setDisplay(equivalentBlockDisplay(style->display()));
139
140 if (parentStyle->requiresOnlyBlockChildren())
141 style->setDisplay(equivalentBlockDisplay(style->display())); 137 style->setDisplay(equivalentBlockDisplay(style->display()));
142 else 138 else
143 style->setDisplay(equivalentInlineDisplay(style->display())); 139 style->setDisplay(equivalentInlineDisplay(style->display()));
144 } 140 }
145 141
146 // Make sure our z-index value is only applied if the object is positioned. 142 // Make sure our z-index value is only applied if the object is positioned.
147 if (style->position() == StaticPosition && !parentStyleForcesZIndexToCreateS tackingContext(parentStyle)) 143 if (style->position() == StaticPosition && !parentStyleForcesZIndexToCreateS tackingContext(parentStyle))
148 style->setHasAutoZIndex(); 144 style->setHasAutoZIndex();
149 145
150 // Auto z-index becomes 0 for the root element and transparent objects. This prevents 146 if (style->hasAutoZIndex()
151 // cases where objects that should be blended as a single unit end up with a non-transparent 147 && (style->hasOpacity()
152 // object wedged in between them. Auto z-index also becomes 0 for objects th at specify transforms. 148 || style->hasTransformRelatedProperty()
153 if (style->hasAutoZIndex() && ((element.document().documentElement() == elem ent) 149 || style->clipPath()
154 || style->hasOpacity() 150 || style->hasFilter()
155 || style->hasTransformRelatedProperty() 151 || hasWillChangeThatCreatesStackingContext(style)))
156 || style->clipPath()
157 || style->hasFilter()
158 || hasWillChangeThatCreatesStackingContext(style)))
159 style->setZIndex(0); 152 style->setZIndex(0);
160 153
161 // will-change:transform should result in the same rendering behavior as hav ing a transform, 154 // will-change:transform should result in the same rendering behavior as hav ing a transform,
162 // including the creation of a containing block for fixed position descendan ts. 155 // including the creation of a containing block for fixed position descendan ts.
163 if (!style->hasTransform() && (style->willChangeProperties().contains(CSSPro pertyWebkitTransform) || style->willChangeProperties().contains(CSSPropertyTrans form))) { 156 if (!style->hasTransform() && (style->willChangeProperties().contains(CSSPro pertyWebkitTransform) || style->willChangeProperties().contains(CSSPropertyTrans form))) {
164 bool makeIdentity = true; 157 bool makeIdentity = true;
165 style->setTransform(TransformOperations(makeIdentity)); 158 style->setTransform(TransformOperations(makeIdentity));
166 } 159 }
167 160
168 if (doesNotInheritTextDecoration(style, element)) 161 if (doesNotInheritTextDecoration(style, element))
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 // FIXME: Once we implement pagination controls, overflow-x should defau lt to hidden 243 // FIXME: Once we implement pagination controls, overflow-x should defau lt to hidden
251 // if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, w e'll let it 244 // if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, w e'll let it
252 // default to auto so we can at least scroll through the pages. 245 // default to auto so we can at least scroll through the pages.
253 style->setOverflowX(OAUTO); 246 style->setOverflowX(OAUTO);
254 } else if (style->overflowY() == OVISIBLE && style->overflowX() != OVISIBLE) { 247 } else if (style->overflowY() == OVISIBLE && style->overflowX() != OVISIBLE) {
255 style->setOverflowY(OAUTO); 248 style->setOverflowY(OAUTO);
256 } 249 }
257 } 250 }
258 251
259 } 252 }
OLDNEW
« no previous file with comments | « sky/engine/core/css/resolver/SharedStyleFinder.cpp ('k') | sky/engine/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698