update css-what 7.0.0 Created-by: BoJiang4702 Commit-by: Bojiang Merged-by: openharmony_ci Description: ### 一、内容说明(相关的Issue) https://gitcode.com/openharmony/third_party_css-what/issues/25?ref=&did=3491996#tid-3491996 ### 二、建议测试周期和提测地址 建议测试完成时间:xxxx.xx.xx 投产上线时间:xxxx.xx.xx 提测地址:CI环境/压测环境 测试账号: ### 三、变更内容 * 3.1 关联PR列表 NA * 3.2 数据库和部署说明 1. 常规更新 2. 重启unicorn 3. 重启sidekiq 4. 迁移任务:是否有迁移任务,没有写 "无"无 5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无"无 * 3.4 其他技术优化内容(做了什么,变更了什么) - 重构了 xxxx 代码 - xxxx 算法优化 更新css-what到7.0.0版本 * 3.5 废弃通知(什么字段、方法弃用?) 不涉及 * 3.6 后向不兼容变更(是否有无法向后兼容的变更?) 不涉及 ### 四、研发自测点(自测哪些?冒烟用例全部自测?) 自测测试结论: pass ### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方) 检查点:后代选择器 | 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 | |------|------------|----------|---------------| | xxx | 否 | 需要 | 不需要 | | | | | | 接口测试:NA 性能测试:NA 并发测试:NA 其他:NA See merge request: openharmony/third_party_css-what!26
css-what
A CSS selector parser.
Example
import * as CSSwhat from "css-what";
CSSwhat.parse("foo[bar]:baz")
~> [
[
{ type: "tag", name: "foo" },
{
type: "attribute",
name: "bar",
action: "exists",
value: "",
ignoreCase: null
},
{ type: "pseudo", name: "baz", data: null }
]
]
API
CSSwhat.parse(selector) - Parses selector.
The function returns a two-dimensional array. The first array represents selectors separated by commas (eg. sub1, sub2), the second contains the relevant tokens for that selector. Possible token types are:
| name | properties | example | output |
|---|---|---|---|
tag |
name |
div |
{ type: 'tag', name: 'div' } |
universal |
- | * |
{ type: 'universal' } |
pseudo |
name, data |
:name(data) |
{ type: 'pseudo', name: 'name', data: 'data' } |
pseudo |
name, data |
:name |
{ type: 'pseudo', name: 'name', data: null } |
pseudo-element |
name |
::name |
{ type: 'pseudo-element', name: 'name' } |
attribute |
name, action, value, ignoreCase |
[attr] |
{ type: 'attribute', name: 'attr', action: 'exists', value: '', ignoreCase: false } |
attribute |
name, action, value, ignoreCase |
[attr=val] |
{ type: 'attribute', name: 'attr', action: 'equals', value: 'val', ignoreCase: false } |
attribute |
name, action, value, ignoreCase |
[attr^=val] |
{ type: 'attribute', name: 'attr', action: 'start', value: 'val', ignoreCase: false } |
attribute |
name, action, value, ignoreCase |
[attr$=val] |
{ type: 'attribute', name: 'attr', action: 'end', value: 'val', ignoreCase: false } |
child |
- | > |
{ type: 'child' } |
parent |
- | < |
{ type: 'parent' } |
sibling |
- | ~ |
{ type: 'sibling' } |
adjacent |
- | + |
{ type: 'adjacent' } |
descendant |
- | { type: 'descendant' } |
|
column-combinator |
- | || |
{ type: 'column-combinator' } |
CSSwhat.stringify(selector) - Turns selector back into a string.
License: BSD-2-Clause
Security contact information
To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.
css-what for enterprise
Available as part of the Tidelift Subscription
The maintainers of css-what and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.