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

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

Issue 1405993008: compositor-worker: plumb element id and mutable properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/WebMutable/WebCompositorMutable/g Created 5 years, 1 month 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "core/html/HTMLPlugInElement.h" 42 #include "core/html/HTMLPlugInElement.h"
43 #include "core/html/HTMLTableCellElement.h" 43 #include "core/html/HTMLTableCellElement.h"
44 #include "core/html/HTMLTextAreaElement.h" 44 #include "core/html/HTMLTextAreaElement.h"
45 #include "core/layout/LayoutReplaced.h" 45 #include "core/layout/LayoutReplaced.h"
46 #include "core/layout/LayoutTheme.h" 46 #include "core/layout/LayoutTheme.h"
47 #include "core/style/ComputedStyle.h" 47 #include "core/style/ComputedStyle.h"
48 #include "core/style/ComputedStyleConstants.h" 48 #include "core/style/ComputedStyleConstants.h"
49 #include "core/svg/SVGSVGElement.h" 49 #include "core/svg/SVGSVGElement.h"
50 #include "platform/Length.h" 50 #include "platform/Length.h"
51 #include "platform/transforms/TransformOperations.h" 51 #include "platform/transforms/TransformOperations.h"
52 #include "public/platform/WebCompositorMutableProperties.h"
52 #include "wtf/Assertions.h" 53 #include "wtf/Assertions.h"
53 54
54 namespace blink { 55 namespace blink {
55 56
56 using namespace HTMLNames; 57 using namespace HTMLNames;
57 58
58 static EDisplay equivalentBlockDisplay(EDisplay display, bool isFloating, bool s trictParsing) 59 static EDisplay equivalentBlockDisplay(EDisplay display, bool isFloating, bool s trictParsing)
59 { 60 {
60 switch (display) { 61 switch (display) {
61 case BLOCK: 62 case BLOCK:
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 175
175 // We don't adjust the first letter style earlier because we may change the display setting in 176 // We don't adjust the first letter style earlier because we may change the display setting in
176 // adjustStyeForTagName() above. 177 // adjustStyeForTagName() above.
177 adjustStyleForFirstLetter(style); 178 adjustStyleForFirstLetter(style);
178 179
179 adjustStyleForDisplay(style, parentStyle, element ? &element->document() : 0); 180 adjustStyleForDisplay(style, parentStyle, element ? &element->document() : 0);
180 } else { 181 } else {
181 adjustStyleForFirstLetter(style); 182 adjustStyleForFirstLetter(style);
182 } 183 }
183 184
185 if (element && element->hasCompositorProxy()) {
chrishtr 2015/11/24 16:22:50 Factor into another method, this one is getting to
Ian Vollick 2015/11/25 18:28:44 Done.
186 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), "StyleAdjus ter::adjustComputedStyle hasCompositorProxy");
187
188 style.setHasCompositorProxy(true);
189 uint32_t mutableProperties = element->mutableProperties();
190 if (mutableProperties & (WebCompositorMutablePropertyScrollTop | WebComp ositorMutablePropertyScrollLeft))
191 style.setWillChangeScrollPosition(true);
ajuma 2015/11/20 21:55:27 will-change:scroll-position doesn't currently crea
Ian Vollick 2015/11/23 20:25:54 Ah, whoops. Yes, the composited layer _doesn't_ ac
chrishtr 2015/11/24 16:22:50 Was Ali's comment addressed? Not sure how to read
Ian Vollick 2015/11/25 18:28:44 I was trying to say that will-change does not play
192 Vector<CSSPropertyID> properties = style.willChangeProperties();
193 if ((mutableProperties & WebCompositorMutablePropertyOpacity) && !proper ties.contains(CSSPropertyOpacity))
194 properties.append(CSSPropertyOpacity);
195 if ((mutableProperties & WebCompositorMutablePropertyTransform) && !prop erties.contains(CSSPropertyTransform))
196 properties.append(CSSPropertyTransform);
197 style.setWillChangeProperties(properties);
198 }
199
184 // Make sure our z-index value is only applied if the object is positioned. 200 // Make sure our z-index value is only applied if the object is positioned.
185 if (style.position() == StaticPosition && !parentStyleForcesZIndexToCreateSt ackingContext(parentStyle)) 201 if (style.position() == StaticPosition && !parentStyleForcesZIndexToCreateSt ackingContext(parentStyle))
186 style.setHasAutoZIndex(); 202 style.setHasAutoZIndex();
187 203
188 // Auto z-index becomes 0 for the root element and transparent objects. This prevents 204 // 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 205 // 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. 206 // 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) 207 if (style.hasAutoZIndex() && ((element && element->document().documentElemen t() == element)
192 || style.hasOpacity() 208 || style.hasOpacity()
193 || style.hasTransformRelatedProperty() 209 || style.hasTransformRelatedProperty()
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 // We want to count vertical percentage paddings/margins on flex items b ecause our current 500 // 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. 501 // behavior is different from the spec and we want to gather compatibili ty data.
486 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t()) 502 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t())
487 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical); 503 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical);
488 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( )) 504 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( ))
489 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal); 505 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal);
490 } 506 }
491 } 507 }
492 508
493 } 509 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698