Skip to content

Commit c7144c2

Browse files
npm1domenic
authored andcommitted
Add attribution for <frame>, <embed>, <object>
Fixes w3c#52. Closes w3c#65.
1 parent 5006245 commit c7144c2

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

index.bs

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -308,18 +308,31 @@ Report long tasks {#report-long-tasks}
308308

309309
1. Set |attribution|'s {{PerformanceEntry/entryType}} attribute to <code>"taskattribution"</code>.
310310
1. Set |attribution|'s {{PerformanceEntry/startTime}} and {{PerformanceEntry/duration}} to 0.
311-
1. If |culpritSettings| is not <code>null</code>, and |culpritSettings|'s <a>responsible browsing context</a> has a <a>browsing context container</a> that is an <{iframe}> element, then let |iframe| be that element, and perform the following steps:
312-
1. Set |attribution|'s {{containerType}} attribute to "<code>iframe</code>".
313-
1. Set |attribution|'s {{containerName}} attribute to the value of |iframe|'s <{iframe/name}> content attribute, or <code>""</code> if the attribute is absent.
314-
1. Set |attribution|'s {{containerSrc}} attribute to the value of |iframe|'s <{iframe/src}> content attribute, or <code>""</code> if the attribute is absent.
311+
1. Set |attribution|'s {{containerType}} attribute to <code>"window"</code>.
312+
1. Set |attribution|'s {{containerName}} and {{containerSrc}} attributes to the empty string.
313+
1. If |culpritSettings| is not <code>null</code>:
314+
1. Let |container| be |culpritSettings|'s <a>responsible browsing context</a>'s <a>browsing context container</a>.
315+
1. Assert: |container| is not <code>null</code>.
316+
1. Set |attribution|'s {{containerId}} attribute to the value of |container|'s [=Element/ID=], or the empty string if the ID is unset.
317+
1. If |container| is an <{iframe}> element:
318+
1. Set |attribution|'s {{containerType}} attribute to "<code>iframe</code>".
319+
1. Set |attribution|'s {{containerName}} attribute to the value of |container|'s <{iframe/name}> content attribute, or the empty string if the attribute is absent.
320+
1. Set |attribution|'s {{containerSrc}} attribute to the value of |container|'s <{iframe/src}> content attribute, or the empty string if the attribute is absent.
315321

316322
NOTE: it is intentional that we record the frame's <{iframe/src}> attribute here, and not its current URL, as this is meant primarily to help identify frames, and allowing discovery of the current URL of a cross-origin iframe is a security problem.
317323

318-
1. Set |attribution|'s {{containerId}} attribute to the value of |iframe|'s [=Element/ID=], or <code>""</code> if the ID is unset.
319-
1. Otherwise, perform the following steps:
320-
1. Set |attribution|'s {{containerType}} attribute to <code>"window"</code>.
321-
1. Set |attribution|'s {{containerName}} attribute to <code>""</code>.
322-
1. Set |attribution|'s {{containerSrc}} attribute to <code>""</code>.
324+
1. If |container| is a <{frame}> element:
325+
1. Set |attribution|'s {{containerType}} attribute to "<code>frame</code>".
326+
1. Set |attribution|'s {{containerName}} attribute to the value of |container|'s <code>name</code> content attribute, or the empty string if the attribute is absent.
327+
1. Set |attribution|'s {{containerSrc}} attribute to the value of |container|'s <code>src</code> content attribute, or the empty string if the attribute is absent.
328+
1. If |container| is an <{object}> element:
329+
1. Set |attribution|'s {{containerType}} attribute to "<code>object</code>".
330+
1. Set |attribution|'s {{containerName}} attribute to the value of |container|'s <{object/name}> content attribute, or the empty string if the attribute is absent.
331+
1. Set |attribution|'s {{containerSrc}} attribute to the value of |container|'s <{object/data}> content attribute, or the empty string if the attribute is absent.
332+
1. If |container| is an <{embed}> element:
333+
1. Set |attribution|'s {{containerType}} attribute to "<code>embed</code>".
334+
1. Set |attribution|'s {{containerName}} attribute to the empty string.
335+
1. Set |attribution|'s {{containerSrc}} attribute to the value of |container|'s <{embed/src}> content attribute, or the empty string if the attribute is absent.
323336

324337
1. Create a new {{PerformanceLongTaskTiming}} object |newEntry| and set its attributes as follows:
325338

0 commit comments

Comments
 (0)