Jelajahi Sumber

Update MDN docs

Thibaut 10 tahun lalu
induk
melakukan
deb91d872a

+ 8 - 1
lib/docs/filters/dom/entries.rb

@@ -19,14 +19,17 @@ module Docs
         'MediaStream'         => 'Media',
         'Navigation Timing'   => 'Navigation Timing',
         'Network Information' => 'Network Information',
+        'Pointer Events'      => 'Pointer Events',
         'Push API'            => 'Push',
         'Shadow DOM'          => 'Shadow DOM',
         'Server-Sent Events'  => 'Server-Sent Events',
         'Service Workers'     => 'Service Workers',
+        'Touch Events'        => 'Touch Events',
         'Web Animations'      => 'Animation',
         'Web Audio'           => 'Web Audio',
         'Web Messaging'       => 'Web Messaging',
         'Web MIDI'            => 'Web MIDI',
+        'Web Speech'          => 'Web Speech',
         'Web Storage'         => 'Web Storage',
         'Web Workers'         => 'Web Workers',
         'WebGL'               => 'WebGL',
@@ -40,6 +43,7 @@ module Docs
         'CSS'                 => 'CSS',
         'ChildNode'           => 'Node',
         'console'             => 'Console',
+        'DataTransfer'        => 'Drag & Drop',
         'document'            => 'Document',
         'DocumentFragment'    => 'DocumentFragment',
         'DOM'                 => 'DOM',
@@ -69,7 +73,7 @@ module Docs
         'SVG'                 => 'SVG',
         'timing'              => 'Navigation Timing',
         'Timing'              => 'Navigation Timing',
-        'Touch'               => 'Touch',
+        'Touch'               => 'Touch Events',
         'TreeWalker'          => 'TreeWalker',
         'URL'                 => 'URL',
         'window'              => 'Window',
@@ -79,6 +83,7 @@ module Docs
       TYPE_BY_NAME_INCLUDES = {
         'ChildNode'     => 'Node',
         'Crypto'        => 'Web Cryptography',
+        'Drag'          => 'Drag & Drop',
         'FormData'      => 'XMLHTTPRequest',
         'ImageBitmap'   => 'Canvas',
         'ImageData'     => 'Canvas',
@@ -87,9 +92,11 @@ module Docs
         'MediaStream'   => 'Media',
         'NodeList'      => 'Node',
         'Path2D'        => 'Canvas',
+        'Pointer'       => 'Pointer Events',
         'Server-sent'   => 'Server-Sent Events',
         'ServiceWorker' => 'Service Workers',
         'TextMetrics'   => 'Canvas',
+        'timing'        => 'Navigation Timing',
         'udio'          => 'Web Audio',
         'WebSocket'     => 'Web Sockets',
         'WebGL'         => 'WebGL',

+ 4 - 1
lib/docs/filters/dom_events/entries.rb

@@ -16,6 +16,7 @@ module Docs
         'Keyboard'         => 'Keyboard',
         'edia'             => 'Media',
         'Mouse'            => 'Mouse',
+        'Notification'     => 'Notification',
         'Offline'          => 'Offline',
         'Orientation'      => 'Device',
         'Sensor'           => 'Device',
@@ -23,9 +24,11 @@ module Docs
         'Page Visibility'  => 'Page Visibility',
         'Pointer'          => 'Mouse',
         'PopState'         => 'History',
+        'Push'             => 'Push',
         'Progress'         => 'Progress',
         'Proximity'        => 'Device',
         'Server Sent'      => 'Server Sent Events',
+        'Speech'           => 'Web Speech',
         'Storage'          => 'Web Storage',
         'Touch'            => 'Touch',
         'Transition'       => 'CSS',
@@ -57,7 +60,7 @@ module Docs
         elsif LOAD_SLUGS.include?(slug)
           'Load'
         else
-          if info = at_css('.eventinfo').try(:content)
+          if info = at_css('.eventinfo, .properties').try(:content)
             TYPE_BY_INFO.each_pair do |key, value|
               return value if info.include?(key)
             end

+ 1 - 0
lib/docs/scrapers/mdn/dom.rb

@@ -16,6 +16,7 @@ module Docs
       /document/documentURIObject
       /document/loadOverlay
       /document/tooltipNode
+      /Document/cookie/Simple_document.cookie_framework
       /DOMErrorHandler
       /DOMLocator
       /DOMObject