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

Chromium HTML5 新的 Input 类型date 对应c++

一、Input 类型: date

date 类型允许你从一个日期选择器选择一个日期。

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>test</title> 
</head>
<body>

<form action="demo-form.php">
  生日: <input type="date" name="bday">
  <input type="submit">
</form>

</body>
</html>

二、c++定义:

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

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

namespace blink {

class DateInputType final : public BaseTemporalInputType {
 public:
  explicit DateInputType(HTMLInputElement&);

 private:
  void CountUsage() override;
  StepRange CreateStepRange(AnyStepHandling) const override;
  bool ParseToDateComponentsInternal(const String&,
                                     DateComponents*) const override;
  bool SetMillisecondToDateComponents(double, DateComponents*) const override;
  void WarnIfValueIsInvalid(const String&) const override;

  // BaseTemporalInputType functions
  String FormatDateTimeFieldsState(const DateTimeFieldsState&) const override;
  void SetupLayoutParameters(DateTimeEditElement::LayoutParameters&,
                             const DateComponents&) const override;
  bool IsValidFormat(bool has_year,
                     bool has_month,
                     bool has_week,
                     bool has_day,
                     bool has_ampm,
                     bool has_hour,
                     bool has_minute,
                     bool has_second) const override;
  String AriaLabelForPickerIndicator() const override;
};

template <>
struct DowncastTraits<DateInputType> {
  static bool AllowFrom(const InputType& type) {
    return type.IsDateInputType();
  }
};

}  // namespace blink


http://www.kler.cn/a/369707.html

相关文章:

  • Anki插件Export deck to html的改造
  • MATLAB锂电概率分布模型
  • 2024年四川省大学生程序设计竞赛 补题记录
  • 【JIT/极态云】技术文档--函数设计
  • vulnhub(16):sickos(两种打点方式)
  • 高速定向广播声光预警系统赋能高速安全管控
  • C++基于opencv的视频质量检测--画面冻结检测
  • Vue3中ref、toRef和toRefs之间有什么区别?
  • 基于SSM+微信小程序的快递的管理系统(快递1)
  • 基于脚手架创建前端工程
  • Linux 应用领域
  • 老电脑不能装纯净版windows
  • GEE APP:加载Landsat TOA数据可视化界面,实现点击提取ndvi值
  • 云原生后端开发教程
  • Python实现微博舆情分析的设计与实现
  • 存储服务器通常适用于哪些应用场景?
  • Spring版本有哪些
  • 回溯算法习题其二-Java【力扣】【算法学习day.16】
  • 外包功能测试就干了4周,技术退步太明显了。。。。。
  • 深入理解JavaScript:两大编程思想和ES6类以及对象概念解析
  • 100种算法【Python版】第17篇——Aho-Corasick算法
  • ELF文件格式解读及其生成过程(上)
  • Python 中的 object
  • React 前端框架开发入门案例
  • WebRTC VAD 详解与代码示例
  • 群体智能(Swarm Intelligence)算法:三种Python实现