@weapp-tailwindcss/lynx 0.4.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -3
- package/README.zh-CN.md +44 -6
- package/dist/decoder-data/AGENTS.md +31 -0
- package/dist/decoder-data/fixtures/selector-identifiers.json +159 -0
- package/dist/decoder-data/manifest.json +130 -0
- package/dist/decoder-data/patches/0001-decode-page-config-before-css.patch +33 -0
- package/dist/decoder-data/patches/0002-serialize-css-identifiers.patch +55 -0
- package/dist/decoder-data/rebuild/bootstrap-inputs.json +25 -0
- package/dist/decoder-data/rebuild/inputs.json +198 -0
- package/dist/decoder-data/vendor/.gitattributes +2 -0
- package/dist/decoder-data/vendor/README.md +11 -0
- package/dist/decoder-data/vendor/lepus.cjs.gz +0 -0
- package/dist/decoder-data/vendor/licenses/emsdk-upstream-emscripten-LICENSE.txt +102 -0
- package/dist/decoder-data/vendor/licenses/emsdk-upstream-emscripten-system-lib-compiler-rt-LICENSE.TXT.txt +311 -0
- package/dist/decoder-data/vendor/licenses/emsdk-upstream-emscripten-system-lib-libc-musl-COPYRIGHT.txt +193 -0
- package/dist/decoder-data/vendor/licenses/emsdk-upstream-emscripten-system-lib-libcxx-LICENSE.TXT.txt +311 -0
- package/dist/decoder-data/vendor/licenses/emsdk-upstream-emscripten-system-lib-libcxxabi-LICENSE.TXT.txt +311 -0
- package/dist/decoder-data/vendor/licenses/emsdk-upstream-emscripten-system-lib-libunwind-LICENSE.TXT.txt +311 -0
- package/dist/decoder-data/vendor/licenses/source-LICENSE.txt +203 -0
- package/dist/decoder-data/vendor/licenses/source-NOTICE.txt +4 -0
- package/dist/decoder-data/vendor/licenses/source-third_party-aes-LICENSE.txt +21 -0
- package/dist/decoder-data/vendor/licenses/source-third_party-double-conversion-LICENSE.txt +26 -0
- package/dist/decoder-data/vendor/licenses/source-third_party-jsoncpp-LICENSE.txt +55 -0
- package/dist/decoder-data/vendor/licenses/source-third_party-modp_b64-LICENSE.txt +33 -0
- package/dist/decoder-data/vendor/licenses/source-third_party-quickjs-LICENSE.txt +22 -0
- package/dist/decoder-data/vendor/licenses/source-third_party-quickjs-src-LICENSE.txt +202 -0
- package/dist/decoder-data/vendor/licenses/source-third_party-rapidjson-license.txt.txt +57 -0
- package/dist/decoder-data/vendor/reproducibility.json +63 -0
- package/dist/decoder.cjs +108 -0
- package/dist/decoder.d.ts +25 -0
- package/dist/decoder.js +101 -0
- package/dist/index.cjs +574 -8
- package/dist/index.d.ts +74 -4
- package/dist/index.js +572 -8
- package/dist/rolldown-runtime-CmQyd0Gu.cjs +27 -0
- package/package.json +17 -7
package/README.md
CHANGED
|
@@ -4,12 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
Tailwind CSS 4 integration for ReactLynx and Rspeedy. It invokes `weapp-tailwindcss` through Rspeedy's Rspack lifecycle to produce standard CSS for Lynx, preserves native ReactLynx `className`, and introduces no runtime stylesheet or JSX transform.
|
|
6
6
|
|
|
7
|
+
This integration requires Node.js `^22.18.0 || >=24.11.0`, covering the adapter and its mandatory core dependency chain. Using the ReactLynx integration requires an installed and registered `@lynx-js/react-rsbuild-plugin` `>=0.12.4`; its optional peer installation flag only avoids installing another builder copy. Recursive CSS variables require Lynx runtime `>=3.6`, separately from the tested Engine version and bundle encoding target.
|
|
8
|
+
|
|
9
|
+
Stable Tailwind theme tokens may become literals. Web color compatibility may also resolve application variables when lowering modern color expressions. Local, conditional, or priority overrides visible in the current CSS input prevent the affected variables from being treated as static. Overrides from separately compiled stylesheets or inline styles are outside this analysis and cannot change generated literals. Renaming a variable does not guarantee dynamic override behavior.
|
|
10
|
+
|
|
7
11
|
## Install
|
|
8
12
|
|
|
9
13
|
```bash
|
|
10
14
|
pnpm add @weapp-tailwindcss/lynx tailwindcss
|
|
11
15
|
```
|
|
12
16
|
|
|
17
|
+
## Versions and runtime requirements
|
|
18
|
+
|
|
19
|
+
See the package metadata for published versions of [the adapter](https://www.npmjs.com/package/@weapp-tailwindcss/lynx) and [weapp-tailwindcss](https://www.npmjs.com/package/weapp-tailwindcss). The adapter requires Node.js `^22.18.0 || >=24.11.0`, with peer ranges of Rspeedy `>=0.16.0` and Tailwind CSS `>=4.0.0`. Its `weapp-tailwindcss` dependency chain requires Node.js `^22.18.0 || >=24.11.0`.
|
|
20
|
+
|
|
21
|
+
The repository fixture pins `@lynx-js/rspeedy` `0.18.3`, `@lynx-js/react-rsbuild-plugin` `0.22.0`, `@lynx-js/react` `0.129.0`, Tailwind CSS `4.3.4`, Lynx Engine `4.0.1`, bundle `engineVersion: '3.9'`, and `@lynx-js/css-defines` `0.0.18`. These versions describe the checked-in regression matrix and do not replace compatibility validation in a consuming project.
|
|
22
|
+
|
|
13
23
|
## Configure
|
|
14
24
|
|
|
15
25
|
```ts
|
|
@@ -33,7 +43,9 @@ Import Tailwind CSS 4 from the application CSS entry and point `@source` at the
|
|
|
33
43
|
@source "./**/*.{ts,tsx}";
|
|
34
44
|
```
|
|
35
45
|
|
|
36
|
-
`pluginLynxTailwindcss` fixes `platform` to `'lynx'`, sets `generator.target` to `'web'`, and enables Lynx-compatible output. Tailwind
|
|
46
|
+
`pluginLynxTailwindcss` fixes `platform` to `'lynx'`, sets `generator.target` to `'web'`, and enables Lynx-compatible output. Stable Tailwind theme tokens may be resolved at build time, while an application variable override visible in the same CSS keeps its `var()` dependency. Overrides from another stylesheet or an inline style are outside this static analysis guarantee.
|
|
47
|
+
|
|
48
|
+
Author-defined `@property` registrations outside `--tw-*` retain their registration and `var()` dependency; global defaults cannot replace syntax, initial-value, or inheritance semantics. The target must still support registered properties. Preserving the input and verifying it in browsers do not establish Lynx native support.
|
|
37
49
|
|
|
38
50
|
Recursive variables require Lynx runtime 3.6 or later and the exposed template API from ReactLynx plugin 0.12.4 or later. Older builders must be upgraded; native behavior is currently tested on the pinned 4.0.1 matrix.
|
|
39
51
|
|
|
@@ -41,6 +53,26 @@ Before template encoding, the plugin defaults `enableCSSInlineVariables` to `tru
|
|
|
41
53
|
|
|
42
54
|
See the [ReactLynx / Rspeedy configuration reference](https://tw.weapp.dev/docs/config/react-lynx) for the `generator`, `rspack`, CSS loader, and encoder options.
|
|
43
55
|
|
|
56
|
+
### Build diagnostics
|
|
57
|
+
|
|
58
|
+
Enable structured Lynx encoder diagnostics when a build needs an auditable compatibility report. The default only emits a warning and report. With `strict: true`, only an unignored rule that is confirmed as a business rule and removed by the encoder becomes a compilation error. Preflight rules, Tailwind default rules, and `unknown` diagnostics never fail strict mode.
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
pluginLynxTailwindcss({
|
|
62
|
+
diagnostics: {
|
|
63
|
+
strict: true,
|
|
64
|
+
ignore: [{ property: 'padding-inline', reason: '业务明确接受该平台限制' }],
|
|
65
|
+
onReport(report) {
|
|
66
|
+
console.log(report)
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
})
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Reports distinguish raw `encoder-log` records from silent removals found by `bundle-comparison`, with `bundled`, `encoder-rejected`, or `unknown` status. Matching requires unique selector branches, conditions, and declarations. Evidence comes from the emitted build-graph asset in `afterEmit` and binds the bundle, pinned decoder, and input CSS hashes. An ignore must select a selector/property; `reason` is an audit note. Ignored records and removal counts remain in the report.
|
|
73
|
+
|
|
74
|
+
Original files and positions are provided only when the current build graph source map proves them; synthetic cssId and generated coordinates remain separate. Duplicate branches across entries, repeated declarations, unknown value normalization, incomplete CSS-section decoding, and ambiguous scoped CSS origins remain unproven. Diagnostics do not scan `dist` or equate bundle inclusion with native support.
|
|
75
|
+
|
|
44
76
|
The current integration supports ReactLynx + Rspeedy and Tailwind CSS 4. It does not cover Rspeedy Web output, non-React Lynx frameworks, or React Native-style runtime style mapping.
|
|
45
77
|
|
|
46
78
|
## Arbitrary values
|
|
@@ -68,7 +100,7 @@ pnpm --filter @weapp-tailwindcss/lynx test
|
|
|
68
100
|
pnpm e2e:lynx
|
|
69
101
|
```
|
|
70
102
|
|
|
71
|
-
`examples/react-lynx` is a multi-page compatibility lab pinned to Tailwind CSS `4.3.
|
|
103
|
+
`examples/react-lynx` is a multi-page compatibility lab pinned to Tailwind CSS `4.3.4`, Lynx Engine `4.0.1`, bundle `engineVersion: '3.9'`, and `@lynx-js/css-defines` `0.0.18`. Representative cases cover every official utility family, variant kind, directive, and arbitrary syntax branch.
|
|
72
104
|
|
|
73
105
|
The static gate parses the real `main.css` with PostCSS, then combines `tasm.json.css.cssMap` with encoder removal logs to record `generated` and `bundled` separately. Native support comes only from committed iOS and Android reports; css-defines is only a version hint.
|
|
74
106
|
|
|
@@ -79,4 +111,10 @@ pnpm e2e:lynx:native
|
|
|
79
111
|
pnpm e2e:lynx:update
|
|
80
112
|
```
|
|
81
113
|
|
|
82
|
-
|
|
114
|
+
CI uses Android API 30 with a Pixel 2 x86_64 runner and iOS 18.5 with an iPhone 16 Pro simulator. Each CI run and committed report carries its own run identity and original artifacts.
|
|
115
|
+
|
|
116
|
+
The example and committed dual-platform baseline use Tailwind CSS `4.3.4`; the complete original artifacts passed strict validation, archiving, and replay.
|
|
117
|
+
|
|
118
|
+
The committed native baseline records `verifiedAt: 2026-11-05T09:53:21.315Z` and `catalogHash: 9126d53d68318cbd319f642be14d43402fd1029de649a9915c8c554e2c54e8e4`. Its Android report is from `sdk_phone_x86_64` (Android 11/API 30, x86_64), and its iOS report is from `LynxCompatibility` (iPhone 16 Pro, iOS 18.5, arm64). A baseline update requires complete reports from both platforms for the same catalog and Engine version.
|
|
119
|
+
|
|
120
|
+
`--capture-only` is an explicitly targeted bundle capture mode that writes screenshots/video for inspection. It does not create or update native support reports and cannot replace CI or committed-baseline evidence.
|
package/README.zh-CN.md
CHANGED
|
@@ -4,12 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
ReactLynx + Rspeedy 的 Tailwind CSS v4 集成。它通过 Rspeedy 的 Rspack 生命周期调用 `weapp-tailwindcss` 生成 Lynx 可消费的普通 CSS,保留 ReactLynx 原生 `className`,不引入运行时样式表或 JSX 转换。
|
|
6
6
|
|
|
7
|
+
本集成要求 Node.js `^22.18.0 || >=24.11.0`,覆盖适配器及其必装核心依赖链。启用 ReactLynx 集成时,必须安装并注册 `@lynx-js/react-rsbuild-plugin` `>=0.12.4`;该 peer 的 optional 安装标记只避免自动引入另一份构建器。递归 CSS 变量要求 Lynx runtime `>=3.6`,这与当前原生基线的 Engine 版本和 bundle 编码 target 是不同的要求。
|
|
8
|
+
|
|
9
|
+
稳定的 Tailwind theme token 可以替换为字面值;Web 颜色兼容阶段也可能在降级现代颜色表达式时解析应用变量。当前 CSS 输入中可见的局部、条件或优先级覆盖会阻止相关变量静态化。跨文件 stylesheet 或 inline style 的覆盖不在分析范围内,不能改变已生成的字面值;变量改名也不能保证动态覆盖语义。
|
|
10
|
+
|
|
7
11
|
## 安装
|
|
8
12
|
|
|
9
13
|
```bash
|
|
10
14
|
pnpm add @weapp-tailwindcss/lynx tailwindcss
|
|
11
15
|
```
|
|
12
16
|
|
|
17
|
+
## 版本与运行要求
|
|
18
|
+
|
|
19
|
+
已发布版本以[适配器包元数据](https://www.npmjs.com/package/@weapp-tailwindcss/lynx)和 [weapp-tailwindcss 包元数据](https://www.npmjs.com/package/weapp-tailwindcss)为准。适配器自身要求 Node.js `^22.18.0 || >=24.11.0`,peer 依赖为 Rspeedy `>=0.16.0` 与 Tailwind CSS `>=4.0.0`;核心依赖链要求 Node.js `^22.18.0 || >=24.11.0`。
|
|
20
|
+
|
|
21
|
+
仓库示例固定 `@lynx-js/rspeedy` `0.18.3`、`@lynx-js/react-rsbuild-plugin` `0.22.0`、`@lynx-js/react` `0.129.0`、Tailwind CSS `4.3.4`、Lynx Engine `4.0.1`、bundle `engineVersion: '3.9'` 和 `@lynx-js/css-defines` `0.0.18`。这些是本仓库回归矩阵的版本,不会替代消费项目自己的兼容性验证。
|
|
22
|
+
|
|
13
23
|
## 配置
|
|
14
24
|
|
|
15
25
|
```ts
|
|
@@ -34,7 +44,9 @@ export default defineConfig({
|
|
|
34
44
|
@source "./**/*.{ts,tsx}";
|
|
35
45
|
```
|
|
36
46
|
|
|
37
|
-
`pluginLynxTailwindcss` 固定使用 `platform: 'lynx'`、`generator.target: 'web'` 与 Lynx
|
|
47
|
+
`pluginLynxTailwindcss` 固定使用 `platform: 'lynx'`、`generator.target: 'web'` 与 Lynx 原生兼容输出。稳定的 Tailwind theme token 可能在构建期静态化,确保 `bg-sky-500`、`p-6`、`text-lg` 等标准 utility 能进入 Lynx 原生样式表;同一 CSS 中可见的应用变量覆盖会保留 `var()` 依赖。跨文件 stylesheet 或 inline style 的覆盖关系不在该静态分析保证范围内。
|
|
48
|
+
|
|
49
|
+
作者自定义 `@property`(非 `--tw-*`)保留注册与 `var()`,不会用全局默认值替代语法、初值或继承语义。目标端仍须支持注册属性;保留输入与浏览器对照不代表 Lynx 原生已支持该语义。
|
|
38
50
|
|
|
39
51
|
递归变量路径要求 Lynx runtime 3.6 以上,以及 ReactLynx 插件 0.12.4 以上公开的模板 API;更旧的构建器需要升级。源码支持边界不等于设备验收,当前原生测试仍使用固定 4.0.1 矩阵。
|
|
40
52
|
|
|
@@ -42,6 +54,26 @@ export default defineConfig({
|
|
|
42
54
|
|
|
43
55
|
完整的 `generator`、`rspack`、CSS loader 和 encoder 配置项见 [ReactLynx / Rspeedy 配置参考](https://tw.weapp.dev/zh-cn/docs/config/react-lynx)。
|
|
44
56
|
|
|
57
|
+
### 构建诊断
|
|
58
|
+
|
|
59
|
+
可以开启结构化的 Lynx encoder 诊断。默认只输出 warning 和报告,不改变已有构建结果;`strict: true` 只会让未被 `ignore` 且确认属于业务规则、并在 encoder 阶段被删除的声明写入 compilation error。preflight、Tailwind 默认规则和 `unknown` 诊断在 strict 模式下不会失败。
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
pluginLynxTailwindcss({
|
|
63
|
+
diagnostics: {
|
|
64
|
+
strict: true,
|
|
65
|
+
ignore: [{ property: 'padding-inline', reason: '业务明确接受该平台限制' }],
|
|
66
|
+
onReport(report) {
|
|
67
|
+
console.log(report)
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
})
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
报告把 `encoder-log` 原始日志与 `bundle-comparison` 发现的静默删除分开记录,状态为 `bundled`、`encoder-rejected` 或 `unknown`。输入通过唯一选择器分支、条件和声明关联;编码证据来自 `afterEmit` 的构建图 asset,并绑定 bundle、固定 decoder 与输入 CSS 的 hash。忽略项必须限定 selector/property,`reason` 仅作审计说明;记录和删除计数始终保留。
|
|
74
|
+
|
|
75
|
+
来源文件/行列只在当前构建图 source map 可证明时提供;合成 cssId 和生成坐标单独保存。跨入口同名分支、重复声明、未知值规范化、无法完整解码的 CSS section,以及无法唯一关联的 scoped CSS 来源均不猜测。诊断不扫描 `dist`,也不把进入 bundle 视为 Lynx 原生支持。
|
|
76
|
+
|
|
45
77
|
当前集成支持 ReactLynx + Rspeedy 与 Tailwind CSS v4;不覆盖 Rspeedy Web 输出、非 React Lynx 框架或 React Native 风格的运行时样式映射。
|
|
46
78
|
|
|
47
79
|
## 任意值
|
|
@@ -76,7 +108,7 @@ Lynx 集成保留 ReactLynx 原生 `className`,不会像小程序目标一样
|
|
|
76
108
|
| 颜色 | `bg-[#123456]`、`bg-[rgb(12,34,56)]`、`text-[color:#c31d6b]` | 已验证 |
|
|
77
109
|
| 渐变 | `bg-[radial-gradient(circle_at_20%_20%,#fff,#000)]` | 已验证生成;复杂效果仍建议做真机视觉验收 |
|
|
78
110
|
| 明确类型 | `text-[length:23px]`、`text-[color:#c31d6b]` | 已验证,二义性值推荐显式写 `length:` / `color:` |
|
|
79
|
-
| CSS 变量 | `[--panel-height:240px]`、`max-h-[var(--panel-height)]`、`bg-(--brand-color)` |
|
|
111
|
+
| CSS 变量 | `[--panel-height:240px]`、`max-h-[var(--panel-height)]`、`bg-(--brand-color)` | 当前基线用例已验证;静态求值与动态覆盖边界见上文 |
|
|
80
112
|
| 重要值 | `!bg-[gray]` | Tailwind 可生成,需结合 Lynx 目标版本验收优先级行为 |
|
|
81
113
|
| 布局值 | `aspect-[4/3]`、`grid-cols-[200px_minmax(0,1fr)_80px]` | 已验证生成并进入 bundle |
|
|
82
114
|
| 逻辑属性 | `px-[7.5px]` | 不推荐;Tailwind 生成 `padding-inline`,当前 Lynx encoder 会删除该属性 |
|
|
@@ -97,7 +129,7 @@ Lynx 集成保留 ReactLynx 原生 `className`,不会像小程序目标一样
|
|
|
97
129
|
这些警告需要分两类处理:
|
|
98
130
|
|
|
99
131
|
- preflight 的浏览器专用规则:改用上面的 theme + utilities 入口即可减少噪声。
|
|
100
|
-
- 业务 utility 对应的 selector/property
|
|
132
|
+
- 业务 utility 对应的 selector/property:需要根据 `bundled`、`encoder-rejected` 或 `unknown` 状态核对实际编码证据,不能仅凭 warning 判断样式是否进入 Lynx 原生样式表,应调整 Tailwind 写法,不能只忽略警告。
|
|
101
133
|
|
|
102
134
|
## 验证
|
|
103
135
|
|
|
@@ -108,9 +140,15 @@ pnpm --filter @weapp-tailwindcss/lynx test
|
|
|
108
140
|
pnpm e2e:lynx
|
|
109
141
|
```
|
|
110
142
|
|
|
111
|
-
仓库中的 `examples/react-lynx` 是多页面兼容性实验室,固定 Tailwind CSS `4.3.
|
|
143
|
+
仓库中的 `examples/react-lynx` 是多页面兼容性实验室,固定 Tailwind CSS `4.3.4`、Lynx Engine `4.0.1`、bundle `engineVersion: '3.9'` 和 `@lynx-js/css-defines` `0.0.18`。它以代表值覆盖官方 utility 功能族、variant、指令和任意语法分支。
|
|
144
|
+
|
|
145
|
+
静态 gate 使用 PostCSS 解析真实 `main.css`,并结合 `tasm.json.css.cssMap` 与 encoder removal 日志分别记录 `generated` 和 `bundled`。CI 默认使用 Android API 30、Pixel 2、x86_64,以及 iOS 18.5、iPhone 16 Pro。每轮 CI 与已提交报告分别绑定自己的运行身份和原始工件。
|
|
146
|
+
|
|
147
|
+
当前示例与已提交的双端基线均使用 Tailwind CSS `4.3.4`,完整原始工件已通过严格校验、归档及重放。
|
|
148
|
+
|
|
149
|
+
当前已提交的原生报告基线记录 `verifiedAt: 2026-11-05T09:53:21.315Z`、`catalogHash: 9126d53d68318cbd319f642be14d43402fd1029de649a9915c8c554e2c54e8e4`,Android 为 `sdk_phone_x86_64`(Android 11/API 30,x86_64),iOS 为 `LynxCompatibility`(iPhone 16 Pro,iOS 18.5,arm64)。只有与相同 catalog 和版本匹配的完整双端报告才能更新基线。
|
|
112
150
|
|
|
113
|
-
|
|
151
|
+
`--capture-only` 是显式指定 bundle 和目标设备后的采集模式,只保存截图/视频用于观察,不生成或更新原生支持报告,也不能替代 CI runner 或已提交基线设备的验收。
|
|
114
152
|
|
|
115
153
|
```bash
|
|
116
154
|
pnpm e2e:lynx:android
|
|
@@ -119,4 +157,4 @@ pnpm e2e:lynx:native
|
|
|
119
157
|
pnpm e2e:lynx:update
|
|
120
158
|
```
|
|
121
159
|
|
|
122
|
-
|
|
160
|
+
更新器要求同一 catalog 与 Engine 版本的完整双端报告同时存在;缺失结果、能力退化或意外新增支持都会失败,不能手工编辑基线。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Lynx bundle 解码 oracle
|
|
2
|
+
|
|
3
|
+
<!-- agents:cwd=root -->
|
|
4
|
+
|
|
5
|
+
## 适用范围
|
|
6
|
+
|
|
7
|
+
适用于本目录的 decoder 固定资源;运行时 loader 位于上级 decoder.ts,维护脚本位于 e2e/lynx/decoder/rebuild。
|
|
8
|
+
|
|
9
|
+
## 核心职责
|
|
10
|
+
|
|
11
|
+
从实际 bundle 字节读取编码结果,固定源码、补丁、工具链、许可与产物身份。
|
|
12
|
+
|
|
13
|
+
## 变更原则
|
|
14
|
+
|
|
15
|
+
- 禁止手工编辑生成的 gzip/WASM;变更先落到源码补丁,再运行重建脚本。
|
|
16
|
+
- decoder 失败必须阻断,禁止回退 serializer 输入、源 CSS、未修复 decoder 或本机原生二进制。
|
|
17
|
+
- 补丁只修复解码或文本表示,不修改 encoder、被测 bundle、平台预期和原生匹配行为。
|
|
18
|
+
- 普通 CI 消费同一便携产物,校验压缩、解压和补丁 hash;更新时重复构建并记录字节可重复性及差异。
|
|
19
|
+
- 生成、编码和原生运行时证据各自验证,decoder 测试不启动设备或浏览器。
|
|
20
|
+
|
|
21
|
+
## 测试要求
|
|
22
|
+
|
|
23
|
+
保留实际 bundle 的修复前后对照;属性、选择器、条件或产物身份丢失的负向回归必须拒绝。
|
|
24
|
+
|
|
25
|
+
## 推荐验证命令
|
|
26
|
+
|
|
27
|
+
- `CI=1 pnpm exec vitest run -c e2e/vitest.e2e.config.ts e2e/lynx-decoder.test.ts e2e/lynx-media-guard.test.ts --update=none`
|
|
28
|
+
|
|
29
|
+
## 提交前检查
|
|
30
|
+
|
|
31
|
+
检查源码与补丁来源、产物 hash、许可、临时资源清理,以及受影响的 static 基线。
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "实际 Lynx bundle 的 selector 标识符回归夹具",
|
|
3
|
+
"encoder": {
|
|
4
|
+
"package": "@lynx-js/tasm",
|
|
5
|
+
"version": "0.0.53",
|
|
6
|
+
"gitHead": "3526f07a8cb25cfb2841736c76b54deadc7e6e46",
|
|
7
|
+
"engineVersion": "4.0",
|
|
8
|
+
"enableCSSRule": true
|
|
9
|
+
},
|
|
10
|
+
"bundle": {
|
|
11
|
+
"bytes": 1946,
|
|
12
|
+
"sha256": "0b751511fd435c1e54ef84ba932f3abe947d069dd91ea30b7bb165f4d80a6035",
|
|
13
|
+
"base64": "mgcAACIZJAAHAAAAMC4yLjAuMAcAAAB1bmtub3duAwAAADQuMAMAAAA0LjC9AAAAT0ZOSSIAAAABAQEAAAECAQABAQMBAAABBAEAAQEFAQABAQYBAAEBBwEAAQcIBAACAAAABwkEAAMAAAABCgEAAQELAQAAAQ0BAAABDgEAAQEPAQAAARABAAABEQEAAQESAQABARMBAAEBFAEAAAEVAQABARYBAAEBFwEAAAEYAQAAARkBAAEBGgEAAAEbAQABARwBAAEBHQEAAQEeAQABAR8BAAEBIAEAAAEhAQAAAAADADQuMAAMAAAABAAAAGNhcmQACgQAAAABAAAAAOYFAAAF5gUAAOsFAAAG6wUAAEYGAAALRgYAAH4GAAABAQAAAAAAAAAAAAAA1QUAAAAAAAAAAAAAEQAAAAJJAAAAAAAAAAEAAAAFAwAAAAswAAMACwABAAADDAAAAGFzcGVjdC1bNC8zXQEAAAAbAAAAAwMAAAAxcHgAAAAAAAAAAAAAAAAAAAAAAAJEAAAAAQAAAAEAAAAFAwAAAAswAAMACwABAAADBwAAACFzaHJpbmsBAAAAGwAAAAMDAAAAMnB4AAAAAAAAAAAAAAAAAAAAAAACTwAAAAIAAAABAAAABQMAAAALMAADAAsAAQAAAxIAAAB0ZXh0LVtsZW5ndGg6MjNweF0BAAAAGwAAAAMDAAAAM3B4AAAAAAAAAAAAAAAAAAAAAAACbgAAAAMAAAACAAAABQMAAAALMAAAAAsAAgAAAxcAAABiZWZvcmU6Y29udGVudC1bJ2x5bngnXQUDAAAAC1AaAwALAAAAAAMGAAAAYmVmb3JlAQAAABsAAAADAwAAADRweAAAAAAAAAAAAAAAAAAAAAAAAkEAAAAEAAAAAQAAAAUDAAAACzAAAwALAAEAAAMEAAAAMXJvdwEAAAAbAAAAAwMAAAA1cHgAAAAAAAAAAAAAAAAAAAAAAAJCAAAABQAAAAEAAAAFAwAAAAswAAMACwABAAADBQAAAC0xcm93AQAAABsAAAADAwAAADZweAAAAAAAAAAAAAAAAAAAAAAAAkgAAAAGAAAAAQAAAAUDAAAACzAAAwALAAEAAAMLAAAAcHVuY3QsY29tbWEBAAAAGwAAAAMDAAAAN3B4AAAAAAAAAAAAAAAAAAAAAAACRwAAAAcAAAABAAAABQMAAAALMAADAAsAAQAAAwoAAABiYWNrXHNsYXNoAQAAABsAAAADAwAAADhweAAAAAAAAAAAAAAAAAAAAAAAAkYAAAAIAAAAAQAAAAUDAAAACzAAAwALAAEAAAMJAAAAY29udHJvbAF6AQAAABsAAAADAwAAADlweAAAAAAAAAAAAAAAAAAAAAAAAkYAAAAJAAAAAQAAAAUDAAAACzAAAwALAAEAAAMIAAAAZGVsZXRlf3oBAAAAGwAAAAMEAAAAMTBweAAAAAAAAAAAAAAAAAAAAAAAAlwAAAAKAAAAAgAAAAUDAAAACzAAAAALAAIAAAMGAAAA5Lit5paHBQMAAAALMAADAAsAAAAAAwQAAADwn5KaAQAAABsAAAADBAAAADExcHgAAAAAAAAAAAAAAAAAAAAAAAI/AAAACwAAAAEAAAAFAwAAAAswAAMACwABAAADAQAAAC0BAAAAGwAAAAMEAAAAMTJweAAAAAAAAAAAAAAAAAAAAAAAAkUAAAAMAAAAAQAAAAUDAAAACzAAAwALAAEAAAMHAAAAbnVs77+9egEAAAAbAAAAAwQAAAAxM3B4AAAAAAAAAAAAAAAAAAAAAAACTAAAAA0AAAABAAAABQMAAAALIAADAAsAAAEAAw4AAABpZDp3aXRoW3ZhbHVlXQEAAAAbAAAAAwQAAAAxNHB4AAAAAAAAAAAAAAAAAAAAAAACQQAAAA4AAAABAAAABQMAAAALIAADAAsAAAEAAwMAAAAyaWQBAAAAGwAAAAMEAAAAMTVweAAAAAAAAAAAAAAAAAAAAAAAAo8AAAAPAAAAAQAAAAUDAAAAC0AeBwALAAABAAUGAAAAAwMAAABub3QLAAAAAAUAAAAAAwEAAAAqAwAAAAAFAgAAAAUDAAAACzAAAgALAAEAAAMEAAAAYVtiXQUDAAAACyAAAwALAAABAAMDAAAAeDp5AQAAABsAAAADBAAAADE2cHgAAAAAAAAAAAAAAAAAAAAAAAKQAAAAEAAAAAMAAAAFAwAAAAsxAAAACwADAAADGwAAAGdyb3VwLWhvdmVyL2NhcmQ6b3BhY2l0eS01MAUDAAAACzAAAAALAAAAAAMKAAAAZ3JvdXAvY2FyZAUDAAAAC0ATAwALAAAAAAMFAAAAaG92ZXIBAAAAGwAAAAMEAAAAMTdweAAAAAAAAAAAAAAAAAAAAAAABQAAAAAGVgAAAHsibGVwdXNTdHJpY3QiOnRydWUsImVuYWJsZUNTU1J1bGUiOnRydWUsImRzbCI6MiwiYnVuZGxlTW9kdWxlTW9kZSI6MSwiY2xpIjoidW5rbm93biJ9Cy8AAAAAAAAAAQEObWFpbi5qcw0ABgCeAQABAAEAAAIBoAEAAADCKJYDAQwAAICAgJCAgICAgAE="
|
|
14
|
+
},
|
|
15
|
+
"sourceCss": ".aspect-\\[4\\/3\\]{width:1px}\n.\\!shrink{width:2px}\n.text-\\[length\\:23px\\]{width:3px}\n.before\\:content-\\[\\'lynx\\'\\]::before{width:4px}\n.\\31 row{width:5px}\n.\\-1row{width:6px}\n.punct\\,comma{width:7px}\n.back\\\\slash{width:8px}\n.control\\1 z{width:9px}\n.delete\\7f z{width:10px}\n.中文.💚{width:11px}\n.\\-{width:12px}\n.nul\\0 z{width:13px}\n#id\\:with\\[value\\]{width:14px}\n#\\32 id{width:15px}\n:not(.a\\[b\\], #x\\:y){width:16px}\n.group\\/card:hover .group-hover\\/card\\:opacity-50{width:17px}",
|
|
16
|
+
"expectedCssSha256": "9adde11b9a2d6744d5ff270ce6442f713d60a4316decec694565e55e7a386ebf",
|
|
17
|
+
"expectedRules": [
|
|
18
|
+
{
|
|
19
|
+
"width": "1px",
|
|
20
|
+
"selector": ".aspect-\\[4\\/3\\]",
|
|
21
|
+
"classes": [
|
|
22
|
+
"aspect-[4/3]"
|
|
23
|
+
],
|
|
24
|
+
"ids": []
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"width": "2px",
|
|
28
|
+
"selector": ".\\!shrink",
|
|
29
|
+
"classes": [
|
|
30
|
+
"!shrink"
|
|
31
|
+
],
|
|
32
|
+
"ids": []
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"width": "3px",
|
|
36
|
+
"selector": ".text-\\[length\\:23px\\]",
|
|
37
|
+
"classes": [
|
|
38
|
+
"text-[length:23px]"
|
|
39
|
+
],
|
|
40
|
+
"ids": []
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"width": "4px",
|
|
44
|
+
"selector": ".before\\:content-\\[\\'lynx\\'\\]::before",
|
|
45
|
+
"classes": [
|
|
46
|
+
"before:content-['lynx']"
|
|
47
|
+
],
|
|
48
|
+
"ids": []
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"width": "5px",
|
|
52
|
+
"selector": ".\\31 row",
|
|
53
|
+
"classes": [
|
|
54
|
+
"1row"
|
|
55
|
+
],
|
|
56
|
+
"ids": []
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"width": "6px",
|
|
60
|
+
"selector": ".-\\31 row",
|
|
61
|
+
"classes": [
|
|
62
|
+
"-1row"
|
|
63
|
+
],
|
|
64
|
+
"ids": []
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"width": "7px",
|
|
68
|
+
"selector": ".punct\\,comma",
|
|
69
|
+
"classes": [
|
|
70
|
+
"punct,comma"
|
|
71
|
+
],
|
|
72
|
+
"ids": []
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"width": "8px",
|
|
76
|
+
"selector": ".back\\\\slash",
|
|
77
|
+
"classes": [
|
|
78
|
+
"back\\slash"
|
|
79
|
+
],
|
|
80
|
+
"ids": []
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"width": "9px",
|
|
84
|
+
"selector": ".control\\1 z",
|
|
85
|
+
"classes": [
|
|
86
|
+
"control\u0001z"
|
|
87
|
+
],
|
|
88
|
+
"ids": []
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"width": "10px",
|
|
92
|
+
"selector": ".delete\\7f z",
|
|
93
|
+
"classes": [
|
|
94
|
+
"deletez"
|
|
95
|
+
],
|
|
96
|
+
"ids": []
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"width": "11px",
|
|
100
|
+
"selector": ".中文.💚",
|
|
101
|
+
"classes": [
|
|
102
|
+
"中文",
|
|
103
|
+
"💚"
|
|
104
|
+
],
|
|
105
|
+
"ids": []
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"width": "12px",
|
|
109
|
+
"selector": ".\\-",
|
|
110
|
+
"classes": [
|
|
111
|
+
"-"
|
|
112
|
+
],
|
|
113
|
+
"ids": []
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"width": "13px",
|
|
117
|
+
"selector": ".nul�z",
|
|
118
|
+
"classes": [
|
|
119
|
+
"nul�z"
|
|
120
|
+
],
|
|
121
|
+
"ids": []
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"width": "14px",
|
|
125
|
+
"selector": "#id\\:with\\[value\\]",
|
|
126
|
+
"classes": [],
|
|
127
|
+
"ids": [
|
|
128
|
+
"id:with[value]"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"width": "15px",
|
|
133
|
+
"selector": "#\\32 id",
|
|
134
|
+
"classes": [],
|
|
135
|
+
"ids": [
|
|
136
|
+
"2id"
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"width": "16px",
|
|
141
|
+
"selector": ":not(.a\\[b\\], #x\\:y)",
|
|
142
|
+
"classes": [
|
|
143
|
+
"a[b]"
|
|
144
|
+
],
|
|
145
|
+
"ids": [
|
|
146
|
+
"x:y"
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"width": "17px",
|
|
151
|
+
"selector": ".group\\/card:hover .group-hover\\/card\\:opacity-50",
|
|
152
|
+
"classes": [
|
|
153
|
+
"group/card",
|
|
154
|
+
"group-hover/card:opacity-50"
|
|
155
|
+
],
|
|
156
|
+
"ids": []
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"version": "0.0.53",
|
|
4
|
+
"sourceCommit": "3526f07a8cb25cfb2841736c76b54deadc7e6e46",
|
|
5
|
+
"buildrootCommit": "0d76bc8f966dbc64c69e310346ae5a4bd492570d",
|
|
6
|
+
"primjsCommit": "76a456ec5ead13e0dce78f519eefc6a2720088f2",
|
|
7
|
+
"toolsSharedCommit": "bdea62f7b500026aab237b271abc7eff279a5c2d",
|
|
8
|
+
"emsdkCommit": "15915cad554b707837024dc2758b6a1c5b94b036",
|
|
9
|
+
"emscriptenVersion": "4.0.22",
|
|
10
|
+
"compilerCommit": "bebaf7e50e31865b0724f17eaa52e161e2dfef5a",
|
|
11
|
+
"typescriptVersion": "5.9.3",
|
|
12
|
+
"inputs": {
|
|
13
|
+
"file": "rebuild/inputs.json",
|
|
14
|
+
"sha256": "5b51e443783b9fdbf76ff2909e956a5a37f33c8e628c4bd91b229341e002d91d"
|
|
15
|
+
},
|
|
16
|
+
"patches": [
|
|
17
|
+
{
|
|
18
|
+
"file": "patches/0001-decode-page-config-before-css.patch",
|
|
19
|
+
"sha256": "1282e4927efef30ce3a73a5dca4a499daafa5aef0fbef17026593ffb36376f62"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"file": "patches/0002-serialize-css-identifiers.patch",
|
|
23
|
+
"sha256": "f14ab36c1aa7e26b1021ff4b31af3030a82cd4fe21952c7af5f6dba5834c0b76"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"compressed": {
|
|
27
|
+
"file": "vendor/lepus.cjs.gz",
|
|
28
|
+
"byteLength": 2235071,
|
|
29
|
+
"sha256": "69e7b4cedc110e5ccdce3be24341cfb32ff67c171449b9fcc4c74515383d4b1a"
|
|
30
|
+
},
|
|
31
|
+
"decompressed": {
|
|
32
|
+
"byteLength": 13254390,
|
|
33
|
+
"sha256": "013cedf5d7fe0db0103b74d2936fba072e0f5a89c0a715af77f30b1d0627878b"
|
|
34
|
+
},
|
|
35
|
+
"license": {
|
|
36
|
+
"upstream": "Apache-2.0",
|
|
37
|
+
"files": [
|
|
38
|
+
{
|
|
39
|
+
"source": "source/LICENSE",
|
|
40
|
+
"file": "vendor/licenses/source-LICENSE.txt",
|
|
41
|
+
"byteLength": 11359,
|
|
42
|
+
"sha256": "8c6db340475136df3c1201d458fa5755698eace76e510471ecc9d857d6083dac"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"source": "source/NOTICE",
|
|
46
|
+
"file": "vendor/licenses/source-NOTICE.txt",
|
|
47
|
+
"byteLength": 104,
|
|
48
|
+
"sha256": "6bb60674cefa3ec8c621bc9ea89ca26892b411dd3e05ab463e4aa62f009527ef"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"source": "source/third_party/quickjs/src/LICENSE",
|
|
52
|
+
"file": "vendor/licenses/source-third_party-quickjs-src-LICENSE.txt",
|
|
53
|
+
"byteLength": 11358,
|
|
54
|
+
"sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"source": "source/third_party/quickjs/LICENSE",
|
|
58
|
+
"file": "vendor/licenses/source-third_party-quickjs-LICENSE.txt",
|
|
59
|
+
"byteLength": 1130,
|
|
60
|
+
"sha256": "598fd7fc928e4350abce36e337ba5a1346923c5c692f5be92c3d8e29ddd7c18d"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"source": "source/third_party/jsoncpp/LICENSE",
|
|
64
|
+
"file": "vendor/licenses/source-third_party-jsoncpp-LICENSE.txt",
|
|
65
|
+
"byteLength": 2654,
|
|
66
|
+
"sha256": "e23d552f4ccc2076b7ec627b24aa3eadba58d1a5e025d4b83ac5c9cae43063a7"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"source": "source/third_party/double-conversion/LICENSE",
|
|
70
|
+
"file": "vendor/licenses/source-third_party-double-conversion-LICENSE.txt",
|
|
71
|
+
"byteLength": 1527,
|
|
72
|
+
"sha256": "4af93c12062c58058378de2397dc1c92bbff9ddfb1d583a01c84127557ce97ca"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"source": "source/third_party/rapidjson/license.txt",
|
|
76
|
+
"file": "vendor/licenses/source-third_party-rapidjson-license.txt.txt",
|
|
77
|
+
"byteLength": 5152,
|
|
78
|
+
"sha256": "a140e5d46fe734a1c78f1a3c3ef207871dd75648be71fdda8e309b23ab8b1f32"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"source": "source/third_party/modp_b64/LICENSE",
|
|
82
|
+
"file": "vendor/licenses/source-third_party-modp_b64-LICENSE.txt",
|
|
83
|
+
"byteLength": 1721,
|
|
84
|
+
"sha256": "d47e8390fb0d7ad4a18f26aedd6283c7ab6b5b4fabab536ccb4db7f9f6d90c08"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"source": "source/third_party/aes/LICENSE",
|
|
88
|
+
"file": "vendor/licenses/source-third_party-aes-LICENSE.txt",
|
|
89
|
+
"byteLength": 1065,
|
|
90
|
+
"sha256": "b803686e512df1b03e51062080b0f1f5e699a99059c54a2da1f779c3b14feec5"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"source": "emsdk/upstream/emscripten/LICENSE",
|
|
94
|
+
"file": "vendor/licenses/emsdk-upstream-emscripten-LICENSE.txt",
|
|
95
|
+
"byteLength": 5093,
|
|
96
|
+
"sha256": "620a78084fc7ca97c0b5dea9abf891f3ffcadfdbf305276f099c9c4e12fc1d86"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"source": "emsdk/upstream/emscripten/system/lib/libc/musl/COPYRIGHT",
|
|
100
|
+
"file": "vendor/licenses/emsdk-upstream-emscripten-system-lib-libc-musl-COPYRIGHT.txt",
|
|
101
|
+
"byteLength": 6204,
|
|
102
|
+
"sha256": "f9bc4423732350eb0b3f7ed7e91d530298476f8fec0c6c427a1c04ade22655af"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"source": "emsdk/upstream/emscripten/system/lib/libcxx/LICENSE.TXT",
|
|
106
|
+
"file": "vendor/licenses/emsdk-upstream-emscripten-system-lib-libcxx-LICENSE.TXT.txt",
|
|
107
|
+
"byteLength": 16703,
|
|
108
|
+
"sha256": "539dd7aed86e8a4f12cbdd0e6c50c189c7d74847e4fecc64ce2c6ee3a01da38b"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"source": "emsdk/upstream/emscripten/system/lib/libcxxabi/LICENSE.TXT",
|
|
112
|
+
"file": "vendor/licenses/emsdk-upstream-emscripten-system-lib-libcxxabi-LICENSE.TXT.txt",
|
|
113
|
+
"byteLength": 16706,
|
|
114
|
+
"sha256": "e2b35be49f7284a45b7baca8fc7b3ab7440e7902392b2528a457816b5bb2a15c"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"source": "emsdk/upstream/emscripten/system/lib/compiler-rt/LICENSE.TXT",
|
|
118
|
+
"file": "vendor/licenses/emsdk-upstream-emscripten-system-lib-compiler-rt-LICENSE.TXT.txt",
|
|
119
|
+
"byteLength": 16708,
|
|
120
|
+
"sha256": "1a8f1058753f1ba890de984e48f0242a3a5c29a6a8f2ed9fd813f36985387e8d"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"source": "emsdk/upstream/emscripten/system/lib/libunwind/LICENSE.TXT",
|
|
124
|
+
"file": "vendor/licenses/emsdk-upstream-emscripten-system-lib-libunwind-LICENSE.TXT.txt",
|
|
125
|
+
"byteLength": 16706,
|
|
126
|
+
"sha256": "b5efebcaca80879234098e52d1725e6d9eb8fb96a19fce625d39184b705f7b6d"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
--- a/core/template_bundle/template_codec/binary_decoder/lynx_binary_base_template_reader.cc
|
|
2
|
+
+++ b/core/template_bundle/template_codec/binary_decoder/lynx_binary_base_template_reader.cc
|
|
3
|
+
@@ -47,10 +47,11 @@
|
|
4
|
+
BinarySection::STRING,
|
|
5
|
+
BinarySection::PARSED_STYLES,
|
|
6
|
+
BinarySection::ELEMENT_TEMPLATE,
|
|
7
|
+
+ // CSS 规则的二进制格式依赖页面配置,必须先读取配置。
|
|
8
|
+
+ BinarySection::CONFIG,
|
|
9
|
+
BinarySection::CSS,
|
|
10
|
+
BinarySection::JS,
|
|
11
|
+
BinarySection::JS_BYTECODE,
|
|
12
|
+
- BinarySection::CONFIG,
|
|
13
|
+
BinarySection::ROOT_LEPUS,
|
|
14
|
+
BinarySection::LEPUS_CHUNK,
|
|
15
|
+
BinarySection::CUSTOM_SECTIONS,
|
|
16
|
+
--- a/core/template_bundle/template_codec/binary_decoder/lynx_binary_base_template_reader_impl.cc
|
|
17
|
+
+++ b/core/template_bundle/template_codec/binary_decoder/lynx_binary_base_template_reader_impl.cc
|
|
18
|
+
@@ -355,13 +355,14 @@
|
|
19
|
+
const static std::vector<BinarySection> kSectionOrder{
|
|
20
|
+
BinarySection::STRING,
|
|
21
|
+
BinarySection::PARSED_STYLES,
|
|
22
|
+
+ // CSS 规则的二进制格式依赖页面配置,必须先读取配置。
|
|
23
|
+
+ BinarySection::CONFIG,
|
|
24
|
+
BinarySection::CSS,
|
|
25
|
+
BinarySection::JS,
|
|
26
|
+
BinarySection::JS_BYTECODE,
|
|
27
|
+
BinarySection::COMPONENT,
|
|
28
|
+
BinarySection::APP,
|
|
29
|
+
BinarySection::PAGE,
|
|
30
|
+
- BinarySection::CONFIG,
|
|
31
|
+
BinarySection::DYNAMIC_COMPONENT,
|
|
32
|
+
BinarySection::USING_DYNAMIC_COMPONENT_INFO,
|
|
33
|
+
BinarySection::THEMED,
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
--- a/core/renderer/css/ng/selector/lynx_css_selector.cc
|
|
2
|
+
+++ b/core/renderer/css/ng/selector/lynx_css_selector.cc
|
|
3
|
+
@@ -14,6 +14,39 @@
|
|
4
|
+
|
|
5
|
+
namespace lynx {
|
|
6
|
+
namespace css {
|
|
7
|
+
+
|
|
8
|
+
+namespace {
|
|
9
|
+
+
|
|
10
|
+
+void AppendCSSIdentifier(std::string& result, const std::string& identifier) {
|
|
11
|
+
+ constexpr char kHexDigits[] = "0123456789abcdef";
|
|
12
|
+
+ for (size_t index = 0; index < identifier.size(); ++index) {
|
|
13
|
+
+ const auto character = static_cast<unsigned char>(identifier[index]);
|
|
14
|
+
+ if (character == 0) {
|
|
15
|
+
+ result += "\xef\xbf\xbd";
|
|
16
|
+
+ } else if (character <= 0x1f || character == 0x7f ||
|
|
17
|
+
+ (character >= '0' && character <= '9' &&
|
|
18
|
+
+ (index == 0 || (index == 1 && identifier[0] == '-')))) {
|
|
19
|
+
+ // CSSOM 的码点转义后保留空格,避免后续十六进制字符被合并。
|
|
20
|
+
+ result.push_back('\\');
|
|
21
|
+
+ if (character >= 0x10) result.push_back(kHexDigits[character >> 4]);
|
|
22
|
+
+ result.push_back(kHexDigits[character & 0xf]);
|
|
23
|
+
+ result.push_back(' ');
|
|
24
|
+
+ } else if (character == '-' && identifier.size() == 1) {
|
|
25
|
+
+ result += "\\-";
|
|
26
|
+
+ } else if (character >= 0x80 || character == '-' || character == '_' ||
|
|
27
|
+
+ (character >= '0' && character <= '9') ||
|
|
28
|
+
+ (character >= 'A' && character <= 'Z') ||
|
|
29
|
+
+ (character >= 'a' && character <= 'z')) {
|
|
30
|
+
+ // 非 ASCII 的 UTF-8 字节保持原样,不改变已解码的标识符。
|
|
31
|
+
+ result.push_back(static_cast<char>(character));
|
|
32
|
+
+ } else {
|
|
33
|
+
+ result.push_back('\\');
|
|
34
|
+
+ result.push_back(static_cast<char>(character));
|
|
35
|
+
+ }
|
|
36
|
+
+ }
|
|
37
|
+
+}
|
|
38
|
+
+
|
|
39
|
+
+} // namespace
|
|
40
|
+
|
|
41
|
+
void LynxCSSSelector::FromLepus(LynxCSSSelector& s, const lepus_value& value) {
|
|
42
|
+
if (!value.IsArray()) {
|
|
43
|
+
@@ -196,10 +229,10 @@
|
|
44
|
+
selector = selector->TagHistory()) {
|
|
45
|
+
if (selector->Match() == kId) {
|
|
46
|
+
result.push_back('#');
|
|
47
|
+
- result += selector->Value();
|
|
48
|
+
+ AppendCSSIdentifier(result, selector->Value());
|
|
49
|
+
} else if (selector->Match() == kClass) {
|
|
50
|
+
result.push_back('.');
|
|
51
|
+
- result += selector->Value();
|
|
52
|
+
+ AppendCSSIdentifier(result, selector->Value());
|
|
53
|
+
} else if (selector->Match() == kPseudoClass) {
|
|
54
|
+
result.push_back(':');
|
|
55
|
+
result += selector->Value();
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"archives": [
|
|
4
|
+
{
|
|
5
|
+
"file": "pyyaml-6.0.3.tar.gz",
|
|
6
|
+
"url": "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz",
|
|
7
|
+
"sha256": "d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f",
|
|
8
|
+
"destination": [
|
|
9
|
+
"pyyaml"
|
|
10
|
+
],
|
|
11
|
+
"strip": 1
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"toolchain": {
|
|
15
|
+
"emscriptenCommit": "0f3d2e62bccf8e14497ff19e05a1202c51eb0c65",
|
|
16
|
+
"llvmCommit": "c7706d9472fe880ba1d3418919ad4185710c9559",
|
|
17
|
+
"emccScriptSha256": "8aceac1889631c2902b2265c7991a18d187e3deec157e8194e489e0988a564d1",
|
|
18
|
+
"clang": {
|
|
19
|
+
"darwin-arm64": {
|
|
20
|
+
"byteLength": 114441120,
|
|
21
|
+
"sha256": "0e966e8d4d52dd12e809f062667c50839173eab6a13ed4c10354604fd0bc0967"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|