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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp

Issue 2065233002: Force flattening for elements with non-initial value of opacity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 style.adjustMaskLayers(); 214 style.adjustMaskLayers();
215 215
216 // Let the theme also have a crack at adjusting the style. 216 // Let the theme also have a crack at adjusting the style.
217 if (style.hasAppearance()) 217 if (style.hasAppearance())
218 LayoutTheme::theme().adjustStyle(style, element); 218 LayoutTheme::theme().adjustStyle(style, element);
219 219
220 // If we have first-letter pseudo style, transitions, or animations, do not share this style. 220 // If we have first-letter pseudo style, transitions, or animations, do not share this style.
221 if (style.hasPseudoStyle(PseudoIdFirstLetter) || style.transitions() || styl e.animations()) 221 if (style.hasPseudoStyle(PseudoIdFirstLetter) || style.transitions() || styl e.animations())
222 style.setUnique(); 222 style.setUnique();
223 223
224 // FIXME: when dropping the -webkit prefix on transform-style, we should als o have opacity < 1 cause flattening.
225 if (style.preserves3D() && (style.overflowX() != OverflowVisible
226 || style.overflowY() != OverflowVisible
227 || style.hasFilterInducingProperty()))
228 style.setTransformStyle3D(TransformStyle3DFlat);
229
230 adjustStyleForEditing(style); 224 adjustStyleForEditing(style);
231 225
232 bool isSVGElement = element && element->isSVGElement(); 226 bool isSVGElement = element && element->isSVGElement();
233 if (isSVGElement) { 227 if (isSVGElement) {
234 // Only the root <svg> element in an SVG document fragment tree honors c ss position 228 // Only the root <svg> element in an SVG document fragment tree honors c ss position
235 if (!(isSVGSVGElement(*element) && element->parentNode() && !element->pa rentNode()->isSVGElement())) 229 if (!(isSVGSVGElement(*element) && element->parentNode() && !element->pa rentNode()->isSVGElement()))
236 style.setPosition(ComputedStyle::initialPosition()); 230 style.setPosition(ComputedStyle::initialPosition());
237 231
238 // SVG text layout code expects us to be a block-level style element. 232 // SVG text layout code expects us to be a block-level style element.
239 if ((isSVGForeignObjectElement(*element) || isSVGTextElement(*element)) && style.isDisplayInlineType()) 233 if ((isSVGForeignObjectElement(*element) || isSVGTextElement(*element)) && style.isDisplayInlineType())
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 // We want to count vertical percentage paddings/margins on flex items b ecause our current 451 // We want to count vertical percentage paddings/margins on flex items b ecause our current
458 // behavior is different from the spec and we want to gather compatibili ty data. 452 // behavior is different from the spec and we want to gather compatibili ty data.
459 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t()) 453 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t())
460 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical); 454 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical);
461 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( )) 455 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( ))
462 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal); 456 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal);
463 } 457 }
464 } 458 }
465 459
466 } // namespace blink 460 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698