CSSStyleDeclaration: Stop calling ScriptState::ContextIsValid() in the setter
When the custom bindings were removed in commit 5b84e88a ("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 Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> Reviewed-by:Yuki Shiino <yukishiino@chromium.org> Reviewed-by:
Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#567310}
Showing
Please register or sign in to comment