[Webkit-unassigned] [Bug 238661] Web Inspector: Use computedStyleMap() instead of deprecated getPropertyCSSValue()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 6 01:03:59 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=238661

--- Comment #6 from Carlos Garcia Campos <cgarcia at igalia.com> ---
(In reply to Devin Rousso from comment #5)
> Comment on attachment 456340 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=456340&action=review
> 
> >>> Source/WebKit/WebProcess/Inspector/WebInspectorUI.cpp:65
> >>> +    page.corePage()->settings().setCSSTypedOMEnabled(true);
> >> 
> >> Since this is not something enabled by default, we should ensure that the frontend doesn't break if this is disabled.  Could we create a helper function that still uses the old behavior if this isn't enabled?  Something like:
> >> ```
> >> Object.defineProperty(Element.prototype, "getComputedCSSPropertyNumberValue", {
> >>     value(property) {
> >>         let result = undefined;
> >>         result ??= this.computedStyleMap?.().get(property)?.value;
> >>         result ??= window.getComputedStyle(this).getPropertyCSSValue(property)?.getFloatValue(CSSPrimitiveValue.CSS_PX);
> >>         return result;   
> >>     },
> >> });
> >> ```
> > 
> > Doesn't the setting ensure it's always enabled in the inspector frontend? or do you mean adding the helper instead of changing the setting?
> 
> Oh sorry I wasn't entirely clear.  This relies on *both* the setting and
> `ENABLE_CSS_TYPED_OM`.  I was more concerned with about if
> `ENABLE_CSS_TYPED_OM` is not enabled (for whatever reason).  If/When the
> build flag is removed, then we can remove the fallback code.

I'm not familiar with xcode build system, but I think CSS_TYPED_OM is enabled unconditionally in PlatformEnableCocoa.h (or can that be overridden with xcode magic?). And I enabled it by default for GTK and WPE ports too.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220406/5dc38c89/attachment-0001.htm>


More information about the webkit-unassigned mailing list