| Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
|
| index 42d0cb93ce21beee0ffb1afea870788548b22afd..4f6497cd45ddc1ad86f007ba3db16886d9f491a3 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
|
| @@ -1207,6 +1207,11 @@ void PaintPropertyTreeBuilder::UpdatePaintProperties(
|
| }
|
| }
|
|
|
| +static inline bool ObjectTypeMightNeedPaintProperties(
|
| + const LayoutObject& object) {
|
| + return object.IsBoxModelObject() || object.IsSVG();
|
| +}
|
| +
|
| void PaintPropertyTreeBuilder::UpdatePropertiesForSelf(
|
| const LayoutObject& object,
|
| PaintPropertyTreeBuilderContext& full_context) {
|
| @@ -1218,7 +1223,11 @@ void PaintPropertyTreeBuilder::UpdatePropertiesForSelf(
|
| context = PaintPropertyTreeBuilderFragmentContext();
|
| }
|
|
|
| - UpdatePaintProperties(object, full_context);
|
| + bool object_type_might_need_paint_properties =
|
| + ObjectTypeMightNeedPaintProperties(object);
|
| +
|
| + if (object_type_might_need_paint_properties)
|
| + UpdatePaintProperties(object, full_context);
|
|
|
| bool is_actually_needed = false;
|
| #if DCHECK_IS_ON()
|
| @@ -1236,7 +1245,7 @@ void PaintPropertyTreeBuilder::UpdatePropertiesForSelf(
|
| object, full_context.force_subtree_update);
|
| #endif
|
|
|
| - if (object.IsBoxModelObject() || object.IsSVG()) {
|
| + if (object_type_might_need_paint_properties) {
|
| UpdateTransform(object, context, full_context.force_subtree_update);
|
| UpdateCssClip(object, context, full_context.force_subtree_update);
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| @@ -1255,7 +1264,7 @@ void PaintPropertyTreeBuilder::UpdatePropertiesForSelf(
|
| void PaintPropertyTreeBuilder::UpdatePropertiesForChildren(
|
| const LayoutObject& object,
|
| PaintPropertyTreeBuilderContext& context) {
|
| - if (!object.IsBoxModelObject() && !object.IsSVG())
|
| + if (!ObjectTypeMightNeedPaintProperties(object))
|
| return;
|
|
|
| for (auto& fragment_context : context.fragments) {
|
|
|