Bug 87097 - [Chromium][API] Introduce WebPermissionClient::allowWebComponents()
Summary: [Chromium][API] Introduce WebPermissionClient::allowWebComponents()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Hajime Morrita
URL:
Keywords:
Depends on:
Blocks: 86984
  Show dependency treegraph
 
Reported: 2012-05-22 01:29 PDT by Hajime Morrita
Modified: 2012-05-22 18:57 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.62 KB, patch)
2012-05-22 01:59 PDT, Hajime Morrita
no flags Details | Formatted Diff | Diff
Patch for landing (3.61 KB, patch)
2012-05-22 17:11 PDT, Hajime Morrita
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hajime Morrita 2012-05-22 01:29:11 PDT
This is going to be an all-in-one API to turn on/off the web component features.
Comment 1 Hajime Morrita 2012-05-22 01:59:45 PDT
Created attachment 143233 [details]
Patch
Comment 2 WebKit Review Bot 2012-05-22 02:01:13 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 3 Kent Tamura 2012-05-22 02:15:18 PDT
Comment on attachment 143233 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=143233&action=review

> Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp:248
> +    return enabledAsRuntimeFeatures;

Is it safe to use this value as a fallback?
Comment 4 Dimitri Glazkov (Google) 2012-05-22 09:32:51 PDT
Comment on attachment 143233 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=143233&action=review

> Source/WebKit/chromium/public/WebPermissionClient.h:92
> +    // Controls whether enabling Web Components API for this frame.

"whether Web Components API are enabled for this frame."

> Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp:242
> +bool FrameLoaderClientImpl::shadowDOMAllowed(bool enabledAsRuntimeFeatures)

enabledAsRuntimeFeatures -> enabledAsRuntimeFeature
Comment 5 Darin Fisher (:fishd, Google) 2012-05-22 11:15:02 PDT
Comment on attachment 143233 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=143233&action=review

> Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp:246
> +        return webview->permissionClient()->allowWebComponents(m_webFrame, enabledAsRuntimeFeatures);

why are we mapping shadowDOMAllowed to allowWebComponents?  should the FrameLoaderClient method be renamed to allowWebComponents as well?  or should the API one change to say "shadow DOM" instead?
Comment 6 Dimitri Glazkov (Google) 2012-05-22 12:02:16 PDT
(In reply to comment #5)
> (From update of attachment 143233 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=143233&action=review
> 
> > Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp:246
> > +        return webview->permissionClient()->allowWebComponents(m_webFrame, enabledAsRuntimeFeatures);
> 
> why are we mapping shadowDOMAllowed to allowWebComponents?  should the FrameLoaderClient method be renamed to allowWebComponents as well?  or should the API one change to say "shadow DOM" instead?

This is a good question. Initially, I thought that we would make the decision on what flags substitute web Components at the chrome://flags UI level and check/uncheck boxes as a group.

Morrita-san's patch attempts to move it to WebKit API layer, which seems on the short term, because we don't need to go and modify the chrome://flags UI.
Comment 7 Hajime Morrita 2012-05-22 16:10:10 PDT
(In reply to comment #6)
> (In reply to comment #5)
> > (From update of attachment 143233 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=143233&action=review
> > 
> > > Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp:246
> > > +        return webview->permissionClient()->allowWebComponents(m_webFrame, enabledAsRuntimeFeatures);
> > 
> > why are we mapping shadowDOMAllowed to allowWebComponents?  should the FrameLoaderClient method be renamed to allowWebComponents as well?  or should the API one change to say "shadow DOM" instead?
> 
> This is a good question. Initially, I thought that we would make the decision on what flags substitute web Components at the chrome://flags UI level and check/uncheck boxes as a group.
> 
> Morrita-san's patch attempts to move it to WebKit API layer, which seems on the short term, because we don't need to go and modify the chrome://flags UI.
Yeah, the intention here is to let allowWebComponents to cover 
several WebCore flags, like scoped stylesheet and upcoming other features.
Comment 8 Hajime Morrita 2012-05-22 16:13:29 PDT
Comment on attachment 143233 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=143233&action=review

>> Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp:248
>> +    return enabledAsRuntimeFeatures;
> 
> Is it safe to use this value as a fallback?

Yes. This API is to relax the restriction, not to limit it.
This is going to return true for some frames even if the default is false.
Comment 9 Hajime Morrita 2012-05-22 17:11:41 PDT
Created attachment 143405 [details]
Patch for landing
Comment 10 WebKit Review Bot 2012-05-22 18:57:41 PDT
Comment on attachment 143405 [details]
Patch for landing

Clearing flags on attachment: 143405

Committed r118097: <http://trac.webkit.org/changeset/118097>
Comment 11 WebKit Review Bot 2012-05-22 18:57:48 PDT
All reviewed patches have been landed.  Closing bug.