New issue
Advanced search Search tips

Issue 773921 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 786862


Show other hotlists

Hotlists containing this issue:
Hotlist-AnimationWorklet


Sign in to add a comment

Worklet: WorkletGlobalScope should inherit a referrer policy from its owner Document

Project Member Reported by nhiroki@chromium.org, Oct 12 2017

Issue description

The Worklet spec defines the referrer policy as follows:

  "5. Let inheritedReferrerPolicy be outsideSettings's referrer policy."
  https://drafts.css-houdini.org/worklets/#script-settings-for-worklets

However, our current impl sets the referrer policy to an empty String. There is a TODO comment about it in ThreadedWorkletMessagingProxy::Initialize().

  "// TODO(ikilpatrick): Decide on sensible a value for referrerPolicy."


 
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2

commit 91512c30aceafa8b9cbeab0ac1c22224ae8c67f2
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Tue Oct 24 09:16:39 2017

Worklet: Pass GlobalScopeCreationParams to the ctors of *WorkletGlobalScope

This is a cleanup and doesn't change behavior, so no tests are added.

Bug:  773921 
Change-Id: Ie5d71113a08fd038b059d12b6df59fb2073dc2cb
Reviewed-on: https://chromium-review.googlesource.com/714797
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511066}
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/core/workers/MainThreadWorkletTest.cpp
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.cpp
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.h
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/core/workers/ThreadedWorkletMessagingProxy.cpp
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/core/workers/WorkletGlobalScope.cpp
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/core/workers/WorkletGlobalScope.h
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.cpp
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.h
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThread.cpp
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.cpp
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.cpp
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h
[modify] https://crrev.com/91512c30aceafa8b9cbeab0ac1c22224ae8c67f2/third_party/WebKit/Source/modules/webaudio/AudioWorkletThread.cpp

Status: Started (was: Assigned)
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3ca81ae4072c6f63eb30850626aae7d848d13745

commit 3ca81ae4072c6f63eb30850626aae7d848d13745
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Mon Oct 30 11:36:03 2017

Worklet: Make WorkletGlobalScope inherit parent document's ReferrerPolicy

The Worklet spec defines the referrer policy as follows:

  "5. Let inheritedReferrerPolicy be outsideSettings's referrer policy."
  https://drafts.css-houdini.org/worklets/#script-settings-for-worklets

However, our current impl sets the referrer policy to an empty String. This CL
makes WorkletGlobalScope inherit outsideSettings's referrer policy, that is,
parent Document's referrer policy.

<Details of this change>

Before this CL, GlobalScopeCreationParams is created with a string representing
a referrer policy on the main thread and then it's parsed on a worker thread.
This flow doesn't match the Worklet spec because Worklets inherit the
Document's referrer policy that is already parsed. To handle it, this CL changes
GlobalScopeCreationParams's referrer policy field from a string to
ReferrerPolicy, and also changes places to parse the referrer policy header from
a worker thread to the main thread for Workers.

Also, this CL adds WPT tests for the referrer policy on Worklets.

Bug:  773921 
Change-Id: Id8b9aa6649bdd1c2851f8d64af230b24ebf1e78e
Reviewed-on: https://chromium-review.googlesource.com/737311
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512470}
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/LayoutTests/external/wpt/worklets/animation-worklet-import.html
[add] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/LayoutTests/external/wpt/worklets/animation-worklet-referrer.html
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/LayoutTests/external/wpt/worklets/paint-worklet-import.html
[add] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/LayoutTests/external/wpt/worklets/paint-worklet-referrer.html
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/LayoutTests/external/wpt/worklets/resources/import-tests.js
[add] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/LayoutTests/external/wpt/worklets/resources/referrer-tests.js
[add] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/LayoutTests/external/wpt/worklets/resources/referrer-window.html
[add] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/LayoutTests/external/wpt/worklets/resources/referrer.py
[add] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/LayoutTests/external/wpt/worklets/resources/worklet-test-utils.js
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/exported/WebSharedWorkerImpl.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/workers/DedicatedWorker.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/workers/DedicatedWorkerMessagingProxy.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/workers/DedicatedWorkerMessagingProxy.h
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/workers/DedicatedWorkerTest.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/workers/GlobalScopeCreationParams.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/workers/GlobalScopeCreationParams.h
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/workers/MainThreadWorkletTest.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/workers/ThreadedWorkletMessagingProxy.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/workers/WorkerScriptLoader.h
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/modules/animationworklet/AnimationWorkletGlobalScopeTest.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/modules/animationworklet/AnimationWorkletThreadTest.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/modules/exported/WebEmbeddedWorkerImpl.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScopeTest.cpp
[modify] https://crrev.com/3ca81ae4072c6f63eb30850626aae7d848d13745/third_party/WebKit/Source/modules/webaudio/AudioWorkletThreadTest.cpp

