Closed Bug 1468725 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 11504 - CSSStyleDeclaration: Stop calling ScriptState::ContextIsValid() in the setter


(Core :: DOM: CSS Object Model, enhancement, P4)




Tracking Status
firefox63 --- fixed


(Reporter:, Unassigned)




(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 11504 into mozilla-central (this bug is closed when the sync is complete).

Details from upstream follow.

Raphael Kubo da Costa <> wrote:
>  CSSStyleDeclaration: Stop calling ScriptState::ContextIsValid() in the setter
>  When the custom bindings were removed in commit 5b84e88a0 ("Remove custom
>  bindings for CSSStyleDeclaration"), the new anonymous setter code added a
>  check for ScriptState::ContextIsValid() to ensure it had received a valid
>  |script_state|.
>  It turns out this check is too strict, as in addition to verifying a
>  ScriptState has an associated v8::Context it also asserts the ScriptState
>  has a valid |per_context_data_|.
>  This is valid in most cases, but when a node is moved across different
>  documents and its previous document gets removed its |per_context_data_| is
>  disposed of and ScriptState::ContextIsValid() fails.
>  Since the anonymous setter is only invoked by the bindings layer, we can
>  assume it is passed a ScriptState that is in a minimally usable state, so it
>  is possible to relax the ContextIsValid() check and only make sure we can
>  get a valid ExecutionContext from the ScriptState.
>  Bug: 852190
>  Change-Id: I307de0e003e5258bf1f670b26f1dc86e4dae9286
>  Reviewed-on:
>  WPT-Export-Revision: 4eac66618a9160f7fe8bb9330cdda301f2096829
Component: web-platform-tests → DOM: CSS Object Model
Product: Testing → Core
Ran 1 tests and 1 subtests
OK     : 1
PASS   : 1
Pushed by
[wpt PR 11504] - CSSStyleDeclaration: Stop calling ScriptState::ContextIsValid() in the setter, a=testonly
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.