From 8d46625ef3530ce170174493759f735c736ed57a Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Mon, 16 Dec 2024 00:58:20 +0000 Subject: [PATCH] Bug 1936957 - Avoid a redundant GetProperty(nsGkAtoms::DisplayPortMargins) call in HasNonMinimalNonZeroDisplayPort. r=tnikkel Differential Revision: https://phabricator.services.mozilla.com/D232024 UltraBlame original commit: 1a7e4ea52fc2be6f92755c1ba2438cd87a39dc0e --- layout/base/DisplayPortUtils.cpp | 44 ++++++++++++++------------------ 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/layout/base/DisplayPortUtils.cpp b/layout/base/DisplayPortUtils.cpp index 9179a45f88ce..afec3b3b85c7 100644 --- a/layout/base/DisplayPortUtils.cpp +++ b/layout/base/DisplayPortUtils.cpp @@ -3304,12 +3304,28 @@ return false ; } +DisplayPortPropertyData +* +rectData += +nullptr +; +DisplayPortMarginsPropertyData +* +marginsData += +nullptr +; if ( ! -HasDisplayPort +GetDisplayPortData ( aContent +& +rectData +& +marginsData ) ) { @@ -3317,32 +3333,10 @@ return false ; } -DisplayPortMarginsPropertyData -* -currentData -= -static_cast -< -DisplayPortMarginsPropertyData -* -> -( -aContent -- -> -GetProperty -( -nsGkAtoms -: -: -DisplayPortMargins -) -) -; if ( ! -currentData +marginsData ) { / @@ -3403,7 +3397,7 @@ true } if ( -currentData +marginsData - > mMargins