fix(js): bind computed style methods passed through to the declaration - #636
Open
marcoripa96 wants to merge 1 commit into
Open
fix(js): bind computed style methods passed through to the declaration#636marcoripa96 wants to merge 1 commit into
marcoripa96 wants to merge 1 commit into
Conversation
getComputedStyle wraps the element's live style proxy, and its get trap handed pass-through methods back unbound. Called through the computed object, setProperty/removeProperty then ran _pull() with `this` bound to the wrapper, where the declaration's own fields (_loaded, _owner) miss the style proxy's has trap and read as "" from the CSS lookup, so the call threw "this._owner.getAttribute is not a function". getPropertyValue/item/length already have computed fallbacks ahead of the passthrough; bind whatever still falls through to the declaration. Adds a regression test covering every method reachable through the computed proxy on a v0.1.11-era failure (jQuery curCSS reads computed.getPropertyValue, so .css() and .show() crashed on real sites). Fixes h4ckf0r0day#635
This was referenced Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #635.
getComputedStylewraps the element's live style proxy, and itsgettrap handed pass-through methods back unbound. Called through the computed object,setProperty/removePropertythen ran_pull()withthisbound to the wrapper, where the declaration's own fields (_loaded,_owner) miss the style proxy'shastrap and read as""from the CSS lookup, so the call threwTypeError: this._owner.getAttribute is not a function.On current main the
getPropertyValue/item/length/cssTextnames already have computed fallbacks ahead of the passthrough (since the geometry/computed-styles work), which fixed the jQuery.css()/.show()symptom described in the issue for main. This PR closes the remaining hole by binding whatever still falls through to the declaration, and adds a regression test covering every method reachable through the computed proxy so the v0.1.11 failure mode cannot come back.Test plan:
cargo nextest run -p obscura -E 'test(computed_style_methods)': fails on main atset_propertywith the_ownerTypeError, passes with the fix.cargo nextest run -p obscura -p obscura-cdp -p obscura-cli -p obscura-mcp: 196 passed, 3 skipped.observer-intersectionstage fails identically on unpatched main (verified by stashing the fix and rebuilding), so it is pre-existing and unrelated.