当前位置: 首页 > news >正文

Chromium html<lable>c++接口定义

HTML <label> 元素(标签)表示用户界面中某个元素的说明。

1、<label> 在html_tag_names.json5中接口定义:

   (third_party\blink\renderer\core\html\html_tag_names.json5)

    {name: "label",interfaceHeaderDir: "third_party/blink/renderer/core/html/forms",},

2、html_label_element.idl接口定义:

// https://html.spec.whatwg.org/C/#the-label-element
[Exposed=Window,HTMLConstructor
] interface HTMLLabelElement : HTMLElement {readonly attribute HTMLFormElement? form;[CEReactions, Reflect=for] attribute DOMString htmlFor;readonly attribute HTMLElement? control;
};

2、html_label_element.idl接口blink实现:

third_party\blink\renderer\core\html\forms\html_label_element.h

third_party\blink\renderer\core\html\forms\html_label_element.cc

namespace blink {class CORE_EXPORT HTMLLabelElement final : public HTMLElement {DEFINE_WRAPPERTYPEINFO();public:explicit HTMLLabelElement(Document&);HTMLElement* control() const;HTMLFormElement* form() const;bool WillRespondToMouseClickEvents() override;private:bool IsInInteractiveContent(Node*) const;bool IsInteractiveContent() const override;void AccessKeyAction(SimulatedClickCreationScope creation_scope) override;// Overridden to update the hover/active state of the corresponding control.void SetActive(bool active) override;void SetHovered(bool hovered) override;// Overridden to either click() or focus() the corresponding control.void DefaultEventHandler(Event&) override;bool HasActivationBehavior() const override;void Focus(const FocusParams&) override;bool processing_click_;
};}  // namespace blink

3、html_label_element.idl接口v8实现:

out\Debug\gen\third_party\blink\renderer\bindings\core\v8\v8_html_label_element.h

out\Debug\gen\third_party\blink\renderer\bindings\core\v8\v8_html_label_element.cc

