Closed Bug 1468725 Opened 2 years ago Closed 2 years ago

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

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

PR: https://github.com/web-platform-tests/wpt/pull/11504
Details from upstream follow.

Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> 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: https://chromium-review.googlesource.com/1100836
>  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 james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/443ab707c354
[wpt PR 11504] - CSSStyleDeclaration: Stop calling ScriptState::ContextIsValid() in the setter, a=testonly
https://hg.mozilla.org/mozilla-central/rev/443ab707c354
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.