Commit d4291f6e authored by Luna Lu's avatar Luna Lu Committed by Commit Bot

Add unsized-media to feature policy.

unsized-media sets a default size for laying out intrinsically sized
images / videos.
The feature is allowed for all origins by default.
When disabled, any intrinsically sized images / videos will be using
the default dimension (300 x 150) to prevent relayout.

Bug: 623682
Change-Id: I1bd105ded2580349e2a2b177e87b70417403cb59
Reviewed-on: https://chromium-review.googlesource.com/865159Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarIan Clelland <iclelland@chromium.org>
Commit-Queue: Luna Lu <loonybear@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532496}
parent ec31db29
...@@ -493,6 +493,11 @@ ...@@ -493,6 +493,11 @@
"base": "http/tests/feature-policy-experimental-features", "base": "http/tests/feature-policy-experimental-features",
"args": ["--enable-blink-features=FeaturePolicy,FeaturePolicyExperimentalFeatures"] "args": ["--enable-blink-features=FeaturePolicy,FeaturePolicyExperimentalFeatures"]
}, },
{
"prefix": "feature-policy-experimental-features",
"base": "external/wpt/feature-policy/experimental-features",
"args": ["--enable-blink-features=FeaturePolicy,FeaturePolicyExperimentalFeatures"]
},
{ {
"prefix": "mojo-localstorage", "prefix": "mojo-localstorage",
"base": "external/wpt/webstorage", "base": "external/wpt/webstorage",
......
<!DOCTYPE html>
<body>
<script>
window.addEventListener('load', function() {
var img = document.createElement('IMG');
img.setAttribute("src", "/feature-policy/experimental-features/resources/image.jpg");
img.addEventListener('load', function() {
parent.postMessage({width: img.width, height: img.height}, '*');
});
document.body.appendChild(img);
});
</script>
</body>
<?xml version="1.0" standalone="yes"?>
<svg version="1.1" viewBox="0.0 0.0 960.0 720.0" fill="none" stroke="none" stroke-linecap="square" stroke-miterlimit="10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M267.88715 112.77165L267.88715 112.77165C267.88715 93.211205 283.74402 77.35433 303.30447 77.35433L303.30447 77.35433C312.69772 77.35433 321.70627 81.085785 328.3483 87.72782C334.99033 94.36986 338.72177 103.378395 338.72177 112.77165L338.72177 112.77165C338.72177 132.3321 322.8649 148.18898 303.30447 148.18898L303.30447 148.18898C283.74402 148.18898 267.88715 132.3321 267.88715 112.77165Z" fill-rule="nonzero" fill="#cfe2f3" stroke="#073763" stroke-width="2.0" stroke-linejoin="round" stroke-linecap="butt"></path><path d="M294.15125 114.47782L295.1825 114.61845Q295.01062 115.68095 294.3075 116.29032Q293.60437 116.8997 292.58875 116.8997Q291.3075 116.8997 290.53406 116.06376Q289.76062 115.22782 289.76062 113.66532Q289.76062 112.66532 290.09656 111.90751Q290.4325 111.1497 291.11218 110.7747Q291.79187 110.3997 292.60437 110.3997Q293.60437 110.3997 294.2528 110.90751Q294.90125 111.41532 295.08875 112.36845L294.0575 112.5247Q293.91687 111.8997 293.54187 111.579384Q293.16687 111.25907 292.63562 111.25907Q291.83875 111.25907 291.33875 111.829384Q290.83875 112.3997 290.83875 113.63407Q290.83875 114.8997 291.32312 115.4622Q291.8075 116.0247 292.57312 116.0247Q293.19812 116.0247 293.61218 115.6497Q294.02625 115.2747 294.15125 114.47782ZM296.08875 109.38407L296.08875 108.16532L297.15125 108.16532L297.15125 109.38407L296.08875 109.38407ZM296.08875 116.75907L296.08875 110.54032L297.15125 110.54032L297.15125 116.75907L296.08875 116.75907ZM298.745 116.75907L298.745 110.54032L299.69812 110.54032L299.69812 111.47782Q300.0575 110.82157 300.36218 110.610634Q300.66687 110.3997 301.04187 110.3997Q301.57312 110.3997 302.12 110.72782L301.76062 111.7122Q301.37 111.47782 300.995 111.47782Q300.63562 111.47782 300.36218 111.68876Q300.08875 111.8997 299.97937 112.2747Q299.79187 112.8372 299.79187 113.49345L299.79187 116.75907L298.745 116.75907ZM306.82312 114.47782L307.85437 114.61845Q307.6825 115.68095 306.97937 116.29032Q306.27625 116.8997 305.26062 116.8997Q303.97937 116.8997 303.20593 116.06376Q302.4325 115.22782 302.4325 113.66532Q302.4325 112.66532 302.76843 111.90751Q303.10437 111.1497 303.78406 110.7747Q304.46375 110.3997 305.27625 110.3997Q306.27625 110.3997 306.92468 110.90751Q307.57312 111.41532 307.76062 112.36845L306.72937 112.5247Q306.58875 111.8997 306.21375 111.579384Q305.83875 111.25907 305.3075 111.25907Q304.51062 111.25907 304.01062 111.829384Q303.51062 112.3997 303.51062 113.63407Q303.51062 114.8997 303.995 115.4622Q304.47937 116.0247 305.245 116.0247Q305.87 116.0247 306.28406 115.6497Q306.69812 115.2747 306.82312 114.47782ZM308.72937 116.75907L308.72937 108.16532L309.79187 108.16532L309.79187 116.75907L308.72937 116.75907ZM315.66687 114.75907L316.76062 114.88407Q316.51062 115.8372 315.8075 116.36845Q315.10437 116.8997 314.02625 116.8997Q312.66687 116.8997 311.86218 116.05595Q311.0575 115.2122 311.0575 113.69657Q311.0575 112.13407 311.87 111.266884Q312.6825 110.3997 313.96375 110.3997Q315.21375 110.3997 316.0028 111.24345Q316.79187 112.0872 316.79187 113.63407Q316.79187 113.72782 316.79187 113.91532L312.15125 113.91532Q312.21375 114.94657 312.72937 115.485634Q313.245 116.0247 314.02625 116.0247Q314.60437 116.0247 315.01843 115.72001Q315.4325 115.41532 315.66687 114.75907ZM312.21375 113.05595L315.6825 113.05595Q315.62 112.25907 315.29187 111.86845Q314.77625 111.25907 313.97937 111.25907Q313.245 111.25907 312.7528 111.74345Q312.26062 112.22782 312.21375 113.05595Z" fill-rule="nonzero" fill="#000000"></path></svg>
This is a testharness.js-based test.
FAIL Test image with attribute undefined=undefined and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.jpg assert_equals: width: expected 300 but got 64
FAIL Test image with attribute undefined=undefined and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.png assert_equals: width: expected 300 but got 32
FAIL Test image with attribute undefined=undefined and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.svg assert_equals: width: expected 300 but got 769
FAIL Test video with attribute undefined=undefined and attribute undefined=undefined assert_equals: width: expected 300 but got 320
FAIL Test image with attribute width=500 and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.jpg assert_equals: height: expected 150 but got 500
FAIL Test image with attribute width=500 and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.png assert_equals: height: expected 150 but got 500
FAIL Test image with attribute width=500 and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.svg assert_equals: height: expected 150 but got 375
FAIL Test video with attribute width=500 and attribute undefined=undefined assert_equals: height: expected 150 but got 375
FAIL Test image with attribute height=800 and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.jpg assert_equals: width: expected 300 but got 800
FAIL Test image with attribute height=800 and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.png assert_equals: width: expected 300 but got 800
FAIL Test image with attribute height=800 and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.svg assert_equals: width: expected 300 but got 1067
FAIL Test video with attribute height=800 and attribute undefined=undefined assert_equals: width: expected 300 but got 1066.65625
FAIL Test image with attribute style=width:500px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.jpg assert_equals: height: expected 150 but got 500
FAIL Test image with attribute style=width:500px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.png assert_equals: height: expected 150 but got 500
FAIL Test image with attribute style=width:500px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.svg assert_equals: height: expected 150 but got 375
FAIL Test video with attribute style=width:500px; and attribute undefined=undefined assert_equals: height: expected 150 but got 375
FAIL Test image with attribute style=height:800px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.jpg assert_equals: width: expected 300 but got 800
FAIL Test image with attribute style=height:800px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.png assert_equals: width: expected 300 but got 800
FAIL Test image with attribute style=height:800px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.svg assert_equals: width: expected 300 but got 1067
FAIL Test video with attribute style=height:800px; and attribute undefined=undefined assert_equals: width: expected 300 but got 1066.65625
PASS Test image with attribute width=500 and attribute height=800 on src /feature-policy/experimental-features/resources/image.jpg
PASS Test image with attribute width=500 and attribute height=800 on src /feature-policy/experimental-features/resources/image.png
PASS Test image with attribute width=500 and attribute height=800 on src /feature-policy/experimental-features/resources/image.svg
PASS Test video with attribute width=500 and attribute height=800
PASS Test image with attribute style=width:500px;height:800px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.jpg
PASS Test image with attribute style=width:500px;height:800px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.png
PASS Test image with attribute style=width:500px;height:800px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.svg
PASS Test video with attribute style=width:500px;height:800px; and attribute undefined=undefined
FAIL Test image size is correctly rendered in iframe of src /feature-policy/experimental-features/resources/feature-policy-image.html assert_equals: width expected 300 but got 64
FAIL Test image size is correctly rendered in iframe of src https://www.web-platform.test:8444/feature-policy/experimental-features/resources/feature-policy-image.html assert_equals: width expected 300 but got 64
Harness: the test ran to completion.
<!DOCTYPE html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe></iframe>
<script>
'use strict';
const default_width = 300;
const default_height = 150;
const srcs = [
"/feature-policy/experimental-features/resources/image.jpg",
"/feature-policy/experimental-features/resources/image.png",
"/feature-policy/experimental-features/resources/image.svg"
];
const test_cases = [
// Test when no size is specified, img/video is laid out by the default size.
{expected_width: default_width, expected_height: default_height},
// Test when only one dimension is specified, img/video uses the default length for
// the other dimension.
{attribute: "width", value: 500, expected_width: 500, expected_height: default_height},
{attribute: "height", value: 800, expected_width: default_width, expected_height: 800},
// Test when only one dimension is specified by CSS style, img/video uses the
// default length for the other dimension.
{attribute: "style", value: "width:500px;", expected_width: 500, expected_height: default_height},
{attribute: "style", value: "height:800px;", expected_width: default_width, expected_height: 800},
// Test when the size of the image is specified, img/video is laid out by the
// specified size.
{attribute: "width", value: 500, attribute1: "height", value1: 800, expected_width: 500, expected_height:800},
{attribute: "style", value: "width:500px;height:800px;", expected_width: 500, expected_height:800}
];
for (var test of test_cases) {
for (var src of srcs) {
async_test(t=> {
var img = document.createElement('IMG');
var expected_width = test.expected_width;
var expected_height = test.expected_height;
img.setAttribute("src", src);
if (typeof test.attribute !== "undefined") {
img.setAttribute(test.attribute, test.value);
}
if (typeof test.attribute1 !== "undefined") {
img.setAttribute(test.attribute1, test.value1);
}
img.addEventListener('load', t.step_func(function() {
assert_equals(img.width, expected_width, 'width:');
assert_equals(img.height, expected_height, 'height:');
t.done();
}));
document.body.appendChild(img);
}, 'Test image with attribute ' + test.attribute + '=' + test.value +
' and attribute ' + test.attribute1 + '=' + test.value1 + ' on src ' + src);
}
async_test(t=> {
var video = document.createElement('video');
video.addEventListener('canplaythrough', t.step_func(function() {
assert_equals(video.getBoundingClientRect().width, expected_width, 'width:');
assert_equals(video.getBoundingClientRect().height, expected_height, 'height:');
t.done();
}));
var expected_width = test.expected_width;
var expected_height = test.expected_height;
video.setAttribute("src", "/feature-policy/experimental-features/resources/video.ogv");
if (typeof test.attribute !== "undefined") {
video.setAttribute(test.attribute, test.value);
}
if (typeof test.attribute1 !== "undefined") {
video.setAttribute(test.attribute1, test.value1);
}
document.body.appendChild(video);
}, 'Test video with attribute ' + test.attribute + '=' + test.value +
' and attribute ' + test.attribute1 + '=' + test.value1);
}
// Test unsized-image works in local and remote iframes.
var iframe = document.querySelector('iframe');
var iframe_srcs = [
"/feature-policy/experimental-features/resources/feature-policy-image.html",
"https://{{domains[www]}}:{{ports[https][0]}}/feature-policy/experimental-features/resources/feature-policy-image.html"];
for (var src of iframe_srcs) {
promise_test(function() {
iframe.src = src;
return new Promise(function(resolve, reject) {
window.addEventListener('message', function(e) {
resolve(e.data);
});
}).then(function(data) {
assert_equals(data.width, default_width, 'width');
assert_equals(data.height, default_height, 'height');
});
}, 'Test image size is correctly rendered in iframe of src ' + src);
}
</script>
</body>
This is a testharness.js-based test.
PASS Test image with attribute undefined=undefined and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.jpg
PASS Test image with attribute undefined=undefined and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.png
PASS Test image with attribute undefined=undefined and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.svg
PASS Test video with attribute undefined=undefined and attribute undefined=undefined
PASS Test image with attribute width=500 and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.jpg
PASS Test image with attribute width=500 and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.png
PASS Test image with attribute width=500 and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.svg
PASS Test video with attribute width=500 and attribute undefined=undefined
PASS Test image with attribute height=800 and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.jpg
PASS Test image with attribute height=800 and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.png
PASS Test image with attribute height=800 and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.svg
PASS Test video with attribute height=800 and attribute undefined=undefined
PASS Test image with attribute style=width:500px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.jpg
PASS Test image with attribute style=width:500px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.png
PASS Test image with attribute style=width:500px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.svg
PASS Test video with attribute style=width:500px; and attribute undefined=undefined
PASS Test image with attribute style=height:800px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.jpg
PASS Test image with attribute style=height:800px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.png
PASS Test image with attribute style=height:800px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.svg
PASS Test video with attribute style=height:800px; and attribute undefined=undefined
PASS Test image with attribute width=500 and attribute height=800 on src /feature-policy/experimental-features/resources/image.jpg
PASS Test image with attribute width=500 and attribute height=800 on src /feature-policy/experimental-features/resources/image.png
PASS Test image with attribute width=500 and attribute height=800 on src /feature-policy/experimental-features/resources/image.svg
PASS Test video with attribute width=500 and attribute height=800
PASS Test image with attribute style=width:500px;height:800px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.jpg
PASS Test image with attribute style=width:500px;height:800px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.png
PASS Test image with attribute style=width:500px;height:800px; and attribute undefined=undefined on src /feature-policy/experimental-features/resources/image.svg
PASS Test video with attribute style=width:500px;height:800px; and attribute undefined=undefined
PASS Test image size is correctly rendered in iframe of src /feature-policy/experimental-features/resources/feature-policy-image.html
PASS Test image size is correctly rendered in iframe of src https://www.web-platform.test:8444/feature-policy/experimental-features/resources/feature-policy-image.html
Harness: the test ran to completion.
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "core/dom/Document.h" #include "core/dom/Document.h"
#include "core/dom/Element.h" #include "core/dom/Element.h"
#include "core/dom/NodeComputedStyle.h" #include "core/dom/NodeComputedStyle.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/LocalFrameView.h" #include "core/frame/LocalFrameView.h"
#include "core/frame/Settings.h" #include "core/frame/Settings.h"
#include "core/frame/UseCounter.h" #include "core/frame/UseCounter.h"
...@@ -49,12 +50,14 @@ ...@@ -49,12 +50,14 @@
#include "core/html/media/HTMLMediaElement.h" #include "core/html/media/HTMLMediaElement.h"
#include "core/html_names.h" #include "core/html_names.h"
#include "core/layout/LayoutObject.h" #include "core/layout/LayoutObject.h"
#include "core/layout/LayoutReplaced.h"
#include "core/layout/LayoutTheme.h" #include "core/layout/LayoutTheme.h"
#include "core/style/ComputedStyle.h" #include "core/style/ComputedStyle.h"
#include "core/style/ComputedStyleConstants.h" #include "core/style/ComputedStyleConstants.h"
#include "core/svg/SVGSVGElement.h" #include "core/svg/SVGSVGElement.h"
#include "core/svg_names.h" #include "core/svg_names.h"
#include "platform/Length.h" #include "platform/Length.h"
#include "platform/feature_policy/FeaturePolicy.h"
#include "platform/runtime_enabled_features.h" #include "platform/runtime_enabled_features.h"
#include "platform/transforms/TransformOperations.h" #include "platform/transforms/TransformOperations.h"
#include "platform/wtf/Assertions.h" #include "platform/wtf/Assertions.h"
...@@ -76,6 +79,17 @@ TouchAction AdjustTouchActionForElement(TouchAction touch_action, ...@@ -76,6 +79,17 @@ TouchAction AdjustTouchActionForElement(TouchAction touch_action,
return touch_action; return touch_action;
} }
// Returns true for elements that are either <img> or <svg> image or <video>
// that are not in an image or media document; returns false otherwise.
bool IsImageOrVideoElement(const Element* element) {
if ((IsHTMLImageElement(element) || IsSVGImageElement(element)) &&
!element->GetDocument().IsImageDocument())
return true;
if (IsHTMLVideoElement(element) && !element->GetDocument().IsMediaDocument())
return true;
return false;
}
} // namespace } // namespace
static EDisplay EquivalentBlockDisplay(EDisplay display) { static EDisplay EquivalentBlockDisplay(EDisplay display) {
...@@ -663,5 +677,18 @@ void StyleAdjuster::AdjustComputedStyle(StyleResolverState& state, ...@@ -663,5 +677,18 @@ void StyleAdjuster::AdjustComputedStyle(StyleResolverState& state,
} }
} }
} }
// If intrinsically sized images or videos are disallowed by feature policy,
// use default size (300 x 150) instead.
if (IsImageOrVideoElement(element)) {
if (IsSupportedInFeaturePolicy(FeaturePolicyFeature::kUnsizedMedia) &&
!element->GetDocument().GetFrame()->IsFeatureEnabled(
FeaturePolicyFeature::kUnsizedMedia)) {
if (!style.Width().IsSpecified())
style.SetLogicalWidth(Length(LayoutReplaced::kDefaultWidth, kFixed));
if (!style.Height().IsSpecified())
style.SetLogicalHeight(Length(LayoutReplaced::kDefaultHeight, kFixed));
}
}
} }
} // namespace blink } // namespace blink
...@@ -214,6 +214,7 @@ bool IsSupportedInFeaturePolicy(FeaturePolicyFeature feature) { ...@@ -214,6 +214,7 @@ bool IsSupportedInFeaturePolicy(FeaturePolicyFeature feature) {
case FeaturePolicyFeature::kSyncXHR: case FeaturePolicyFeature::kSyncXHR:
return true; return true;
case FeaturePolicyFeature::kVibrate: case FeaturePolicyFeature::kVibrate:
case FeaturePolicyFeature::kUnsizedMedia:
return RuntimeEnabledFeatures::FeaturePolicyExperimentalFeaturesEnabled(); return RuntimeEnabledFeatures::FeaturePolicyExperimentalFeaturesEnabled();
default: default:
return false; return false;
...@@ -255,6 +256,8 @@ const FeatureNameMap& GetDefaultFeatureNameMap() { ...@@ -255,6 +256,8 @@ const FeatureNameMap& GetDefaultFeatureNameMap() {
FeaturePolicyFeature::kDocumentWrite); FeaturePolicyFeature::kDocumentWrite);
default_feature_name_map.Set("sync-script", default_feature_name_map.Set("sync-script",
FeaturePolicyFeature::kSyncScript); FeaturePolicyFeature::kSyncScript);
default_feature_name_map.Set("unsized-media",
FeaturePolicyFeature::kUnsizedMedia);
} }
if (RuntimeEnabledFeatures::FeaturePolicyAutoplayFeatureEnabled()) { if (RuntimeEnabledFeatures::FeaturePolicyAutoplayFeatureEnabled()) {
default_feature_name_map.Set("autoplay", FeaturePolicyFeature::kAutoplay); default_feature_name_map.Set("autoplay", FeaturePolicyFeature::kAutoplay);
......
...@@ -277,7 +277,9 @@ const FeaturePolicy::FeatureList& FeaturePolicy::GetDefaultFeatureList() { ...@@ -277,7 +277,9 @@ const FeaturePolicy::FeatureList& FeaturePolicy::GetDefaultFeatureList() {
{FeaturePolicyFeature::kGyroscope, {FeaturePolicyFeature::kGyroscope,
FeaturePolicy::FeatureDefault::EnableForSelf}, FeaturePolicy::FeatureDefault::EnableForSelf},
{FeaturePolicyFeature::kMagnetometer, {FeaturePolicyFeature::kMagnetometer,
FeaturePolicy::FeatureDefault::EnableForSelf}})); FeaturePolicy::FeatureDefault::EnableForSelf},
{FeaturePolicyFeature::kUnsizedMedia,
FeaturePolicy::FeatureDefault::EnableForAll}}));
return default_feature_list; return default_feature_list;
} }
......
...@@ -81,6 +81,9 @@ enum FeaturePolicyFeature { ...@@ -81,6 +81,9 @@ enum FeaturePolicyFeature {
kAmbientLightSensor, kAmbientLightSensor,
kGyroscope, kGyroscope,
kMagnetometer, kMagnetometer,
// Controls the layout size of intrinsically sized images and videos. When
// disabled, default size (300 x 150) is used to prevent relayout.
kUnsizedMedia,
}; };
// This struct holds feature policy whitelist data that needs to be replicated // This struct holds feature policy whitelist data that needs to be replicated
......
...@@ -59,7 +59,10 @@ enum class FeaturePolicyFeature { ...@@ -59,7 +59,10 @@ enum class FeaturePolicyFeature {
kAmbientLightSensor, kAmbientLightSensor,
kGyroscope, kGyroscope,
kMagnetometer, kMagnetometer,
LAST_FEATURE = kMagnetometer // Controls the layout size of intrinsically sized images and videos. When
// disabled, default size (300 x 150) is used to prevent relayout.
kUnsizedMedia,
LAST_FEATURE = kUnsizedMedia
}; };
} // namespace blink } // namespace blink
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment