Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 174 | 174 |
| 175 // We don't adjust the first letter style earlier because we may change the display setting in | 175 // We don't adjust the first letter style earlier because we may change the display setting in |
| 176 // adjustStyeForTagName() above. | 176 // adjustStyeForTagName() above. |
| 177 adjustStyleForFirstLetter(style); | 177 adjustStyleForFirstLetter(style); |
| 178 | 178 |
| 179 adjustStyleForDisplay(style, parentStyle, element ? &element->document() : 0); | 179 adjustStyleForDisplay(style, parentStyle, element ? &element->document() : 0); |
| 180 } else { | 180 } else { |
| 181 adjustStyleForFirstLetter(style); | 181 adjustStyleForFirstLetter(style); |
| 182 } | 182 } |
| 183 | 183 |
| 184 if (element && element->hasCompositorProxy()) { | |
| 185 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), "StyleAdjus ter::adjustComputedStyle hasCompositorProxy"); | |
| 186 | |
| 187 style.setHasCompositorProxy(true); | |
| 188 // We could check which properties are actually proxied and only set | |
| 189 // will change on those, but there is currently little value as these | |
| 190 // have the same effect. It will also require providing a way for | |
| 191 // elements to access their associated proxies on the main thread (there | |
| 192 // is no other reason for doing this, presently). | |
| 193 style.setWillChangeScrollPosition(true); | |
| 194 Vector<CSSPropertyID> properties = style.willChangeProperties(); | |
| 195 if (!properties.contains(CSSPropertyOpacity)) | |
| 196 properties.append(CSSPropertyOpacity); | |
| 197 if (!properties.contains(CSSPropertyTransform)) | |
| 198 properties.append(CSSPropertyTransform); | |
| 199 style.setWillChangeProperties(properties); | |
|
Ian Vollick
2015/11/11 01:36:32
trchen@ just pointed out that this is wrong. It wi
| |
| 200 } | |
| 201 | |
| 184 // Make sure our z-index value is only applied if the object is positioned. | 202 // Make sure our z-index value is only applied if the object is positioned. |
| 185 if (style.position() == StaticPosition && !parentStyleForcesZIndexToCreateSt ackingContext(parentStyle)) | 203 if (style.position() == StaticPosition && !parentStyleForcesZIndexToCreateSt ackingContext(parentStyle)) |
| 186 style.setHasAutoZIndex(); | 204 style.setHasAutoZIndex(); |
| 187 | 205 |
| 188 // Auto z-index becomes 0 for the root element and transparent objects. This prevents | 206 // Auto z-index becomes 0 for the root element and transparent objects. This prevents |
| 189 // cases where objects that should be blended as a single unit end up with a non-transparent | 207 // cases where objects that should be blended as a single unit end up with a non-transparent |
| 190 // object wedged in between them. Auto z-index also becomes 0 for objects th at specify transforms/masks/reflections. | 208 // object wedged in between them. Auto z-index also becomes 0 for objects th at specify transforms/masks/reflections. |
| 191 if (style.hasAutoZIndex() && ((element && element->document().documentElemen t() == element) | 209 if (style.hasAutoZIndex() && ((element && element->document().documentElemen t() == element) |
| 192 || style.hasOpacity() | 210 || style.hasOpacity() |
| 193 || style.hasTransformRelatedProperty() | 211 || style.hasTransformRelatedProperty() |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 484 // We want to count vertical percentage paddings/margins on flex items b ecause our current | 502 // We want to count vertical percentage paddings/margins on flex items b ecause our current |
| 485 // behavior is different from the spec and we want to gather compatibili ty data. | 503 // behavior is different from the spec and we want to gather compatibili ty data. |
| 486 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t()) | 504 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t()) |
| 487 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical); | 505 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical); |
| 488 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( )) | 506 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( )) |
| 489 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal); | 507 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal); |
| 490 } | 508 } |
| 491 } | 509 } |
| 492 | 510 |
| 493 } | 511 } |
| OLD | NEW |