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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 5 11:40:46 PDT 2022


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

--- Comment #3 from Devin Rousso <drousso at apple.com> ---
Comment on attachment 456340
  --> https://bugs.webkit.org/attachment.cgi?id=456340
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=456340&action=review

Can you please add a comment in the ChangeLog explaining why this is desired/necessary?

> 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;   
    },
});
```

-- 
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/20220405/413c7170/attachment.htm>


More information about the webkit-unassigned mailing list