namespace blink {bool V8HTMLLabelElement::IsExposed(ExecutionContext* execution_context) {return execution_context->IsWindow();
}// Construction of WrapperTypeInfo may require non-trivial initialization due
// to cross-component address resolution in order to load the pointer to the
// parent interface's WrapperTypeInfo.  We ignore this issue because the issue
// happens only on component builds and the official release builds
// (statically-linked builds) are never affected by this issue.
#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wglobal-constructors"
#endifconst WrapperTypeInfo V8HTMLLabelElement::wrapper_type_info_{gin::kEmbedderBlink,V8HTMLLabelElement::InstallInterfaceTemplate,nullptr,"HTMLLabelElement",V8HTMLElement::GetWrapperTypeInfo(),WrapperTypeInfo::kWrapperTypeObjectPrototype,WrapperTypeInfo::kNodeClassId,WrapperTypeInfo::kNotInheritFromActiveScriptWrappable,WrapperTypeInfo::kIdlInterface,false,
};#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__)
#pragma clang diagnostic pop
#endifconst WrapperTypeInfo& HTMLLabelElement::wrapper_type_info_ =V8HTMLLabelElement::wrapper_type_info_;// non-[ActiveScriptWrappable]
static_assert(!std::is_base_of<ActiveScriptWrappableBase, HTMLLabelElement>::value,"HTMLLabelElement inherits from ActiveScriptWrappable<> without ""[ActiveScriptWrappable] extended attribute.");namespace  {namespace v8_html_label_element {void FormAttributeGetCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_HTMLLabelElement_form_Getter");
BLINK_BINDINGS_TRACE_EVENT("HTMLLabelElement.form.get");v8::Isolate* isolate = info.GetIsolate();
v8::Local<v8::Object> v8_receiver = info.This();
HTMLLabelElement* blink_receiver = V8HTMLLabelElement::ToWrappableUnsafe(isolate, v8_receiver);
auto&& return_value = blink_receiver->form();
bindings::V8SetReturnValue(info, return_value, blink_receiver);
}void HTMLForAttributeGetCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_HTMLLabelElement_htmlFor_Getter");
BLINK_BINDINGS_TRACE_EVENT("HTMLLabelElement.htmlFor.get");v8::Isolate* isolate = info.GetIsolate();
v8::Local<v8::Object> v8_receiver = info.This();
HTMLLabelElement* blink_receiver = V8HTMLLabelElement::ToWrappableUnsafe(isolate, v8_receiver);
auto&& return_value = blink_receiver->FastGetAttribute(html_names::kForAttr);
bindings::V8SetReturnValue(info, return_value, isolate, bindings::V8ReturnValue::kNonNullable);
}void HTMLForAttributeSetCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_HTMLLabelElement_htmlFor_Setter");
BLINK_BINDINGS_TRACE_EVENT("HTMLLabelElement.htmlFor.set");const char* const class_like_name = "HTMLLabelElement";
const char* const property_name = "htmlFor";
bindings::PerformAttributeSetCEReactionsReflectTypeString(info, html_names::kForAttr, class_like_name, property_name);
}void ControlAttributeGetCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_HTMLLabelElement_control_Getter");
BLINK_BINDINGS_TRACE_EVENT("HTMLLabelElement.control.get");v8::Isolate* isolate = info.GetIsolate();
v8::Local<v8::Object> v8_receiver = info.This();
HTMLLabelElement* blink_receiver = V8HTMLLabelElement::ToWrappableUnsafe(isolate, v8_receiver);
auto&& return_value = blink_receiver->control();
bindings::V8SetReturnValue(info, return_value, blink_receiver);
}void ConstructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_HTMLLabelElement_constructor");
BLINK_BINDINGS_TRACE_EVENT("HTMLLabelElement.constructor");v8::Isolate* isolate = info.GetIsolate();
if (!info.IsConstructCall()) {const ExceptionContextType exception_context_type = ExceptionContextType::kConstructorOperationInvoke;
const char* const class_like_name = "HTMLLabelElement";
ExceptionState exception_state(isolate, exception_context_type, class_like_name);
exception_state.ThrowTypeError(ExceptionMessages::ConstructorCalledAsFunction());
return;
}
if (ConstructorMode::Current(isolate) == ConstructorMode::kWrapExistingObject) {v8::Local<v8::Object> v8_receiver = info.This();
bindings::V8SetReturnValue(info, v8_receiver);
return;
}// [HTMLConstructor]
V8HTMLConstructor::HtmlConstructor(info, *V8HTMLLabelElement::GetWrapperTypeInfo(), HTMLElementType::kHTMLLabelElement);
}}  // namespace v8_html_label_elementusing namespace v8_html_label_element;}  // namespace void V8HTMLLabelElement::InstallInterfaceTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::Template> interface_template) {const WrapperTypeInfo* const wrapper_type_info = V8HTMLLabelElement::GetWrapperTypeInfo();
v8::Local<v8::FunctionTemplate> interface_function_template = interface_template.As<v8::FunctionTemplate>();
v8::Local<v8::ObjectTemplate> instance_object_template = interface_function_template->InstanceTemplate();
v8::Local<v8::ObjectTemplate> prototype_object_template = interface_function_template->PrototypeTemplate();
v8::Local<v8::FunctionTemplate> parent_interface_template = wrapper_type_info->parent_class->GetV8ClassTemplate(isolate, world).As<v8::FunctionTemplate>();
bindings::SetupIDLInterfaceTemplate(isolate, wrapper_type_info, instance_object_template, prototype_object_template, interface_function_template, parent_interface_template);interface_function_template->SetCallHandler(ConstructorCallback);
interface_function_template->SetLength(0);v8::Local<v8::Template> instance_template = instance_object_template;
v8::Local<v8::Template> prototype_template = prototype_object_template;
InstallUnconditionalProperties(isolate, world, instance_template, prototype_template, interface_template);
}void V8HTMLLabelElement::InstallUnconditionalProperties(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::Template> instance_template, v8::Local<v8::Template> prototype_template, v8::Local<v8::Template> interface_template) {using bindings::IDLMemberInstaller;{static const IDLMemberInstaller::AttributeConfig kAttributeTable[] = {
{"form", FormAttributeGetCallback, nullptr, unsigned(v8::None), unsigned(IDLMemberInstaller::FlagLocation::kPrototype), unsigned(IDLMemberInstaller::FlagWorld::kAllWorlds), unsigned(IDLMemberInstaller::FlagReceiverCheck::kCheck), unsigned(IDLMemberInstaller::FlagCrossOriginCheck::kCheck), unsigned(IDLMemberInstaller::FlagCrossOriginCheck::kCheck), unsigned(v8::SideEffectType::kHasNoSideEffect), unsigned(V8PrivateProperty::CachedAccessor::kNone)},
{"htmlFor", HTMLForAttributeGetCallback, HTMLForAttributeSetCallback, unsigned(v8::None), unsigned(IDLMemberInstaller::FlagLocation::kPrototype), unsigned(IDLMemberInstaller::FlagWorld::kAllWorlds), unsigned(IDLMemberInstaller::FlagReceiverCheck::kCheck), unsigned(IDLMemberInstaller::FlagCrossOriginCheck::kCheck), unsigned(IDLMemberInstaller::FlagCrossOriginCheck::kCheck), unsigned(v8::SideEffectType::kHasNoSideEffect), unsigned(V8PrivateProperty::CachedAccessor::kNone)},
{"control", ControlAttributeGetCallback, nullptr, unsigned(v8::None), unsigned(IDLMemberInstaller::FlagLocation::kPrototype), unsigned(IDLMemberInstaller::FlagWorld::kAllWorlds), unsigned(IDLMemberInstaller::FlagReceiverCheck::kCheck), unsigned(IDLMemberInstaller::FlagCrossOriginCheck::kCheck), unsigned(IDLMemberInstaller::FlagCrossOriginCheck::kCheck), unsigned(v8::SideEffectType::kHasNoSideEffect), unsigned(V8PrivateProperty::CachedAccessor::kNone)},
};
v8::Local<v8::FunctionTemplate> interface_function_template = interface_template.As<v8::FunctionTemplate>();
v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interface_function_template);
IDLMemberInstaller::InstallAttributes(isolate, world, instance_template, prototype_template, interface_template, signature, kAttributeTable);
}}}  // namespace blink

