webkit dom 事件种类

事件种类有:

  1.      abort
  2.      beforecopy
  3.      beforecut
  4.      beforeload
  5.      beforepaste
  6.      beforeunload
  7.      blur
  8.      cached
  9.      change
  10.      checking
  11.      click
  12.      close
  13.      connect
  14.      contextmenu
  15.      copy
  16.      cut
  17.      dblclick
  18.      display
  19.      downloading
  20.      drag
  21.      dragend
  22.      dragenter
  23.      dragleave
  24.      dragover
  25.      dragstart
  26.      drop
  27.      error
  28.      focus
  29.      hashchange
  30.      input
  31.      invalid
  32.      keydown
  33.      keypress
  34.      keyup
  35.      load
  36.      loadstart
  37.      message
  38.      mousedown
  39.      mousemove
  40.      mouseout
  41.      mouseover
  42.      mouseup
  43.      mousewheel
  44.      noupdate
  45.      obsolete
  46.      offline
  47.      online
  48.      open
  49.      overflowchanged
  50.      pagehide
  51.      pageshow
  52.      paste
  53.      readystatechange
  54.      reset
  55.      resize
  56.      scroll
  57.      search
  58.      select
  59.      selectstart
  60.      storage
  61.      submit
  62.      textInput
  63.      unload
  64.      updateready
  65.      zoom     
  66.      DOMActivate
  67.      DOMAttrModified
  68.      DOMCharacterDataModified
  69.      DOMFocusIn
  70.      DOMFocusOut
  71.      DOMNodeInserted
  72.      DOMNodeInsertedIntoDocument
  73.      DOMNodeRemoved
  74.      DOMNodeRemovedFromDocument
  75.      DOMSubtreeModified
  76.      DOMContentLoaded
  77.      webkitBeforeTextInserted
  78.      webkitEditableContentChanged
  79.      canplay
  80.      canplaythrough
  81.      durationchange
  82.      emptied
  83.      ended
  84.      loadeddata
  85.      loadedmetadata
  86.      pause
  87.      play
  88.      playing
  89.      ratechange
  90.      seeked
  91.      seeking
  92.      timeupdate
  93.      volumechange
  94.      waiting     
  95.      progress
  96.      stalled
  97.      suspend     
  98.      webkitAnimationEnd
  99.      webkitAnimationStart
  100.      webkitAnimationIteration     
  101.      webkitTransitionEnd     
  102.      orientationchange

  当然不同的浏览器会注册不同的事件,下面我们就从webkit源码看下神奇的事件到底是什么样的

EventNames.h文件

我们看下实现

