Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -697,17 +697,13 @@ spec: STRUCTURED-FIELDS; urlPrefix: https://www.rfc-editor.org/rfc/rfc8941.html#
<h3 id=interface-reporting-observer>Interface {{ReportingObserver}}</h3>

<pre class="idl">
[Exposed=(Window,Worker)]
interface ReportBody {
[Default] object toJSON();
dictionary ReportBody {
};

[Exposed=(Window,Worker)]
interface Report {
[Default] object toJSON();
readonly attribute DOMString type;
readonly attribute DOMString url;
readonly attribute ReportBody? body;
dictionary Report {
DOMString type;
DOMString url;
ReportBody? body;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI this does not appear to compile with WebIDL:

  --- stderr
  Traceback (most recent call last):
    File "/home/tvanderlippe/Projects/servo/components/script_bindings/codegen/run.py", line 168, in <module>
      main()
    File "/home/tvanderlippe/Projects/servo/components/script_bindings/codegen/run.py", line 48, in main
      parser_results = parser.finish()
                       ^^^^^^^^^^^^^^^
    File "/home/tvanderlippe/Projects/servo/third_party/WebIDL/WebIDL.py", line 9436, in finish
      production.validate()
    File "/home/tvanderlippe/Projects/servo/third_party/WebIDL/WebIDL.py", line 2402, in validate
      raise WebIDLError(
  WebIDL.WebIDLError: error: Dictionary Report has member with nullable dictionary type, /home/tvanderlippe/Projects/servo/components/script_bindings/codegen/../webidls/ReportingObserver.webidl line 13:14
    ReportBody? body;
                ^
warning: build failed, waiting for other jobs to finish...

Shouldn't type and url be marked as required, and body is implicitly optional?

};

[Exposed=(Window,Worker)]
Expand All @@ -728,11 +724,11 @@ dictionary ReportingObserverOptions {
typedef sequence&lt;Report> ReportList;
</pre>

A <dfn id=dom-report interface>Report</dfn> is the application exposed
representation of a <a>report</a>. <dfn attribute for="Report">type</dfn>
returns [=report/type=], <dfn attribute for="Report">url</dfn> returns
[=report/url=], and <dfn attribute for="Report">body</dfn> returns
[=report/body=].
A <dfn id=dom-report dictionary>Report</dfn> is the application-exposed
representation of a <a>report</a>.

<dfn id="reportbody" dictionary>ReportBody</dfn> is an abstract <a>dictionary</a>
type from which specific report types should <a for=dictionary>inherit</a>.

Each {{ReportingObserver}} object has these associated concepts:
- A <dfn for=ReportingObserver>callback</dfn> function set on creation.
Expand Down