|
|
Chromium Code Reviews
DescriptionAllows inline style in User-Agent shadow trees under CSP
When a page specifies a CSP of style-src 'self', it does not allow inline style
changes. However, the node under User-Agent shadow trees should be an exception
as developers are not allowed to modify the inline-style, but blink may need
it. So we add shadow dom elements as an exception under CSP.
BUG=648589
Committed: https://crrev.com/bf99fb1ccc22a6b037045f6174d8a113d97f1ef7
Cr-Commit-Position: refs/heads/master@{#420456}
Patch Set 1 #Patch Set 2 : Better test #
Total comments: 1
Patch Set 3 : Adds the check for user agent. #
Total comments: 1
Patch Set 4 : Check using containingShadowRoot and ShadowRootType #
Messages
Total messages: 27 (19 generated)
The CQ bit was checked by sunyunjia@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by sunyunjia@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Allows inline style in User-Agent shadow trees under CSP When a page specifies a CSP of style-src 'self', it does not allow inline style changes. However, the node under User-Agent shadow trees should be an exception as developers are not allowed to modify the inline-style, but blink may need it. So we add shadow dom elements as an exception under CSP. BUG=648589 ========== to ========== Allows inline style in User-Agent shadow trees under CSP When a page specifies a CSP of style-src 'self', it does not allow inline style changes. However, the node under User-Agent shadow trees should be an exception as developers are not allowed to modify the inline-style, but blink may need it. So we add shadow dom elements as an exception under CSP. BUG=648589 ==========
sunyunjia@chromium.org changed reviewers: + dtapuska@chromium.org, tkent@chromium.org
PTAL, thanks!
https://codereview.chromium.org/2359813002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2359813002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Element.cpp:3621: } else if (modificationReason == ModifiedByCloning || ContentSecurityPolicy::shouldBypassMainWorld(&document()) || ownerShadowHost() || document().contentSecurityPolicy()->allowInlineStyle(document().url(), String(), startLineNumber, newStyleString)) { Doesn't this allow all shadow dom trees? I think we want to ensure it is allowed only for user agent shadow dom trees. tkent@ should be able to confirm.
The CQ bit was checked by sunyunjia@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
https://codereview.chromium.org/2359813002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2359813002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Element.cpp:3621: } else if (modificationReason == ModifiedByCloning || ContentSecurityPolicy::shouldBypassMainWorld(&document()) || (ownerShadowHost() && ownerShadowHost()->userAgentShadowRoot()) || document().contentSecurityPolicy()->allowInlineStyle(document().url(), String(), startLineNumber, newStyleString)) { It doesn't work as expected if the element is in non-UA ShadowRoot. It should be containingShadowRoot() && containingShadowRoot()->type() == ShadowRootType::UserAgent
The CQ bit was checked by sunyunjia@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Thanks for pointing this out! PTAL!
lgtm
The CQ bit was checked by sunyunjia@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Allows inline style in User-Agent shadow trees under CSP When a page specifies a CSP of style-src 'self', it does not allow inline style changes. However, the node under User-Agent shadow trees should be an exception as developers are not allowed to modify the inline-style, but blink may need it. So we add shadow dom elements as an exception under CSP. BUG=648589 ========== to ========== Allows inline style in User-Agent shadow trees under CSP When a page specifies a CSP of style-src 'self', it does not allow inline style changes. However, the node under User-Agent shadow trees should be an exception as developers are not allowed to modify the inline-style, but blink may need it. So we add shadow dom elements as an exception under CSP. BUG=648589 ==========
Message was sent while issue was closed.
Committed patchset #4 (id:60001)
Message was sent while issue was closed.
Description was changed from ========== Allows inline style in User-Agent shadow trees under CSP When a page specifies a CSP of style-src 'self', it does not allow inline style changes. However, the node under User-Agent shadow trees should be an exception as developers are not allowed to modify the inline-style, but blink may need it. So we add shadow dom elements as an exception under CSP. BUG=648589 ========== to ========== Allows inline style in User-Agent shadow trees under CSP When a page specifies a CSP of style-src 'self', it does not allow inline style changes. However, the node under User-Agent shadow trees should be an exception as developers are not allowed to modify the inline-style, but blink may need it. So we add shadow dom elements as an exception under CSP. BUG=648589 Committed: https://crrev.com/bf99fb1ccc22a6b037045f6174d8a113d97f1ef7 Cr-Commit-Position: refs/heads/master@{#420456} ==========
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/bf99fb1ccc22a6b037045f6174d8a113d97f1ef7 Cr-Commit-Position: refs/heads/master@{#420456} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