相关文章:

Chromium html<lable>c++接口定义

HTML <label> 元素&#xff08;标签&#xff09;表示用户界面中某个元素的说明。 1、<label> 在html_tag_names.json5中接口定义&#xff1a; &#xff08;third_party\blink\renderer\core\html\html_tag_names.json5&#xff09; {name: "label",inte…...

QT中中文显示乱码问题

在VS2013中用QT开发GUI应用程序&#xff0c;Qt中显示中文乱码 一&#xff1a; //解决QT中中文显示乱码问题 #pragma execution_character_set("utf-8") 二&#xff1a;在main函数中添加以下代码&#xff1a; #include <QTextCodec>void main() {QTextCod…...

[面试常见]Javascript基础知识

#1024程序员节|征文# Object.assign 和对象扩展运算符有什么区别?是深拷贝还是浅拷贝? 都进行浅拷贝&#xff0c;只赋值对象的第一层属性&#xff0c;而不会递归复制整个对象结构 **const mergedObj Object.assign({},obj1,obj2) JavaScript 中 Map 和 Object 的区别是什么?…...

使用注解@ExcelIgnoreUnannotated实现了在导出 Excel 时忽略没有被标注的字段

ExcelIgnoreUnannotated 注解用于在使用 Apache POI 或其他 Excel 处理库时&#xff0c;指示在导出 Excel 时忽略没有被标注的字段。这意味着只有被特定注解&#xff08;如 ExcelProperty&#xff09;标注的字段会被处理和导出。 作用 简化导出过程&#xff1a;只导出需要的字…...

线程的同步

目录 引入 认识条件变量 快速认识接口​编辑 认识条件变量​编辑 测试代码​编辑 生产消费模型 为何要使用生产者消费者模型 理解 编写生产消费模型 BlockingQueue 单生产单消费 多生产多消费 引入 同步&#xff1a;在保证数据安全的前提下&#xff0c;让线程…...

【启明智显分享】ZX7981PG/ZX7981PM融入官方OpenWrt,启明智显SDK/官方OpenWrt任由选择!

好消息&#xff01;好消息&#xff01;启明智显ZX7981PG和ZX7981PM正式融入官方 OpenWrt 的大家庭啦&#xff01;现在开发者不仅可以基于启明智显的SDK进行二次开发&#xff0c;还可以直接应用官方OpenWrt以及我们的开源资料进行开发&#xff01; 借助OpenWrt的强大生态&…...

如何用java发送包含表格形式的邮件

问题&#xff1a; 如何用java发送包含表格形式的邮件&#xff1f; 方法&#xff1a; 发用freemaker工具来替换html的表格变量&#xff0c;从而动态生成了html。然后再发送这个html格式&#xff08;不能用纯文本&#xff09;文本即可。 优化流程&#xff1a; 1、准备模板&#x…...

讲个故事:关于一次接口性能优化的心里路程

这是一个程序猿写的第一个故事&#xff0c;请各位懂行的客官静下心来&#xff0c;慢慢品读。就知道我为什么要单独写一个文章来记录这次过程了&#xff0c;因为实在是太坎坷了...... 背景介绍 近期项目投产时遇到一个问题&#xff0c;投产后在验证时发现大部分用户系统登…...

Centos7升级到openssh9.9

