From 8e3b2f4d343a656659d8ab5470799ff6d734e21c Mon Sep 17 00:00:00 2001 From: "Tab Atkins Jr." Date: Wed, 8 Jan 2025 17:27:45 -0800 Subject: [PATCH] Phase 2 of parser update: inlines (#3001) See --- bikeshed/Spec.py | 38 +- bikeshed/config/__init__.py | 1 + bikeshed/config/dfnTypes.py | 2 +- bikeshed/config/main.py | 11 + bikeshed/constants.py | 2 + bikeshed/datablocks.py | 48 +- bikeshed/h/__init__.py | 2 + bikeshed/h/dom.py | 91 +- bikeshed/h/parser/main.py | 1 + bikeshed/h/parser/nodes.py | 448 +++- bikeshed/h/parser/parser.py | 1897 ++++++++++++++--- bikeshed/h/parser/preds.py | 2 +- bikeshed/h/parser/stream.py | 73 +- bikeshed/h/serializer.py | 40 +- bikeshed/lint/brokenLinks.py | 6 +- bikeshed/messages.py | 18 +- bikeshed/metadata.py | 4 +- bikeshed/shorthands/__init__.py | 2 - bikeshed/shorthands/oldShorthands.py | 243 +-- bikeshed/t.py | 4 +- bikeshed/unsortedJunk.py | 9 +- docs/index.bs | 32 +- tests/biblio001.bs | 21 +- tests/biblio001.console.txt | 8 + tests/biblio001.html | 13 +- tests/biblio002.console.txt | 6 +- tests/css-production-range001.console.txt | 2 +- .../managed_config/index.console.txt | 2 +- .../WebApiDevice/managed_config/index.html | 4 +- .../spec/custom-element-semantics.console.txt | 8 +- .../github/WICG/app-history/spec.console.txt | 18 +- tests/github/WICG/app-history/spec.html | 106 +- .../WICG/background-fetch/index.console.txt | 88 +- tests/github/WICG/background-fetch/index.html | 106 +- .../PeriodicBackgroundSync-index.console.txt | 18 +- .../spec/PeriodicBackgroundSync-index.html | 8 +- .../WICG/background-sync/spec/index.html | 4 +- .../index.console.txt | 10 +- .../client-hints-infrastructure/index.html | 6 +- tests/github/WICG/compression/index.html | 12 +- .../construct-stylesheets/index.console.txt | 2 +- .../WICG/construct-stylesheets/index.html | 12 +- .../WICG/contact-api/spec/index.console.txt | 18 +- tests/github/WICG/contact-api/spec/index.html | 28 +- .../WICG/container-queries/index.console.txt | 4 +- .../WICG/content-index/spec/index.console.txt | 33 +- .../github/WICG/content-index/spec/index.html | 47 +- .../index.console.txt | 18 +- .../conversion-measurement-api/index.html | 2 +- .../WICG/cookie-store/index.console.txt | 18 +- tests/github/WICG/cookie-store/index.html | 62 +- .../github/WICG/cq-usecases/index.console.txt | 7 +- .../WICG/crash-reporting/index.console.txt | 6 + .../WICG/custom-state-pseudo-class/index.html | 2 +- .../deprecation-reporting/index.console.txt | 6 + tests/github/WICG/document-policy/index.bs | 2 +- .../WICG/document-policy/index.console.txt | 7 +- tests/github/WICG/element-timing/index.html | 12 +- .../index.console.txt | 8 +- tests/github/WICG/entries-api/index.html | 97 +- .../WICG/event-timing/index.console.txt | 4 +- tests/github/WICG/event-timing/index.html | 10 +- .../WICG/file-system-access/index.console.txt | 19 +- .../github/WICG/file-system-access/index.html | 30 +- tests/github/WICG/floc/floc.html | 4 +- .../spec/index.console.txt | 8 +- .../spec/index.html | 2 +- .../WICG/hdcp-detection/index.console.txt | 2 + .../WICG/idle-detection/index.console.txt | 10 +- tests/github/WICG/idle-detection/index.html | 18 +- .../github/WICG/import-maps/spec.console.txt | 6 +- tests/github/WICG/import-maps/spec.html | 16 +- .../intervention-reporting/index.console.txt | 6 + tests/github/WICG/keyboard-lock/index.bs | 2 +- tests/github/WICG/keyboard-lock/index.html | 2 +- .../WICG/keyboard-map/index.console.txt | 2 + tests/github/WICG/keyboard-map/index.html | 2 +- tests/github/WICG/kv-storage/spec.console.txt | 4 + tests/github/WICG/kv-storage/spec.html | 32 +- .../index.console.txt | 2 +- .../WICG/largest-contentful-paint/index.html | 8 +- .../github/WICG/local-font-access/index.html | 18 +- .../WICG/page-lifecycle/spec.console.txt | 20 +- tests/github/WICG/page-lifecycle/spec.html | 26 +- .../index.console.txt | 16 +- .../WICG/periodic-background-sync/index.html | 8 +- .../WICG/permissions-request/index.html | 13 +- .../github/WICG/permissions-revoke/index.html | 7 +- tests/github/WICG/portals/index.console.txt | 44 +- tests/github/WICG/portals/index.html | 84 +- tests/github/WICG/priority-hints/index.bs | 1 + .../WICG/priority-hints/index.console.txt | 4 + tests/github/WICG/priority-hints/index.html | 6 +- .../responsive-image-client-hints/index.html | 10 +- .../WICG/sanitizer-api/index.console.txt | 6 +- tests/github/WICG/sanitizer-api/index.html | 6 +- .../scroll-to-text-fragment/index.console.txt | 68 +- .../WICG/scroll-to-text-fragment/index.html | 89 +- .../index-zh-cn.console.txt | 22 +- .../shape-detection-api/index.console.txt | 2 +- .../WICG/sms-one-time-codes/index.console.txt | 12 +- .../github/WICG/sms-one-time-codes/index.html | 16 +- tests/github/WICG/speech-api/index.bs | 2 +- .../WICG/ua-client-hints/index.console.txt | 2 +- tests/github/WICG/ua-client-hints/index.html | 58 +- .../github/WICG/video-rvfc/index.console.txt | 4 +- tests/github/WICG/video-rvfc/index.html | 13 +- tests/github/WICG/web-locks/index.bs | 2 +- tests/github/WICG/web-locks/index.console.txt | 2 +- tests/github/WICG/web-locks/index.html | 32 +- tests/github/WICG/web-otp/index.console.txt | 67 +- tests/github/WICG/web-otp/index.html | 14 +- .../WICG/webpackage/loading.console.txt | 18 +- tests/github/WICG/webpackage/loading.html | 190 +- tests/github/WICG/webusb/index.console.txt | 2 + tests/github/WebAudio/web-audio-api/index.bs | 2 +- .../WebAudio/web-audio-api/index.console.txt | 18 +- .../github/WebAudio/web-audio-api/index.html | 130 +- .../web-bluetooth/index.console.txt | 51 +- .../WebBluetoothCG/web-bluetooth/index.html | 45 +- .../web-bluetooth/scanning.console.txt | 10 +- .../web-bluetooth/scanning.html | 8 +- tests/github/heycam/webidl/index.console.txt | 193 +- tests/github/heycam/webidl/index.html | 80 +- .../WebXR-WebGPU-Binding/index.console.txt | 2 +- .../immersive-web/anchors/index.console.txt | 6 +- tests/github/immersive-web/anchors/index.html | 6 +- .../depth-sensing/index.console.txt | 6 +- .../immersive-web/depth-sensing/index.html | 8 +- .../dom-overlays/index.console.txt | 47 +- .../immersive-web/hit-test/index.console.txt | 4 +- .../github/immersive-web/hit-test/index.html | 37 +- .../layers/webxrlayers-1.console.txt | 85 +- .../immersive-web/layers/webxrlayers-1.html | 12 +- .../lighting-estimation/index.console.txt | 10 +- .../lighting-estimation/index.html | 2 +- .../plane-detection.console.txt | 3 +- .../webxrmeshing-1.console.txt | 11 +- .../webvr/spec/1.1/index.console.txt | 19 +- .../immersive-web/webvr/spec/1.1/index.html | 8 +- .../webxr-ar-module/index.console.txt | 95 +- .../immersive-web/webxr-ar-module/index.html | 8 +- .../webxr-gamepads-module/index.console.txt | 29 +- .../webxr-gamepads-module/index.html | 20 +- .../webxr-hand-input/index.console.txt | 50 +- .../immersive-web/webxr-hand-input/index.html | 4 +- .../webxr-test-api/index.console.txt | 116 +- .../immersive-web/webxr-test-api/index.html | 54 +- .../immersive-web/webxr/index.console.txt | 52 +- tests/github/immersive-web/webxr/index.html | 140 +- .../jfbastien/papers/source/Math.signbit.html | 2 +- .../papers/source/P0323R10.console.txt | 6 + .../papers/source/P0528r0.console.txt | 2 + .../papers/source/P0907R4.console.txt | 84 + .../papers/source/P0907r1.console.txt | 72 + .../papers/source/P0907r2.console.txt | 78 + .../jfbastien/papers/source/P0995r0.html | 2 +- .../papers/source/P1018r5.console.txt | 4 + .../jfbastien/papers/source/P1018r5.html | 66 +- .../papers/source/P1018r8.console.txt | 4 + .../jfbastien/papers/source/P1018r8.html | 4 +- .../papers/source/P1018r9.console.txt | 4 + .../jfbastien/papers/source/P1018r9.html | 4 +- .../papers/source/P1152R1.console.txt | 4 + .../papers/source/P1152R2.console.txt | 4 + .../papers/source/P1152R3.console.txt | 4 + .../papers/source/P1831R0.console.txt | 8 + .../papers/source/P1831R1.console.txt | 8 + .../papers/source/P2186R0.console.txt | 8 + .../papers/source/P2186R1.console.txt | 18 + .../papers/source/P2186R2.console.txt | 10 + .../papers/source/p0907r3.console.txt | 84 + .../jfbastien/papers/source/p0995r1.html | 2 +- .../private-click-measurement.console.txt | 1 + .../storage-access/storage-access.console.txt | 16 +- .../storage-access/storage-access.html | 16 +- tests/github/w3c/FileAPI/index.console.txt | 148 +- tests/github/w3c/FileAPI/index.html | 20 +- tests/github/w3c/IndexedDB/index.console.txt | 22 +- tests/github/w3c/IndexedDB/index.html | 635 +++--- .../IntersectionObserver/index.console.txt | 105 +- .../w3c/IntersectionObserver/index.html | 6 +- tests/github/w3c/PFE/Overview.console.txt | 1 + .../w3c/ServiceWorker/docs/index.console.txt | 129 +- .../github/w3c/ServiceWorker/docs/index.html | 320 +-- .../ServiceWorker/docs/v1/index.console.txt | 180 +- .../w3c/ServiceWorker/docs/v1/index.html | 270 +-- .../index.console.txt | 55 +- .../WD-service-workers-20160830/index.html | 36 +- .../index.console.txt | 46 +- .../WD-service-workers-1-20161011/index.html | 4 +- tests/github/w3c/accelerometer/index.html | 7 +- .../w3c/clipboard-apis/index.console.txt | 3 +- tests/github/w3c/clipboard-apis/index.html | 7 +- .../css-animation-worklet-1/Overview.bs | 2 +- .../Overview.console.txt | 4 +- .../css-animation-worklet-1/Overview.html | 15 +- .../css-layout-api/Overview.bs | 2 +- .../css-layout-api/Overview.console.txt | 17 +- .../css-layout-api/Overview.html | 125 +- .../css-paint-api/Overview.html | 39 +- .../Overview.console.txt | 65 +- .../css-properties-values-api/Overview.html | 41 +- .../css-typed-om/Overview.console.txt | 160 +- .../css-typed-om/Overview.html | 67 +- .../css-align-3/Overview.console.txt | 7 +- .../csswg-drafts/css-align-3/Overview.html | 28 +- .../css-animations-1/Overview.console.txt | 6 + .../css-animations-1/Overview.html | 2 +- .../css-animations-2/Overview.console.txt | 2 +- .../css-animations-2/Overview.html | 2 +- .../css-backgrounds-3/Overview.console.txt | 20 +- .../css-backgrounds-3/Overview.html | 4 +- .../css-backgrounds-4/Overview.html | 2 +- .../css-box-3/block-layout.console.txt | 282 ++- .../csswg-drafts/css-box-3/block-layout.html | 64 +- .../css-break-3/Overview.console.txt | 16 +- .../csswg-drafts/css-break-3/Overview.html | 16 +- .../css-break-4/Overview.console.txt | 6 +- .../csswg-drafts/css-break-4/Overview.html | 6 +- .../css-cascade-3/Overview.console.txt | 28 +- .../css-cascade-4/Overview.console.txt | 38 +- .../csswg-drafts/css-cascade-4/Overview.html | 4 +- .../css-cascade-5/Overview.console.txt | 30 +- .../csswg-drafts/css-cascade-5/Overview.html | 4 +- .../w3c/csswg-drafts/css-color-4/Overview.bs | 2 +- .../css-color-4/Overview.console.txt | 11 +- .../csswg-drafts/css-color-4/Overview.html | 15 +- .../css-color-5/Overview.console.txt | 32 +- .../csswg-drafts/css-color-5/Overview.html | 18 +- .../css-color-adjust-1/Overview.console.txt | 32 +- .../css-color-hdr/Overview.console.txt | 2 + .../css-conditional-3/Overview.console.txt | 16 +- .../css-conditional-3/Overview.html | 2 +- .../css-contain-1/Overview.console.txt | 10 + .../csswg-drafts/css-contain-1/Overview.html | 14 +- .../css-contain-2/Overview.console.txt | 2 + .../csswg-drafts/css-contain-2/Overview.html | 14 +- .../css-contain-3/Overview.console.txt | 2 +- .../css-content-3/Overview.console.txt | 10 +- .../csswg-drafts/css-content-3/Overview.html | 2 +- .../css-counter-styles-3/Overview.console.txt | 142 +- .../css-device-adapt-1/Overview.console.txt | 32 +- .../css-device-adapt-1/Overview.html | 18 +- .../css-display-3/Overview.console.txt | 14 +- .../csswg-drafts/css-easing-1/Overview.html | 12 +- .../css-egg-1/Overview.console.txt | 6 +- .../w3c/csswg-drafts/css-egg-1/Overview.html | 15 +- .../css-exclusions-1/Overview.console.txt | 57 +- .../css-flexbox-1/Overview.console.txt | 24 +- .../csswg-drafts/css-flexbox-1/Overview.html | 4 +- .../css-font-loading-3/Overview.console.txt | 10 +- .../css-font-loading-3/Overview.html | 2 +- .../css-fonts-3/Overview-wip.console.txt | 118 +- .../css-fonts-3/Overview-wip.html | 2 +- .../w3c/csswg-drafts/css-fonts-4/Overview.bs | 2 +- .../css-fonts-4/Overview.console.txt | 221 +- .../csswg-drafts/css-fonts-4/Overview.html | 21 +- .../css-fonts-5/Overview.console.txt | 50 +- .../css-forms-1/Overview.console.txt | 2 + .../css-gcpm-3/Overview.console.txt | 29 +- .../w3c/csswg-drafts/css-gcpm-3/Overview.html | 10 +- .../css-gcpm-4/Overview.console.txt | 12 +- .../w3c/csswg-drafts/css-gcpm-4/Overview.html | 2 +- .../css-grid-1/Overview.console.txt | 88 +- .../w3c/csswg-drafts/css-grid-1/Overview.html | 58 +- .../css-grid-2/Overview.console.txt | 60 +- .../w3c/csswg-drafts/css-grid-2/Overview.html | 70 +- .../css-grid-3/Overview.console.txt | 14 +- .../w3c/csswg-drafts/css-grid-3/Overview.html | 2 +- .../css-highlight-api-1/Overview.console.txt | 52 +- .../css-highlight-api-1/Overview.html | 8 +- .../css-images-3/Overview.console.txt | 14 +- .../css-images-4/Overview.console.txt | 10 +- .../csswg-drafts/css-images-4/Overview.html | 8 +- .../css-inline-3/Overview.console.txt | 20 +- .../csswg-drafts/css-inline-3/Overview.html | 22 +- .../css-line-grid-1/Overview.console.txt | 50 +- .../css-lists-3/Overview.console.txt | 14 +- .../csswg-drafts/css-lists-3/Overview.html | 6 +- .../css-logical-1/Overview.console.txt | 104 +- .../csswg-drafts/css-logical-1/Overview.html | 22 +- .../css-module-bikeshed/Overview.console.txt | 1 + .../css-nav-1/Overview.console.txt | 63 +- .../w3c/csswg-drafts/css-nav-1/Overview.html | 4 +- .../css-nesting-1/Overview.console.txt | 1 + .../css-overflow-3/Overview.console.txt | 13 +- .../csswg-drafts/css-overflow-3/Overview.html | 8 +- .../csswg-drafts/css-overflow-4/Overview.html | 4 +- .../css-page-3/Overview.console.txt | 44 +- .../css-page-floats-3/Overview.console.txt | 1 + .../css-position-3/Overview.console.txt | 21 +- .../csswg-drafts/css-position-3/Overview.html | 2 +- .../css-print/Overview.console.txt | 39 +- .../css-pseudo-4/Overview.console.txt | 28 +- .../css-regions-1/Overview.console.txt | 38 +- .../css-rhythm-1/Overview.console.txt | 3 +- .../css-round-display-1/Overview.console.txt | 58 +- .../css-ruby-1/Overview.console.txt | 8 +- .../w3c/csswg-drafts/css-ruby-1/Overview.html | 8 +- .../css-scoping-1/Overview.console.txt | 8 +- .../Overview.console.txt | 1 + .../css-scrollbars-1/Overview.html | 2 +- .../css-shadow-parts-1/Overview.console.txt | 12 +- .../css-shapes-1/Overview.console.txt | 46 +- .../csswg-drafts/css-shapes-1/Overview.html | 10 +- .../css-shapes-2/Overview.console.txt | 42 +- .../css-size-adjust-1/Overview.console.txt | 2 +- .../css-sizing-3/Overview.console.txt | 2 +- .../csswg-drafts/css-sizing-4/Overview.html | 4 +- .../css-speech-1/Overview.console.txt | 8 +- .../css-syntax-3/Overview.console.txt | 37 +- .../csswg-drafts/css-syntax-3/Overview.html | 6 +- .../w3c/csswg-drafts/css-tables-3/Overview.bs | 2 +- .../css-tables-3/Overview.console.txt | 63 +- .../csswg-drafts/css-tables-3/Overview.html | 2 +- .../css-text-3/Overview.console.txt | 32 +- .../css-text-4/Overview.console.txt | 12 +- .../w3c/csswg-drafts/css-text-4/Overview.html | 27 +- .../css-text-decor-3/Overview.console.txt | 22 +- .../csswg-drafts/css-text-decor-4/Overview.bs | 6 +- .../css-text-decor-4/Overview.console.txt | 31 +- .../css-text-decor-4/Overview.html | 12 +- .../css-transforms-1/Overview.console.txt | 3 + .../css-transforms-2/Overview.console.txt | 4 +- .../css-transitions-1/Overview.console.txt | 12 +- .../css-transitions-1/Overview.html | 16 +- .../css-transitions-2/Overview.console.txt | 4 +- .../css-ui-3/Overview.console.txt | 17 +- .../css-ui-4/Overview.console.txt | 12 +- .../w3c/csswg-drafts/css-ui-4/Overview.html | 38 +- .../css-values-3/Overview.console.txt | 14 +- .../csswg-drafts/css-values-3/Overview.html | 34 +- .../css-values-4/Overview.console.txt | 16 +- .../csswg-drafts/css-values-4/Overview.html | 66 +- .../css-variables-1/Overview.console.txt | 6 +- .../css-variables-1/Overview.html | 32 +- .../css-writing-modes-3/Overview.bs | 2 +- .../css-writing-modes-3/Overview.console.txt | 6 +- .../css-writing-modes-3/Overview.html | 8 +- .../css-writing-modes-4/Overview.bs | 2 +- .../css-writing-modes-4/Overview.console.txt | 10 +- .../css-writing-modes-4/Overview.html | 8 +- .../github/w3c/csswg-drafts/css2/Overview.bs | 2 +- .../csswg-drafts/css2/Overview.console.txt | 154 +- .../w3c/csswg-drafts/css2/Overview.html | 45 +- .../csswg-drafts/cssom-1/Overview.console.txt | 67 +- .../w3c/csswg-drafts/cssom-1/Overview.html | 2 +- .../cssom-view-1/Overview.console.txt | 7 +- .../mediaqueries-4/Overview.console.txt | 172 +- .../csswg-drafts/mediaqueries-4/Overview.html | 2 +- .../mediaqueries-5/Overview.console.txt | 218 +- .../csswg-drafts/mediaqueries-5/Overview.html | 6 +- .../resize-observer-1/Overview.console.txt | 10 +- .../resize-observer-1/Overview.html | 20 +- .../scroll-animations-1/Overview.console.txt | 63 +- .../scroll-animations-1/Overview.html | 45 +- .../selectors-4/Overview.console.txt | 2 +- .../selectors-nonelement-1/Overview.html | 4 +- .../csswg-drafts/web-animations-1/Overview.bs | 4 +- .../web-animations-1/Overview.console.txt | 31 +- .../web-animations-1/Overview.html | 107 +- .../csswg-drafts/web-animations-2/Overview.bs | 2 +- .../web-animations-2/Overview.console.txt | 166 +- .../web-animations-2/Overview.html | 181 +- .../w3c/deviceorientation/index.console.txt | 67 +- .../w3c/dpub-pagination/Overview.console.txt | 62 +- .../compositing-1/Overview.console.txt | 201 +- .../fxtf-drafts/compositing-1/Overview.html | 8 +- .../compositing-2/Overview.console.txt | 203 +- .../fxtf-drafts/compositing-2/Overview.html | 8 +- .../css-masking-1/Overview.console.txt | 61 +- .../fill-stroke/Overview.console.txt | 8 + .../w3c/fxtf-drafts/fill-stroke/Overview.html | 8 +- .../filter-effects-2/Overview.console.txt | 44 +- .../fxtf-drafts/geometry/Overview.console.txt | 3 + .../fxtf-drafts/motion-1/Overview.console.txt | 51 +- .../w3c/geolocation-sensor/index.console.txt | 3 +- tests/github/w3c/longtasks/index.console.txt | 4 +- tests/github/w3c/longtasks/index.html | 36 +- .../w3c/media-capabilities/index.console.txt | 41 + .../w3c/mediacapture-image/index.console.txt | 28 +- .../github/w3c/mediacapture-image/index.html | 4 +- .../MediaRecorder.console.txt | 2 + .../mediacapture-record/MediaRecorder.html | 2 +- .../mediacapture-transform/index.console.txt | 9 +- .../github/w3c/mediasession/index.console.txt | 28 +- tests/github/w3c/mediasession/index.html | 36 +- tests/github/w3c/motion-sensors/index.html | 6 +- .../releases/NOTE/NOTE.console.txt | 3 +- .../motion-sensors/releases/NOTE/NOTE.html | 6 +- .../motion-sensors/releases/NOTE2/index.html | 6 +- tests/github/w3c/openscreenprotocol/index.bs | 8 +- .../w3c/openscreenprotocol/index.console.txt | 360 ++-- .../github/w3c/openscreenprotocol/index.html | 27 +- .../github/w3c/orientation-sensor/index.html | 3 +- .../w3c/orientation-sensor/releases/FPWD.html | 3 +- .../github/w3c/paint-timing/painttiming.html | 4 +- .../payment-method-manifest/index.console.txt | 28 +- .../w3c/payment-method-manifest/index.html | 12 +- .../github/w3c/permissions/index.console.txt | 67 +- tests/github/w3c/permissions/index.html | 6 +- .../w3c/picture-in-picture/index.console.txt | 2 +- tests/github/w3c/proximity/index.console.txt | 4 +- tests/github/w3c/sensors/index.console.txt | 26 +- tests/github/w3c/sensors/index.html | 52 +- .../svgwg/specs/color/Overview.console.txt | 18 +- .../svgwg/specs/marker/Overview.console.txt | 46 +- .../w3c/svgwg/specs/marker/Overview.html | 24 +- .../svgwg/specs/svg-native/index.console.txt | 72 +- .../w3c/svgwg/specs/svg-native/index.html | 2 +- tests/github/w3c/w3process/index.console.txt | 17 +- tests/github/w3c/w3process/index.html | 32 +- .../w3c/wcag-act/act-rules-format.console.txt | 23 +- .../response-code-reliability.console.txt | 2 +- .../index.console.txt | 74 +- .../index.html | 96 +- tests/github/w3c/webappsec-csp/2/index.bs | 4 +- .../w3c/webappsec-csp/2/index.console.txt | 12 +- .../w3c/webappsec-csp/api/index.console.txt | 16 +- tests/github/w3c/webappsec-csp/api/index.html | 14 +- .../webappsec-csp/document/index.console.txt | 14 +- .../w3c/webappsec-csp/document/index.html | 2 +- .../w3c/webappsec-csp/index.console.txt | 22 +- tests/github/w3c/webappsec-csp/index.html | 27 +- .../index.console.txt | 8 +- .../w3c/webappsec-fetch-metadata/index.html | 8 +- .../webappsec-mixed-content/index.console.txt | 1 + .../w3c/webappsec-mixed-content/index.html | 7 +- .../index.console.txt | 47 +- .../webappsec-permissions-policy/index.html | 22 +- .../webappsec-suborigins/index.console.txt | 21 +- .../w3c/webappsec-suborigins/index.html | 2 +- .../index.console.txt | 1 + .../spec/index.console.txt | 76 +- .../webappsec-trusted-types/spec/index.html | 46 +- .../webappsec-uisecurity/index.console.txt | 4 + .../index.html | 26 +- tests/github/w3c/webauthn/index.bs | 22 +- tests/github/w3c/webauthn/index.console.txt | 65 +- tests/github/w3c/webauthn/index.html | 354 ++- .../w3c/webdriver-bidi/index.console.txt | 59 +- tests/github/w3c/webdriver-bidi/index.html | 174 +- .../index.console.txt | 4 +- .../w3c/webrtc-encoded-transform/index.html | 10 +- .../w3c/webrtc-priority/index.console.txt | 5 +- .../github/w3c/webtransport/index.console.txt | 13 +- tests/github/w3c/webtransport/index.html | 19 +- tests/github/w3c/webvtt/index.console.txt | 46 +- .../client-certificates/index.console.txt | 4 +- .../design-principles/index.console.txt | 44 +- .../w3ctag/design-principles/index.html | 14 +- .../security-questionnaire/index.console.txt | 5 +- .../whatwg/compat/compatibility.console.txt | 24 +- tests/github/whatwg/compat/compatibility.html | 2 +- tests/github/whatwg/console/index.console.txt | 2 +- tests/github/whatwg/dom/dom.console.txt | 12 +- tests/github/whatwg/dom/dom.html | 12 +- .../whatwg/encoding/encoding.console.txt | 2 +- tests/github/whatwg/fetch/fetch.console.txt | 33 +- .../whatwg/fullscreen/fullscreen.console.txt | 2 +- tests/github/whatwg/infra/infra.console.txt | 4 +- tests/github/whatwg/loader/index.console.txt | 16 +- .../whatwg/mimesniff/mimesniff.console.txt | 2 +- .../notifications/notifications.console.txt | 4 +- .../whatwg/notifications/notifications.html | 2 +- tests/github/whatwg/quirks/quirks.console.txt | 32 +- .../github/whatwg/storage/storage.console.txt | 14 +- tests/github/whatwg/streams/index.console.txt | 14 +- tests/github/whatwg/streams/index.html | 198 +- tests/github/whatwg/url/url.console.txt | 6 +- tests/github/whatwg/xhr/xhr.console.txt | 2 +- tests/idl003.console.txt | 2 +- tests/idl004.bs | 2 +- tests/idl004.html | 3 +- tests/idl005.console.txt | 4 +- tests/line-count-001.console.txt | 6 +- tests/link-shorthands001.console.txt | 2 +- tests/link-shorthands001.html | 10 +- tests/links003.console.txt | 3 +- tests/links007.bs | 2 +- tests/links008.console.txt | 8 +- tests/links009.bs | 15 + tests/links009.console.txt | 8 + tests/links009.html | 434 ++++ tests/links010.bs | 36 + tests/links010.console.txt | 0 tests/links010.html | 1407 ++++++++++++ tests/lint001.console.txt | 6 +- tests/macros001.console.txt | 6 +- tests/markdown012.bs | 141 +- tests/markdown012.console.txt | 39 +- tests/markdown012.html | 1169 +++++++++- tests/markdown014.bs | 24 + tests/markdown014.console.txt | 0 tests/markdown014.html | 456 ++++ tests/pre004.console.txt | 1 + tests/previous-versions-001.console.txt | 2 +- tests/section-links003.console.txt | 2 +- tests/var001.console.txt | 8 +- tests/var002.console.txt | 4 +- 501 files changed, 14299 insertions(+), 6874 deletions(-) create mode 100644 tests/links009.bs create mode 100644 tests/links009.console.txt create mode 100644 tests/links009.html create mode 100644 tests/links010.bs create mode 100644 tests/links010.console.txt create mode 100644 tests/links010.html create mode 100644 tests/markdown014.bs create mode 100644 tests/markdown014.console.txt create mode 100644 tests/markdown014.html diff --git a/bikeshed/Spec.py b/bikeshed/Spec.py index b1c05d1787..c4af0bb9f0 100644 --- a/bikeshed/Spec.py +++ b/bikeshed/Spec.py @@ -185,7 +185,11 @@ def initMetadata(self, inputContent: InputSource.InputContent) -> None: m.retroactivelyCheckErrorLevel() def earlyParse(self, inputContent: InputSource.InputContent) -> list[l.Line]: - text = h.strFromNodes(h.initialDocumentParse(inputContent.content, h.ParseConfig.fromSpec(self)), withIlcc=True) + text = FIXMEreplaceMarkdownBlockquotes(inputContent.content) + nodes = h.initialDocumentParse(text, h.ParseConfig.fromSpec(self)) + if self.debug: + h.debugNodes(nodes) + text = h.strFromNodes(nodes, withIlcc=True) inputContent.rawLines = [x + "\n" for x in text.split("\n")] return inputContent.lines @@ -587,3 +591,35 @@ def checkForMixedIndents(lines: t.Sequence[l.Line], info: metadata.IndentInfo) - m.lint(f"Your document appears to use tabs to indent, but line {line.i} starts with spaces.") if re.match(r"(\t+ +\t)|( +\t)", line.text): m.lint(f"Line {line.i}'s indent contains tabs after spaces.") + + +def FIXMEreplaceMarkdownBlockquotes(text: str) -> str: + # Temporary hack to make the early HTML pass not be broken + # by Markdown blockquotes. + # * finds sequences of lines that share a ws + angle bracket prefix + # * replaces first such > with a blockquote-open PUA + # * replaces subsequent > with a space + # * adds a blockquote-close PUA to the end of last line + # * the HTML parser recognizes those PUAs and emits the correct start/end tags. + + lines = text.split("\n") + i = 0 + while True: + if i >= len(lines): + break + match = re.match(r"\s*>\s?", lines[i]) + if not match: + i += 1 + continue + if i + 1 < len(lines) and re.match(r"\s*>\s?", lines[i + 1]): + lines[i] = constants.bqStart + lines[i][len(match[0]) :] + i += 1 + while i < len(lines) and re.match(r"\s*>\s?", lines[i]): + match = re.match(r"\s*>\s?", lines[i]) + assert match is not None + lines[i] = lines[i][len(match[0]) :] + i += 1 + lines[i - 1] += constants.bqEnd + else: + i += 1 + return "\n".join(lines) diff --git a/bikeshed/config/__init__.py b/bikeshed/config/__init__.py index dbd1fe2101..c3fa29b525 100644 --- a/bikeshed/config/__init__.py +++ b/bikeshed/config/__init__.py @@ -32,6 +32,7 @@ intersperse, processTextNodes, reSubObject, + safeIndex, scriptPath, simplifyText, splitForValues, diff --git a/bikeshed/config/dfnTypes.py b/bikeshed/config/dfnTypes.py index b8602b1330..ee220b8055 100644 --- a/bikeshed/config/dfnTypes.py +++ b/bikeshed/config/dfnTypes.py @@ -53,7 +53,7 @@ dfnTypes = frozenset(list(dfnClassToType.values()) + ["dfn"]) maybeTypes = frozenset(["value", "type", "at-rule", "function", "selector"]) cssTypes = frozenset(["property", "value", "at-rule", "descriptor", "type", "function", "selector"]) -markupTypes = frozenset(["element", "element-attr", "element-state", "attr-value"]) +markupTypes = frozenset(["element", "element-attr", "element-state", "attr-value", "element-sub"]) idlTypes = frozenset( [ "event", diff --git a/bikeshed/config/main.py b/bikeshed/config/main.py index e065f7eb64..1ef0a2bd9a 100644 --- a/bikeshed/config/main.py +++ b/bikeshed/config/main.py @@ -192,3 +192,14 @@ def doEvery(s: float, action: t.Callable, lastTime: float | None = None) -> floa action() return newTime return lastTime + + +if t.TYPE_CHECKING: + SafeIndexDefaultT = t.TypeVar("SafeIndexDefaultT") + + +def safeIndex(coll: t.Sequence, needle: t.Any, default: SafeIndexDefaultT = None) -> int | SafeIndexDefaultT: # type: ignore[assignment] + try: + return coll.index(needle) + except ValueError: + return default diff --git a/bikeshed/constants.py b/bikeshed/constants.py index 98fae99b96..ed167b1e09 100644 --- a/bikeshed/constants.py +++ b/bikeshed/constants.py @@ -13,3 +13,5 @@ incrementLineCountChar = "\uebbd" decrementLineCountChar = "\uebbf" bsComment = "" +bqStart = "\uebc0" +bqEnd = "\uebc1" diff --git a/bikeshed/datablocks.py b/bikeshed/datablocks.py index b5d4039c08..9388b942bf 100644 --- a/bikeshed/datablocks.py +++ b/bikeshed/datablocks.py @@ -251,7 +251,7 @@ def transformPre(lines: list[str], tagName: str, firstLine: str, lineNum: int | def transformSimpleDef(lines: list[str], tagName: str, firstLine: str, lineNum: int | None, doc: t.SpecT) -> list[str]: - rows = parseDefBlock(lines, "simpledef", capitalizeKeys=False, doc=doc) + rows = parseDefBlock(lines, "simpledef", capitalizeKeys=False, doc=doc, lineNum=lineNum) lineNumAttr = "" if lineNum is not None: lineNumAttr = f" bs-line-number={lineNum}" @@ -268,7 +268,7 @@ def transformSimpleDef(lines: list[str], tagName: str, firstLine: str, lineNum: def transformPropdef(lines: list[str], tagName: str, firstLine: str, lineNum: int | None, doc: t.SpecT) -> list[str]: attrs: OrderedDict[str, str | None] = OrderedDict() - parsedAttrs = parseDefBlock(lines, "propdef", doc=doc) + parsedAttrs = parseDefBlock(lines, "propdef", doc=doc, lineNum=lineNum) # Displays entries in the order specified in attrs, # then if there are any unknown parsedAttrs values, # they're displayed afterward in the order they were specified. @@ -326,7 +326,10 @@ def transformPropdef(lines: list[str], tagName: str, firstLine: str, lineNum: in val = parsedAttrs[key] elif val is None: # Required key, not provided - m.die(f"The propdef for '{parsedAttrs.get('Name', '???')}' is missing a '{key}' line.", lineNum=lineNum) + if "Name" in parsedAttrs: + m.die(f"The propdef for '{parsedAttrs.get('Name', '')}' is missing a '{key}' line.", lineNum=lineNum) + else: + m.die(f"The propdef block is missing a '{key}' line.", lineNum=lineNum) continue else: # Optional key, just use default @@ -380,7 +383,7 @@ def transformDescdef(lines: list[str], tagName: str, firstLine: str, lineNum: in lineNumAttr = "" if lineNum is not None: lineNumAttr = f" bs-line-number={lineNum}" - vals = parseDefBlock(lines, "descdef", doc=doc) + vals = parseDefBlock(lines, "descdef", doc=doc, lineNum=lineNum) if "partial" in firstLine or "New values" in vals: requiredKeys = ["Name", "For"] ret = [ @@ -432,7 +435,7 @@ def transformElementdef(lines: list[str], tagName: str, firstLine: str, lineNum: if lineNum is not None: lineNumAttr = f" bs-line-number={lineNum}" attrs: OrderedDict[str, str | None] = OrderedDict() - parsedAttrs = parseDefBlock(lines, "elementdef", doc=doc) + parsedAttrs = parseDefBlock(lines, "elementdef", doc=doc, lineNum=lineNum) if "Attribute groups" in parsedAttrs or "Attributes" in parsedAttrs: html = "