diff --git a/index.html b/index.html index cea9568..a6dd050 100644 --- a/index.html +++ b/index.html @@ -5,11 +5,10 @@ Reporting API - - + - - - - - - + - - - - + - - +

Reporting API

-

Editor’s Draft,

+

Editor’s Draft,

More details about this document
@@ -849,7 +914,7 @@

Reporting API

- +
@@ -867,7 +932,7 @@

GitHub Issues are preferred for discussion of this specification.

-

This document is governed by the 2 November 2021 W3C Process Document.

+

This document is governed by the 03 November 2023 W3C Process Document.

@@ -1044,7 +1109,7 @@

A report type is a non-empty string that specifies the set of data that is contained in the body of a report.

When a report type is defined (in this spec or others), it can be - specified to be visible to ReportingObservers, meaning + specified to be visible to ReportingObservers, meaning that reports of that type can be observed by a reporting observer. By default, report types are not visible to ReportingObservers.

2.1.3. Reports

@@ -1404,7 +1469,7 @@

OK status (200-299), return "Success".

  • -

    If response’s status is 410 Gone [RFC9110], return "Remove Endpoint".

    +

    If response’s status is 410 Gone [RFC9110], return "Remove Endpoint".

  • Return "Failure".

    @@ -2091,7 +2156,7 @@

    [HTML-DESIGN-PRINCIPLES]
    Anne van Kesteren; Maciej Stachowiak. HTML Design Principles. 26 November 2007. WD. URL: https://www.w3.org/TR/html-design-principles/
    [NETWORK-ERROR-LOGGING] -
    Douglas Creager; et al. Network Error Logging. URL: https://w3c.github.io/network-error-logging/ +
    Douglas Creager; Ian Clelland. Network Error Logging. URL: https://w3c.github.io/network-error-logging/
    [RFC7469]
    C. Evans; C. Palmer; R. Sleevi. Public Key Pinning Extension for HTTP. April 2015. Proposed Standard. URL: https://www.rfc-editor.org/rfc/rfc7469 @@ -2291,50 +2356,160 @@

    + mk.li({}, + ...section.refs.map((ref, refI)=> + [ + mk.a({ + href: `#${ref.id}` + }, + (refI == 0) ? section.title : `(${refI + 1})` + ), + " ", + ] + ), + ), + ), + ), + ); + } + + function genAllDfnPanels() { + for(const panelData of Object.values(window.dfnpanelData)) { + const dfnID = panelData.dfnID; + const dfn = document.getElementById(dfnID); + if(!dfn) { + console.log(`Can't find dfn#${dfnID}.`, panelData); + } else { + const panel = genDfnPanel(panelData); + append(document.body, panel); + insertDfnPopupAction(dfn, panel) + } } - const rect = dfn.getBoundingClientRect(); - const top = window.scrollY + rect.top - panel.style.top = top + "px"; - panel.top = top; - panel.height = rect.height; - panel.classList.remove("unpositioned"); - const panelRect = panel.getBoundingClientRect() - if(main) { - panel.classList.toggle("overlapping-main", panelRect.left < mainRect.right) + } + + document.addEventListener("DOMContentLoaded", ()=>{ + genAllDfnPanels(); + + // Add popup behavior to all dfns to show the corresponding dfn-panel. + var dfns = queryAll('.dfn-paneled'); + for(let dfn of dfns) { ; } + + document.body.addEventListener("click", (e) => { + // If not handled already, just hide all dfn panels. + hideAllDfnPanels(); + }); + }) + + + function hideAllDfnPanels() { + // Turn off any currently "on" or "activated" panels. + queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(el=>hideDfnPanel(el)); + } + + function showDfnPanel(dfnPanel, dfn) { + hideAllDfnPanels(); // Only display one at this time. + dfn.setAttribute("aria-expanded", "true"); + dfnPanel.classList.add("on"); + dfnPanel.style.left = "5px"; + dfnPanel.style.top = "0px"; + const panelRect = dfnPanel.getBoundingClientRect(); + const panelWidth = panelRect.right - panelRect.left; + if (panelRect.right > document.body.scrollWidth) { + // Panel's overflowing the screen. + // Just drop it below the dfn and flip it rightward instead. + // This still wont' fix things if the screen is *really* wide, + // but fixing that's a lot harder without 'anchor()'. + dfnPanel.style.top = "1.5em"; + dfnPanel.style.left = "auto"; + dfnPanel.style.right = "0px"; } } - let vSoFar = 0; - for(const panel of panels.sort(cmpTops)) { - if(panel.top < vSoFar) { - panel.top = vSoFar; - panel.style.top = vSoFar + "px"; + + function pinDfnPanel(dfnPanel) { + // Switch it to "activated" state, which pins it. + dfnPanel.classList.add("activated"); + dfnPanel.style.left = null; + dfnPanel.style.top = null; + } + + function hideDfnPanel(dfnPanel, dfn) { + if(!dfn) { + dfn = document.getElementById(dfnPanel.getAttribute("data-for")); } - vSoFar = panel.top + panel.height + 15; + dfn.setAttribute("aria-expanded", "false") + dfnPanel.classList.remove("on"); + dfnPanel.classList.remove("activated"); } -} -function cmpTops(a,b) { - return a.top - b.top; -} + function toggleDfnPanel(dfnPanel, dfn) { + if(dfnPanel.classList.contains("on")) { + hideDfnPanel(dfnPanel, dfn); + } else { + showDfnPanel(dfnPanel, dfn); + } + } -window.addEventListener("load", repositionAnnoPanels); -window.addEventListener("resize", repositionAnnoPanels); -} - + - - + - + + \ No newline at end of file