openssh9.9 是2024.9.20出的最新版ssh。因为客户扫描出一大堆centos7的漏洞&#xff0c;全是这个openssh的&#xff0c;好多补丁&#xff0c;所以索性升级到最新版。 需要自己制作rpm包&#xff0c;这个我是不懂&#xff0c;照这个来&#xff1a; Linux服务器升级openssh9.9最…...

使用 STM32F407 串口实现 485 通信

准备工作 了解485通信基本概念与原理&#xff1a;RS485通信详解_485通讯de接什么口-CSDN博客 安装编译软件&#xff1a;keil uVision 5.6 软件资料&#xff1a;STM32CubeF4 固件包&#xff0c;正点原子RS485通信例程 ​​​​​​​参考视频&#xff1a;第26讲 基础篇-新建H…...

基于NERF技术重建学习笔记

NeRF&#xff08;Neural Radiance Fields&#xff09;是一种用于3D场景重建的神经网络模型&#xff0c;能够从2D图像生成逼真的3D渲染效果。它将场景表征为一个连续的5D函数&#xff0c;利用了体积渲染和神经网络的结合&#xff0c;通过学习光线穿过空间时的颜色和密度来重建场…...

webView 支持全屏播放

webView 支持全屏播放 直接上代码 public class CustomFullScreenWebViewClient extends WebChromeClient {WebView webView;Context context;/*** 视频全屏参数*/protected static final FrameLayout.LayoutParams COVER_SCREEN_PARAMS new FrameLayout.LayoutParams(ViewG…...

QGIS之三十二DEM地形导出三维模型gltf

效果 1、准备数据 (1)dem.tif (2)dom.tif 2、qgis加载dem和dom数据 3、安装插件 插件步骤可以参考这篇文章 QGIS之二十四安装插件 安装了Qgis2threejs插件,结果...

【python爬虫】携程旅行景点游客数据分析与可视化

一.选题背景 随着旅游业的快速发展&#xff0c;越来越多的人选择通过互联网平台预订旅行产品&#xff0c;其中携程网作为国内领先的在线旅行服务提供商&#xff0c;拥有大量的旅游产品和用户数据。利用爬虫技术可以获取携程网上各个景点的游客数据&#xff0c;包括游客数量、游…...

python实现onvif协议下控制摄像头变焦,以及融合人形识别与跟踪控制

#1024程序员节 | 征文# 这两天才因为项目需要&#xff0c;对网络摄像头的视频采集以及实现人形识别与跟踪技术。对于onvif协议自然起先也没有任何的了解。但是购买的摄像头是SONY网络头是用在其他地方的。因为前期支持探究项目解决方案&#xff0c;就直接拿来做demo测试使用。 …...

【Vue】Vue3.0(十四)接口,泛型和自定义类型的概念及使用

上篇文章&#xff1a; 【Vue】Vue3.0&#xff08;十三&#xff09;中标签属性ref&#xff08;加在普通标签上、加在组件标签上&#xff09;、局部样式 &#x1f3e1;作者主页&#xff1a;点击&#xff01; &#x1f916;Vue专栏&#xff1a;点击&#xff01; ⏰️创作时间&…...

【C++】红黑树万字详解(一文彻底搞懂红黑树的底层逻辑)

目录 00.引入 01.红黑树的性质 02.红黑树的定义 03.红黑树的插入 1.按照二叉搜索树的规则插入新节点 2.检测新节点插入后&#xff0c;是否满足红黑树的性质 1.uncle节点存在且为红色 2.uncle节点不存在 3.uncle节点存在且为黑色 04.验证红黑树 00.引入 和AVL树一样&am…...

开源FluentFTP实操,操控FTP文件

概述&#xff1a;通过FluentFTP库&#xff0c;轻松在.NET中实现FTP功能。支持判断、创建、删除文件夹&#xff0c;判断文件是否存在&#xff0c;实现上传、下载和删除文件。简便而强大的FTP操作&#xff0c;提升文件传输效率。 在.NET中&#xff0c;使用FluentFTP库可以方便地…...

论文解读 | ECCV2024 AutoEval-Video:一个用于评估大型视觉-语言模型在开放式视频问答中的自动基准测试...

点击蓝字 关注我们 AI TIME欢迎每一位AI爱好者的加入&#xff01; 点击 阅读原文 观看作者讲解回放&#xff01; 作者简介 陈修元&#xff0c;上海交通大学清源研究院硕士生 概述 总结来说&#xff0c;我们提出了一个新颖且具有挑战性的基准测试AutoEvalVideo&#xff0c;用于全…...

postgresql14主从同步流复制搭建

1. 如果使用docker搭建请移步 Docker 启动 PostgreSQL 主从架构&#xff1a;实现数据同步的高效部署指南_docker安装postgresql主从同步-CSDN博客 2. 背景 pgsql版本&#xff1a;PostgreSQL 14.13 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4…...

人工智能体共情能力模块设计与实践(下)

八、实验设计方案 8.1 数据集设计 建议构建一个多场景中文共情对话数据集。 场景分类 场景 示例 客服投诉 订单、退款、物流、系统故障 学习辅导 学不会、考试焦虑、代码报错 工作压力 加班、沟通冲突、任务失败 情绪倾诉 难过、焦虑、失落 决策支持 不知道如何选择 高风险表…...

Godot开发者必备:awesome-godot资源库高效使用指南

1. 项目概述&#xff1a;一个开源游戏引擎的“宝藏库” 如果你正在使用或考虑使用 Godot 引擎进行游戏开发&#xff0c;那么你很可能已经听说过 awesome-godot 这个项目。它不是一个可以直接运行的软件&#xff0c;也不是一个插件&#xff0c;而是一个由社区共同维护的、结构…...

汽车后市场品牌营销路径:以奇正沐古和康明斯为例

在汽车后市场&#xff0c;很多品牌真正的难题并非没有技术、没有产品、没有资源&#xff0c;而是这些优势到了终端之后&#xff0c;无法变成司机、经销商和维修点愿意相信、愿意推荐、愿意购买的理由。康明斯发动机润滑油就是个典型例子&#xff0c;康明斯作为全球柴油发动机技…...

独立开发者如何借助taotoken模型广场低成本验证产品创意

&#x1f680; 告别海外账号与网络限制&#xff01;稳定直连全球优质大模型&#xff0c;限时半价接入中。 &#x1f449; 点击领取海量免费额度 独立开发者如何借助Taotoken模型广场低成本验证产品创意 对于资源有限的独立开发者或小型工作室而言&#xff0c;验证一个需要AI功…...

通过Taotoken官方价折扣与活动价降低大模型API使用门槛

&#x1f680; 告别海外账号与网络限制&#xff01;稳定直连全球优质大模型&#xff0c;限时半价接入中。 &#x1f449; 点击领取海量免费额度 通过Taotoken官方折扣与活动价降低大模型API使用门槛 对于开发者而言&#xff0c;大模型API的成本是项目落地和持续迭代中必须考量…...

WindowResizer:轻松掌控Windows窗口的终极解决方案

WindowResizer&#xff1a;轻松掌控Windows窗口的终极解决方案 【免费下载链接】WindowResizer 一个可以强制调整应用程序窗口大小的工具 项目地址: https://gitcode.com/gh_mirrors/wi/WindowResizer 还在为Windows应用程序窗口尺寸无法调整而烦恼吗&#xff1f;Window…...

Dell G15终极散热管理:开源热控中心完全指南 [特殊字符]

Dell G15终极散热管理&#xff1a;开源热控中心完全指南 &#x1f680; 【免费下载链接】tcc-g15 Thermal Control Center for Dell G15 - open source alternative to AWCC 项目地址: https://gitcode.com/gh_mirrors/tc/tcc-g15 还在为Dell G15游戏本的过热问题而烦恼…...

软件需求捕获:从Therac-25悲剧到安全关键系统开发的脊柱工程

1. 项目概述&#xff1a;从Therac-25悲剧到现代软件安全基石上世纪90年代中期&#xff0c;一系列由Therac-25放射治疗机引发的致命事故&#xff0c;最终催生了一场由华盛顿大学Nancy Leveson教授主导的正式调查。这场调查的结论&#xff0c;远不止于揪出一款医疗设备的软件缺陷…...

AI智能体技能库构建:从标准化接口到安全实践

1. 项目概述&#xff1a;从“技能库”到“智能体”的进化之路最近在折腾AI智能体开发的朋友&#xff0c;估计都绕不开一个核心问题&#xff1a;如何让一个智能体真正“能干”&#xff0c;而不仅仅是“能聊”&#xff1f;这背后&#xff0c;就是“技能”的构建与管理。今天要聊的…...

北京AGG聚砂吸声板哪家性价比高

在选择AGG聚砂吸声板时&#xff0c;“性价比”往往不只是看价格&#xff0c;而是综合考量声学性能、施工服务、材料稳定性和后期维护的平衡。北京市场上的供应商不少&#xff0c;但真正能长期稳定输出成熟产品的&#xff0c;需要从几个实际角度去判断。首先&#xff0c;要优先看…...