#define DOM_EVENT_NAMES_FOR_EACH(macro) \
    \
    macro(abort) \
    macro(beforecopy) \
    macro(beforecut) \
    macro(beforeload) \
    macro(beforepaste) \
    macro(beforeunload) \
    macro(blocked) \
    macro(blur) \
    macro(cached) \
    macro(change) \
    macro(chargingchange) \
    macro(chargingtimechange) \
    macro(checking) \
    macro(click) \
    macro(close) \
    macro(complete) \
    macro(compositionend) \
    macro(compositionstart) \
    macro(compositionupdate) \
    macro(connect) \
    macro(contextmenu) \
    macro(copy) \
    macro(cut) \
    macro(dblclick) \
    macro(devicemotion) \
    macro(deviceorientation) \
    macro(dischargingtimechange) \
    macro(display) \
    macro(downloading) \
    macro(drag) \
    macro(dragend) \
    macro(dragenter) \
    macro(dragleave) \
    macro(dragover) \
    macro(dragstart) \
    macro(drop) \
    macro(error) \
    macro(focus) \
    macro(focusin) \
    macro(focusout) \
    macro(gesturetap) \
    macro(gesturetapdown) \
    macro(gesturescrollstart) \
    macro(gesturescrollend) \
    macro(gesturescrollupdate) \
    macro(hashchange) \
    macro(input) \
    macro(invalid) \
    macro(keydown) \
    macro(keypress) \
    macro(keyup) \
    macro(levelchange) \
    macro(load) \
    macro(loading) \
    macro(loadingdone) \
    macro(loadstart) \
    macro(message) \
    macro(mousedown) \
    macro(mouseenter) \
    macro(mouseleave) \
    macro(mousemove) \
    macro(mouseout) \
    macro(mouseover) \
    macro(mouseup) \
    macro(mousewheel) \
    macro(noupdate) \
    macro(obsolete) \
    macro(offline) \
    macro(online) \
    macro(open) \
    macro(overflowchanged) \
    macro(pagehide) \
    macro(pageshow) \
    macro(paste) \
    macro(popstate) \
    macro(readystatechange) \
    macro(reset) \
    macro(resize) \
    macro(scroll) \
    macro(search) \
    macro(select) \
    macro(selectstart) \
    macro(selectionchange) \
    macro(storage) \
    macro(submit) \
    macro(textInput) \
    macro(unload) \
    macro(updateready) \
    macro(upgradeneeded) \
    macro(versionchange) \
    macro(visibilitychange) \
    macro(write) \
    macro(writeend) \
    macro(writestart) \
    macro(zoom) \
    \
    macro(DOMActivate) \
    macro(DOMFocusIn) \
    macro(DOMFocusOut) \
    macro(DOMCharacterDataModified) \
    macro(DOMNodeInserted) \
    macro(DOMNodeInsertedIntoDocument) \
    macro(DOMNodeRemoved) \
    macro(DOMNodeRemovedFromDocument) \
    macro(DOMSubtreeModified) \
    macro(DOMContentLoaded) \
    \
    macro(webkitBeforeTextInserted) \
    macro(webkitEditableContentChanged) \
    \
    macro(canplay) \
    macro(canplaythrough) \
    macro(durationchange) \
    macro(emptied) \
    macro(ended) \
    macro(loadeddata) \
    macro(loadedmetadata) \
    macro(pause) \
    macro(play) \
    macro(playing) \
    macro(ratechange) \
    macro(seeked) \
    macro(seeking) \
    macro(timeupdate) \
    macro(volumechange) \
    macro(waiting) \
    \
    macro(addtrack) \
    macro(cuechange) \
    macro(enter) \
    macro(exit) \
    \
    macro(webkitbeginfullscreen) \
    macro(webkitendfullscreen) \
    \
    macro(webkitaddsourcebuffer) \
    macro(webkitremovesourcebuffer) \
    macro(webkitsourceopen) \
    macro(webkitsourceended) \
    macro(webkitsourceclose) \
    \
    macro(webkitkeyadded) \
    macro(webkitkeyerror) \
    macro(webkitkeymessage) \
    macro(webkitneedkey) \
    \
    macro(progress) \
    macro(stalled) \
    macro(suspend) \
    \
    macro(webkitAnimationEnd) \
    macro(webkitAnimationStart) \
    macro(webkitAnimationIteration) \
    \
    macro(webkitTransitionEnd) \
    macro(transitionend) \
    \
    macro(orientationchange) \
    \
    macro(timeout) \
    \
    macro(touchstart) \
    macro(touchmove) \
    macro(touchend) \
    macro(touchcancel) \
    \
    macro(success) \
    \
    macro(loadend) \
    \
    macro(webkitfullscreenchange) \
    macro(webkitfullscreenerror) \
    \
    macro(webkitspeechchange) \
    \
    macro(audiostart) \
    macro(soundstart) \
    macro(speechstart) \
    macro(speechend) \
    macro(soundend) \
    macro(audioend) \
    macro(result) \
    macro(nomatch) \
    macro(start) \
    macro(end) \
    macro(mark) \
    macro(boundary) \
    macro(resume) \
    \
    macro(webglcontextlost) \
    macro(webglcontextrestored) \
    macro(webglcontextcreationerror) \
    \
    macro(audioprocess) \
    \
    macro(connecting) \
    macro(addstream) \
    macro(removestream) \
    macro(signalingstatechange) \
    macro(removetrack) \
    macro(mute) \
    macro(unmute) \
    macro(iceconnectionstatechange) \
    macro(icecandidate) \
    macro(negotiationneeded) \
    macro(datachannel) \
    macro(tonechange) \
    \
    macro(show) \
    \
    macro(webkitpointerlockchange) \
    macro(webkitpointerlockerror) \
    \
    macro(webkitregionlayoutupdate) \
    \
    macro(webkitregionoversetchange) \
    \
    macro(webkitnetworkinfochange) \
    \
    macro(webkitresourcetimingbufferfull) \
    \
    macro(webkitdeviceproximity) \
    \
    macro(securitypolicyviolation) \
    \

实际上对于dom 事件对应到具体的代码上面就是callback函数

在dom tree构建的时候会提前注册各个事件,事件的触发就是web引擎做的事情,举个简单的例子:

当页面刚开始加载body的时候 会触发一个onload事件,如何在网页内

<body onload="test()">

那么网页在加载到body的时候就可以直接执行test函数,那么对于网页开发者来说就可以做一些事情。

事件在表象就是这样子的。

 

 

 

 

 

 

你可能感兴趣的:(android,浏览器,dom,webkit,callback)