Steps to reproduce: (1) Open a tab and navigate to any URL; (2) Run the following code in the Console of Devtools: ``` obj = getComputedStyle(new Audio()); obj.overscrollBehaviorX = ''; ``` Actual results: This code would be evaluated successfully without throwing any exceptions. Expected results: In my test, Chrome and Firefox would throw exceptions: Chrome: `DOMException: Failed to set the 'overscroll-behavior-x' property on 'CSSStyleDeclaration': These styles are computed, and therefore the 'overscroll-behavior-x' property is read-only.` Firefox: `CSS2Properties.overscrollBehaviorX setter: Can't set value for property 'overscroll-behavior-x' in computed style` It seems better for Webkit to align with Chrome and Firefox.
`obj.setProperty("overscrollBehaviorX", '');` does throw but `obj.overscrollBehaviorX = '';` does not.
(In reply to Chris Dumez from comment #1) > `obj.setProperty("overscrollBehaviorX", '');` does throw but > `obj.overscrollBehaviorX = '';` does not. We don't seem to have a named property setter (only a named getter), and neither does the spec: https://drafts.csswg.org/cssom/#the-cssstyledeclaration-interface However, Chrome has one: [CEReactions, CallWith=ScriptState] setter void (DOMString property, [TreatNullAs=EmptyString] DOMString propertyValue);
Named properties are now handled by the generated IDL file named CSSStyleDeclaration+PropertyNames.idl. For this specific property it is: [CEReactions, DelegateToSharedSyntheticAttribute=propertyValueForCamelCasedIDLAttribute, CallWith=PropertyName, EnabledBySetting=overscrollBehavior] attribute [LegacyNullToEmptyString] CSSOMString overscrollBehaviorX; This is part of the camel cased variant, so the spec for this is: https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-camel_cased_attribute For setting, the spec says: Setting the camel-cased attribute attribute must invoke setProperty() with the first argument being the result of running the IDL attribute to CSS property algorithm for camel-cased attribute, as second argument the given value, and no third argument. Any exceptions thrown must be re-thrown. So it seems like something is busted with setPropertyValueForCamelCasedIDLAttribute()? I can look into this.
Oh, actually, this is probably due to OverscrollBehaviorEnabled being disabled, in which case this is behaving correctly. If OverscrollBehaviorEnabled is disable, the property case behaves as if there is nothing called obj.overscrollBehaviorX, so just the same as obj.fakeProperty = 1 would. It sets an "expando" / custom property on the object. If OverscrollBehaviorEnabled is enabled, this will throw, as the property exists and is readonly due to the declaration being a computed style. My guess is that chrome and Firefox have support for overscroll-behavior-x enabled by default. I think this is behaves correctly.
*** This bug has been marked as a duplicate of bug 176454 ***