Labels: M-64
Status: Fixed (was: Started)
Status: Started (was: Fixed)
REOPEN: We found we need to do more work for nested import:
https://chromium-review.googlesource.com/c/chromium/src/+/754150

Blockedon: 786862
Project Member

Comment 9 by bugdroid1@chromium.org, Nov 22 2017

Project Member

Comment 10 by bugdroid1@chromium.org, Nov 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c04fad33c933b8db2ab61ea54d37cb2c5ee53535

commit c04fad33c933b8db2ab61ea54d37cb2c5ee53535
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Thu Nov 30 03:30:26 2017

Worklet: Set ReferrerPolicy in WorkletGlobalScope

This is a follow-up CL for the CL:
https://chromium-review.googlesource.com/c/chromium/src/+/737311

WorkletGlobalScope should inherit the owner Document's ReferrerPolicy and the
previous CL meant to implement it. But, the CL actually forgot to set
WorkletGlobalScope's ReferrerPolicy to the owner Document's ReferrerPolicy. This
CL does it.

One test case fails because of a bug in referrer handling on ES6 Modules. See
issue 786862 for details.

Bug:  773921 , 786862
Change-Id: I0eb95bd742c393ce6b39926ae41a9ef0ec3fc526
Reviewed-on: https://chromium-review.googlesource.com/754150
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Takeshi Yoshino <tyoshino@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520415}
[add] https://crrev.com/c04fad33c933b8db2ab61ea54d37cb2c5ee53535/third_party/WebKit/LayoutTests/external/wpt/worklets/animation-worklet-referrer.https-expected.txt
[add] https://crrev.com/c04fad33c933b8db2ab61ea54d37cb2c5ee53535/third_party/WebKit/LayoutTests/external/wpt/worklets/paint-worklet-referrer.https-expected.txt
[add] https://crrev.com/c04fad33c933b8db2ab61ea54d37cb2c5ee53535/third_party/WebKit/LayoutTests/external/wpt/worklets/resources/import-referrer-checker-worklet-script.sub.js
[add] https://crrev.com/c04fad33c933b8db2ab61ea54d37cb2c5ee53535/third_party/WebKit/LayoutTests/external/wpt/worklets/resources/import-referrer-checker-worklet-script.sub.js.headers
[add] https://crrev.com/c04fad33c933b8db2ab61ea54d37cb2c5ee53535/third_party/WebKit/LayoutTests/external/wpt/worklets/resources/import-remote-origin-referrer-checker-worklet-script.sub.js
[add] https://crrev.com/c04fad33c933b8db2ab61ea54d37cb2c5ee53535/third_party/WebKit/LayoutTests/external/wpt/worklets/resources/import-remote-origin-referrer-checker-worklet-script.sub.js.headers
[add] https://crrev.com/c04fad33c933b8db2ab61ea54d37cb2c5ee53535/third_party/WebKit/LayoutTests/external/wpt/worklets/resources/referrer-checker.py
[modify] https://crrev.com/c04fad33c933b8db2ab61ea54d37cb2c5ee53535/third_party/WebKit/LayoutTests/external/wpt/worklets/resources/referrer-tests.js
[modify] https://crrev.com/c04fad33c933b8db2ab61ea54d37cb2c5ee53535/third_party/WebKit/LayoutTests/external/wpt/worklets/resources/referrer-window.html
[delete] https://crrev.com/49f1b6c8563eaeef13628490d5f233d5f4c18094/third_party/WebKit/LayoutTests/external/wpt/worklets/resources/referrer.py
[modify] https://crrev.com/c04fad33c933b8db2ab61ea54d37cb2c5ee53535/third_party/WebKit/Source/core/workers/WorkletGlobalScope.cpp

Status: Fixed (was: Started)

Sign in to add a comment