Version 1 (modified by Jon Davis, 7 years ago) (diff)


URLs, CMake, and Networking

Alex Christensen, Apple


  • guy in Netherlands who is trying to unify URL standard across all browsers
  • implemented spec inside WebKit
  • mostly a good idea
  • currently passing 2/3 of tests
    • most browsers pass at least that amount (but of different tests)
  • there are open issues (not perfect)
    • e.g. how to deal with unicode fragments
  • the spec is changing
  • implementation uses finite state machine to look at the string
    • zero allocations in one pass
    • certain characters (tab, newline, etc.) should be ignored
    • input can be any sequence of unicode
    • output *should* be ascii
      • %2E is sometimes a . (depending on the server)
    • ~1000 unit tests for a bunch of weird URLs
      • http://127.0.0.-/ should be invalid
    • modifies DOMURL and urls everywhere
      • interfaces with NSURL, etc.
    • ~25% faster than old parser
    • blog post coming soon :)
  • unfortunately, there is always someone with “old” spec
    • should communicate to web authors
    • typically, authors don’t use weird edge cases
    • but, WebKit apps may implicitly assume some of these “old” points
      • e.g. not having the second / after scheme
    • as such, we cannot delete the old parser (for now)
  • currently on by default, but only for Desktop and Mobile Safari
  • these changes effect URL components as well
    • e.g. changes to query or path via JS


  • works everywhere except on Mac using WebKit2
  • slightly different directory structure with CMake
  • >30% build time improvement compared to XCode
  • we also have a bot for this
  • build webkit --cmake
  • preprocessing of IDLs must be done


  • ResourceHandle class, designed for networking in 2001
    • contains a ResourceHandleClient that has information about the networking
      • functions have been added with Async for WebKit2, that doesn’t use the synchronous model of networking
      • will be changing the logic of all network code to remove synchronous methods
        • all code will now be asynchronous
    • will replace Network* instead of ResourceHandle* as the completion handler
      • designed to be more asynchronous