Behaviour SwRS-MDOKFSTUDIO-TRUST-059
The page accepts only registered host messages addressed to its render
When the page receives a window message event, it SHALL hand its value to the host message filter only if the event comes from the frame that hosts the page, from another frame with the page's own origin that is not the window that opened it, from the page's own window with its own origin, or is dispatched inside the page without a sender; a message posted by any other window or frame SHALL be dropped. When the page receives a value from the host, it SHALL treat it as a host message only if it is an object whose type is an own key of the table of host message rules and it is addressed to the page by that rule, which names the document, revision and request of the render the page shows, or the document alone, or no render identity but an identifier of its own, and whose payload is within the bounds of its type (table of the payload checks).
Step 1 of path 2 in StRS-MDOKFSTUDIO-TRUST-009: from “The page receives a message from the host” to “The page accepts a host message”.
Part of StRS-MDOKFSTUDIO-BLOCK-025, outside the paths drawn on its map.
Part of StRS-MDOKFSTUDIO-TOOLBAR-011, outside the paths drawn on its map.
Part of StRS-MDOKFSTUDIO-BLOCK-006, outside the paths drawn on its map.
Scenarios 6
The situations the tests check; open one to read it.
nominalRegistered type, current render
refusalA message from another window or frame
refusalValues that are not host messages
refusalA render that is not the shown one
boundaryAddressing by the rule of the type
| Addressing | Message must name | Types |
|---|---|---|
| render | the document id, revision and request id of the render the page shows | previewEditSource, previewBlockMoveResult and previewBlocksResult (another requestId, or another document or revision: the page ignores it; an answer for the page's render: the page handles it), themeChanged, previewPropertiesTable, previewContentPatch, previewLinkTargets and the other render-addressed types |
| document | the document id only; the render may differ | previewPlantUmlIncludesChanged |
| own-id | no render identity; matched by an identifier of its own (editId, flushId), because the host may already follow the next document or render | the results of the host round trips, previewFlushEdit and previewEditorWatch |
refusalThe payload of a type is within its bounds
| Message | Accepted only if | Otherwise |
|---|---|---|
| previewContentPatch | next holds integer revision and requestId, a finite initialAnchor if present, an initialPin with finite line and viewportTop if present, a contentHtml string of at most 20 MiB, a known status (pending, success, stale, error, missing-source or recovery), a label string of at most 500 characters, an optional message string of at most 20 000 characters, and at most 500 diagnostics, each with a severity of at most 50 characters, a text of at most 20 000 characters and, when present, a code of at most 100 characters | refused, not applied: 501 diagnostics, a content over 20 MiB, an unknown status, a non-finite anchor, a diagnostic code of 101 characters; a valid patch is applied and each status line keeps its code attribute |
| previewPropertiesTable | its markup is a string | goes to unhandled (markup null) |
| previewLinkTargets | its targets are an array and it names the render of the page | goes to unhandled (an object, or the previous request id: no link changes) |
| previewFlushEdit, previewEditorWatch | its flushId or its editId is a string, whatever the document the message names (own-id addressing) | goes to unhandled and the page ignores it; a watch naming the next document is answered |