Commit f050694a authored by Reilly Grant's avatar Reilly Grant Committed by Commit Bot

Restrict Shape Detection API to Secure Contexts

This updates the WebIDL for the Shape Detection feature to match
https://github.com/WICG/shape-detection-api/pull/73.

Bug: 659138
Change-Id: I1b3acaeb1496b06a69100453c834e3f1f16d9c33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1717229
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681008}
parent bb8412ab
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
Constructor(optional BarcodeDetectorOptions barcodeDetectorOptions), Constructor(optional BarcodeDetectorOptions barcodeDetectorOptions),
ConstructorCallWith=ExecutionContext, ConstructorCallWith=ExecutionContext,
Exposed=(Window,Worker), Exposed=(Window,Worker),
SecureContext,
MeasureAs=ShapeDetection_BarcodeDetectorConstructor, MeasureAs=ShapeDetection_BarcodeDetectorConstructor,
RaisesException=Constructor, RaisesException=Constructor,
RuntimeEnabled=ShapeDetection RuntimeEnabled=ShapeDetection
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
[ [
Serializable, Serializable,
Exposed=(Window,Worker),
SecureContext,
RuntimeEnabled=ShapeDetection RuntimeEnabled=ShapeDetection
] interface DetectedBarcode { ] interface DetectedBarcode {
// TODO(mcasas): Implement missing fields. https://crbug.com/646083 // TODO(mcasas): Implement missing fields. https://crbug.com/646083
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
[ [
Serializable, Serializable,
Exposed=(Window,Worker),
SecureContext,
RuntimeEnabled=ShapeDetection RuntimeEnabled=ShapeDetection
] interface DetectedFace { ] interface DetectedFace {
// TODO(xianglu): Implement any other fields. https://crbug.com/646083 // TODO(xianglu): Implement any other fields. https://crbug.com/646083
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
[ [
Serializable, Serializable,
Exposed=(Window,Worker),
SecureContext,
RuntimeEnabled=ShapeDetection RuntimeEnabled=ShapeDetection
] interface DetectedText { ] interface DetectedText {
[SameObject] readonly attribute DOMString rawValue; [SameObject] readonly attribute DOMString rawValue;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
Constructor(optional FaceDetectorOptions faceDetectorOptions), Constructor(optional FaceDetectorOptions faceDetectorOptions),
ConstructorCallWith=ExecutionContext, ConstructorCallWith=ExecutionContext,
Exposed=(Window,Worker), Exposed=(Window,Worker),
SecureContext,
MeasureAs=ShapeDetection_FaceDetectorConstructor, MeasureAs=ShapeDetection_FaceDetectorConstructor,
RuntimeEnabled=ShapeDetection RuntimeEnabled=ShapeDetection
] interface FaceDetector { ] interface FaceDetector {
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
Constructor, Constructor,
ConstructorCallWith=ExecutionContext, ConstructorCallWith=ExecutionContext,
Exposed=(Window,Worker), Exposed=(Window,Worker),
SecureContext,
MeasureAs=ShapeDetection_TextDetectorConstructor, MeasureAs=ShapeDetection_TextDetectorConstructor,
RuntimeEnabled=ShapeDetection RuntimeEnabled=ShapeDetection
] interface TextDetector { ] interface TextDetector {
......
...@@ -11,8 +11,8 @@ PASS FaceDetector must be primary interface of faceDetector ...@@ -11,8 +11,8 @@ PASS FaceDetector must be primary interface of faceDetector
PASS Stringification of faceDetector PASS Stringification of faceDetector
PASS FaceDetector interface: faceDetector must inherit property "detect(ImageBitmapSource)" with the proper type PASS FaceDetector interface: faceDetector must inherit property "detect(ImageBitmapSource)" with the proper type
PASS FaceDetector interface: calling detect(ImageBitmapSource) on faceDetector with too few arguments must throw TypeError PASS FaceDetector interface: calling detect(ImageBitmapSource) on faceDetector with too few arguments must throw TypeError
PASS DetectedFace interface: existence and properties of interface object FAIL DetectedFace interface: existence and properties of interface object assert_false: expected false got true
FAIL DetectedFace must be primary interface of detectedFace assert_own_property: self does not have own property "DetectedFace" expected property "DetectedFace" missing PASS DetectedFace must be primary interface of detectedFace
PASS Stringification of detectedFace PASS Stringification of detectedFace
FAIL DetectedFace interface: detectedFace must not have property "boundingBox" assert_false: expected false got true FAIL DetectedFace interface: detectedFace must not have property "boundingBox" assert_false: expected false got true
FAIL DetectedFace interface: detectedFace must not have property "landmarks" assert_false: expected false got true FAIL DetectedFace interface: detectedFace must not have property "landmarks" assert_false: expected false got true
...@@ -29,8 +29,8 @@ PASS Stringification of barcodeDetector ...@@ -29,8 +29,8 @@ PASS Stringification of barcodeDetector
PASS BarcodeDetector interface: barcodeDetector must inherit property "getSupportedFormats()" with the proper type PASS BarcodeDetector interface: barcodeDetector must inherit property "getSupportedFormats()" with the proper type
PASS BarcodeDetector interface: barcodeDetector must inherit property "detect(ImageBitmapSource)" with the proper type PASS BarcodeDetector interface: barcodeDetector must inherit property "detect(ImageBitmapSource)" with the proper type
PASS BarcodeDetector interface: calling detect(ImageBitmapSource) on barcodeDetector with too few arguments must throw TypeError PASS BarcodeDetector interface: calling detect(ImageBitmapSource) on barcodeDetector with too few arguments must throw TypeError
PASS DetectedBarcode interface: existence and properties of interface object FAIL DetectedBarcode interface: existence and properties of interface object assert_false: expected false got true
FAIL DetectedBarcode must be primary interface of detectedBarcode assert_own_property: self does not have own property "DetectedBarcode" expected property "DetectedBarcode" missing PASS DetectedBarcode must be primary interface of detectedBarcode
PASS Stringification of detectedBarcode PASS Stringification of detectedBarcode
FAIL DetectedBarcode interface: detectedBarcode must not have property "boundingBox" assert_false: expected false got true FAIL DetectedBarcode interface: detectedBarcode must not have property "boundingBox" assert_false: expected false got true
FAIL DetectedBarcode interface: detectedBarcode must not have property "rawValue" assert_false: expected false got true FAIL DetectedBarcode interface: detectedBarcode must not have property "rawValue" assert_false: expected false got true
......
...@@ -379,6 +379,24 @@ interface DOMStringList ...@@ -379,6 +379,24 @@ interface DOMStringList
method constructor method constructor
method contains method contains
method item method item
interface DetectedBarcode
attribute @@toStringTag
getter boundingBox
getter cornerPoints
getter format
getter rawValue
method constructor
interface DetectedFace
attribute @@toStringTag
getter boundingBox
getter landmarks
method constructor
interface DetectedText
attribute @@toStringTag
getter boundingBox
getter cornerPoints
getter rawValue
method constructor
interface ErrorEvent : Event interface ErrorEvent : Event
attribute @@toStringTag attribute @@toStringTag
getter colno getter colno
......
...@@ -341,6 +341,24 @@ Starting worker: resources/global-interface-listing-worker.js ...@@ -341,6 +341,24 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] attribute PERSISTENT [Worker] attribute PERSISTENT
[Worker] attribute TEMPORARY [Worker] attribute TEMPORARY
[Worker] method constructor [Worker] method constructor
[Worker] interface DetectedBarcode
[Worker] attribute @@toStringTag
[Worker] getter boundingBox
[Worker] getter cornerPoints
[Worker] getter format
[Worker] getter rawValue
[Worker] method constructor
[Worker] interface DetectedFace
[Worker] attribute @@toStringTag
[Worker] getter boundingBox
[Worker] getter landmarks
[Worker] method constructor
[Worker] interface DetectedText
[Worker] attribute @@toStringTag
[Worker] getter boundingBox
[Worker] getter cornerPoints
[Worker] getter rawValue
[Worker] method constructor
[Worker] interface ErrorEvent : Event [Worker] interface ErrorEvent : Event
[Worker] attribute @@toStringTag [Worker] attribute @@toStringTag
[Worker] getter colno [Worker] getter colno
......
...@@ -336,6 +336,24 @@ Starting worker: resources/global-interface-listing-worker.js ...@@ -336,6 +336,24 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] method constructor [Worker] method constructor
[Worker] method contains [Worker] method contains
[Worker] method item [Worker] method item
[Worker] interface DetectedBarcode
[Worker] attribute @@toStringTag
[Worker] getter boundingBox
[Worker] getter cornerPoints
[Worker] getter format
[Worker] getter rawValue
[Worker] method constructor
[Worker] interface DetectedFace
[Worker] attribute @@toStringTag
[Worker] getter boundingBox
[Worker] getter landmarks
[Worker] method constructor
[Worker] interface DetectedText
[Worker] attribute @@toStringTag
[Worker] getter boundingBox
[Worker] getter cornerPoints
[Worker] getter rawValue
[Worker] method constructor
[Worker] interface ErrorEvent : Event [Worker] interface ErrorEvent : Event
[Worker] attribute @@toStringTag [Worker] attribute @@toStringTag
[Worker] getter colno [Worker] getter colno
......
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