the Web in 2018

W3C

the Web in 2018

W3C

https://www.w3.org/people/xiaoqian/talks/yy-2018/

主题

  1. 关于 W3C
  2. 核心 Web 技术发展
    • CSS Houdini
    • HTML Web Components
    • Web Perf APIs
    • PWA
  3. 拓展 Web 的能力
    • Media & Web XR
    • Web 5G
    • Web RTC
    • Web Assembly
    • Web Payment
    • Web Authentication
    • Web Security & Privacy
  4. Web for All
    • 国际化
    • 无障碍

1989年,他发明了Web...

TBL答孩子问

W3C, 1994年由 Tim Berners-Lee 创建

TBL答孩子问

Lead the Web to its Full Potential

Royalty Free,让 Web 为全人类所用

1993年 TBL 在 CERN 签署 Royalty Free 协议

W3C 标准文档

使用 W3C 规范

W3C 需要你

核心 Web 技术发展

Web Layout 的未来

参与: CSS Working Group, drafts, blog, GH

HTML Web Components

Performance

寻找性能瓶颈

Web 性能监测蓝图

Performance Observer

      
      var observer = new PerformanceObserver(function(list) {
        for (var i = 0; i < perfEntries.length; i++)
        {
          ...
        }
        if (doneObservingEvents) {
           observer.disconnect();
        }
      });
      // subscribe to Resource-Timing and User-Timing events
      observer.observe({entryTypes: ['resource', 'mark', 'measure']});
  
    

示例

Server Timing

Server Timing: 允许 Server 和 浏览器沟通 request-response 循环里的性能数据

示例

Resource Timing 资源加载

Navigation Timing 页面浏览

Paint Timing API 绘制时间

Long Tasks API 任务响应

User Timing 用户行为

NetInfo API 网络链接

Device Memory 内存能力

节流 — PV, IO

让浏览器更智能 — Cooperative Scheduling of Background Tasks

优化资源加载效率 Preload

<link rel="preload" href=“/url" as=“type”>

当前页 as=audio, video, style, script, document(for iframe), image…

高优先级的 fetch,预加载资源,但不执行,as 必须定义;

优化资源加载效率 Resource Hints

Progressive Web Application (PWA)

参与: PWAs and Beyond: The Next Generation of Web Apps (Sakura)

拓展 Web 的能力

Various technologies expanding the Web Core capabilities

Web 媒体

On-demand 内容媒体 -- TV, 电影,高清视频等
版本保护EMEPresentation APIRemote Playback API, TTML字幕控制,WebAudio API
Live 内容媒体 -- 体育赛事,演唱会,新闻,直播
CDN, Web RTC 分布式推送, WebAssembly, Picture-in-Picture
Interactive 内容媒体 -- 游戏,虚拟视频,在线教育等
WebXR Device API, Web5G

更丰富的 Web 媒体娱乐

Web TV 与娱乐:HTML5支持、EME版权保护、XR支持
Web RTC 分布式推送
CTA WAVE 项目:商业媒体 Web 支持

为虚拟未来准备

VR / AR / MR:
WebXR
360 videos
Harness processing power:
GPU for the Web
WebAssembly
5G

WebXR Device API

Web5G

它们能否协作?

W3C Web5G技术研讨会: 应对互联网与Web技术的发展

WebRTC

Web Assembly

探索需求和语言定义 WebAssembly Community Group

测试与社区 review WebAssembly Working Group

为什么要做 Web 支付

优雅、流畅、安全的支付体验

PaymentRequest API

安全地存储账户信息,实现流畅支付

跨平台地实现用户个性化支付

减少商户冗余代码,一个API替代各种插件

Chrome,Safari,Edge,三星已实现,Firefox 8月支持

Facebook, Shopify, Stripe, Braintree, WePay, Bluesnap, Paysafe, BS Payone等已使用

Web Auth schema

Payment Handler API

通过浏览器电子钱包实现支付

以浏览器协调电商、银行、用户的关系,提供安全便捷的接口支持

通过浏览器UI简化用户交互

Safari 和 Chrome 已经支持app handler

Chrome 已经支持浏览器 handler,三星和FF开发中

Coil, Facebook, Klarna, Lyra Networks, Mastercard, Shopify, Worldline,和 Worldpay等公司在试验中

Web Auth schema

优雅、流畅、安全的支付体验

优雅、流畅、安全的支付体验 —— methodData

      
      const methodData = [{
        supportedMethods: "basic-card",
        data: {
          supportedNetworks: ["visa", "mastercard"],
          supportedTypes: ["debit", "credit"],
        },
      }, {
      supportedMethods: "https://example.com/bobpay",
        data: {
        merchantIdentifier: "XXXX",
        bobPaySpecificField: true,
      },
    }];
  
    

优雅、流畅、安全的支付体验 —— details

      
      const details = {
        id: "super-store-order-123-12312",
        displayItems: [{
          label: "Sub-total",
          amount: { currency: "USD", value: "55.00" },
        }, {
        label: "Sales Tax",
        amount: { currency: "USD", value: "5.00" },
        type: "tax"
      }],
      total: {
        label: "Total due",
        amount: { currency: "USD", value: "65.00" },
      }};
  
    
      
async function doPaymentRequest() {
  try {
    const request = new PaymentRequest(methodData, details, options);
    request.onshippingoptionchange = ev => ev.updateWith(details);
    const response = await request.show();
    await validateResponse(response);
  } catch (err) {}
}
async function validateResponse(response) {
  try {
    if (await checkAllValuesAreGood(response)) {
      await response.complete("success");
    } else {
      await response.complete("fail");
    }
  } catch (err) {}
}
doPaymentRequest();
  
    

浏览器支持

试一试, Demos

Web Payment at W3C

Participate: Working Group, Commerce IG

新一代电子商务

更好的体验:
Coupons/Offers on the Web 融合优惠
Web Advertising 约束与便利
更好的管理:
Web Commerce Interest Group
Chinese Web Interest Group
探讨更安全的标准流程

Web Applications Security

Participate: Group, drafts

Security and Privacy Considerations Everywhere

Web Authentication

普适、安全、强认证方式

每个站点提供强大、唯一且基于公钥的凭证

Participate: Group, GH

Web Auth schema

Web Authentication

Privacy and GDPR

Verifiable Claims可验证声明

Web for All

W3C 无障碍访问

Make the World Wide Web worldwide!

Participate: Group, GH

Thank you!

xiaoqian@w3.org / @siusinng小倩

资料: W3C, WICG, MDN, Léonie Watson