MyGit

merge_pr_48026

web-platform-tests/wpt

版本发布时间: 2024-09-07 06:59:21

web-platform-tests/wpt最新发布版本:merge_pr_48029(2024-09-07 13:25:31)

Ensure TreeWalker operations return Node in its own context, not the receiver's

Normally, when Nodes are accessible across frames, we apply the extended attribute [CheckSecurity=ReturnValue] in the IDL. The generated bindings then perform the necessary security checks and wrap the Node in its own context, not the receiver context.

TreeWalker is different. The root node is already known to be accessible (otherwise it couldn't be passed to the constructor), and therefore any Node returned by TreeWalker must be accessible, since TreeWalker doesn't walk across frame boundaries. However, the TreeWalker and the Node are not required to be from the same context (I don't know why, it's an old API, this seems like the kind of design flaw we would catch in a modern API). So TreeWalker is in a weird middle ground: it doesn't need security checks, but it does need to wrap any Nodes it returns in the Node's context, not the TreeWalker's context.

This CL adds a new extended attribute, [NodeWrapInOwnContext], for TreeWalker (and related APIs, NodeIterator and NodeFilter). When the extended attribute is present, the Node will be wrapped for use in V8 with the Node's v8::Context, not the TreeWalker's v8::Context.

Fixed: 324929076 Change-Id: I1359483a9b89f7fcc4d1d522a203e357f2136734 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5331177 Reviewed-by: Andrey Kosyakov caseq@chromium.org Commit-Queue: Nate Chapin japhet@chromium.org Cr-Commit-Position: refs/heads/main@{#1352303}

相关地址:原始地址 下载(tar) 下载(zip)

1、 MANIFEST-0f9156c95b61f845605d1c9a65ddd038d574c801.json.bz2 2.47MB

2、 MANIFEST-0f9156c95b61f845605d1c9a65ddd038d574c801.json.gz 3.03MB

3、 MANIFEST-0f9156c95b61f845605d1c9a65ddd038d574c801.json.zst 2.46MB

4、 WEB_FEATURES_MANIFEST-0f9156c95b61f845605d1c9a65ddd038d574c801.json.bz2 67.41KB

5、 WEB_FEATURES_MANIFEST-0f9156c95b61f845605d1c9a65ddd038d574c801.json.gz 78.04KB

6、 WEB_FEATURES_MANIFEST-0f9156c95b61f845605d1c9a65ddd038d574c801.json.zst 66.71KB

查看:2024-09-07发行的版本