Update DOM documentation

pull/129/head
Thibaut 11 years ago
parent d6168cf7ab
commit b60e602b89

@ -11,15 +11,18 @@ module Docs
'Geolocation' => 'Geolocation',
'Media Capture' => 'Media',
'Media Source' => 'Media',
'MediaStream' => 'MediaRecorder',
'Navigation Timing' => 'Navigation Timing',
'Network Information' => 'Network Information',
'Web Audio' => 'Web Audio',
'Web Workers' => 'Web Workers' }
'Web Workers' => 'Web Workers',
'WebRTC' => 'WebRTC' }
TYPE_BY_NAME_STARTS_WITH = {
'Audio' => 'Audio',
'Canvas' => 'Canvas',
'ChildNode' => 'Node',
'console' => 'Console',
'Console' => 'Console',
'CSS' => 'CSS',
'document' => 'Document',
'DocumentFragment' => 'DocumentFragment',
@ -31,12 +34,14 @@ module Docs
'GlobalEventHandlers' => 'GlobalEventHandlers',
'history' => 'History',
'IDB' => 'IndexedDB',
'IndexedDB' => 'IndexedDB',
'Location' => 'Location',
'navigator' => 'Navigator',
'Node' => 'Node',
'Notification' => 'Notification',
'ParentNode' => 'Node',
'Range' => 'Range',
'RTC' => 'WebRTC',
'Selection' => 'Selection',
'StyleSheet' => 'CSS',
'SVG' => 'SVG',
@ -104,9 +109,9 @@ module Docs
end
def include_default_entry?
!(node = doc.at_css '.overheadIndicator') ||
!node.content.include?('not on a standards track') &&
!node.content.include?('removed from the Web')
(node = doc.at_css '.overheadIndicator').nil? ||
type == 'Console' ||
(node.content.exclude?('not on a standards track') && node.content.exclude?('removed from the Web'))
end
end
end

@ -10,11 +10,9 @@ module Docs
# Don't want
options[:skip] = %w(
/App
/Apps
/CallEvent
/CanvasPixelArray
/ChromeWorker
/ContactManager
/document.createProcessingInstruction
/document.documentURIObject
/document.loadOverlay
@ -33,9 +31,10 @@ module Docs
/PowerManager
/PushManager
/ProcessingInstruction
/select.type
/TCPServerSocket
/TCPSocket
/TypeInfo
/Web_Video_Text_Tracks_Format
/WifiManager
/window.controllers
/window.crypto
@ -48,7 +47,6 @@ module Docs
/window.navigator.requestWakeLock
/window.updateCommands
/window.pkcs11
/XMLDocument
/XMLHttpRequest/Using_XMLHttpRequest)
options[:skip_patterns] = [
@ -57,20 +55,29 @@ module Docs
/moz/i,
/gecko/i,
/webkit/i,
/gamepad/i,
/UserData/,
/\A\/Camera/,
/\A\/DeviceStorage/,
/\A\/document\.xml/,
/\A\/XMLDocument/,
/\A\/DOMCursor/,
/\A\/DOMRequest/,
/\A\/element\.on/,
/\A\/Entity/,
/\A\/HTMLIFrameElement\./,
/\A\/navigator\.id/i,
/\A\/Settings/,
/\A\/Telephony/,
/\A\/Bluetooth/,
/UserData/,
/\A\/Window\.\w+bar/i]
/\A\/Window\.\w+bar/i,
/\A\/CSS_Object_Model\//,
/\A\/Web_Audio_API\//,
/\A\/IndexedDB_API\//,
/\A\/MediaRecorder_API\//,
/\A\/Apps/,
/\A\/Contact/,
/\A\/L10n/,
/\A\/Permission/]
# Broken / Empty
options[:skip].concat %w(
@ -86,7 +93,13 @@ module Docs
/Window.QueryInterface)
# Duplicates
options[:skip].concat %w(/Reference)
options[:skip].concat %w(
/Reference
/Index
/form.elements
/select.type
/table.rows
/XMLHttpRequest/FormData)
options[:fix_urls] = ->(url) do
return if url.include?('_') || url.include?('?')
@ -99,6 +112,11 @@ module Docs
url.sub! "#{Dom.base_url}/notification", "#{Dom.base_url}/Notification"
url.sub! "#{Dom.base_url}/range", "#{Dom.base_url}/Range"
url.sub! "#{Dom.base_url}/Window", "#{Dom.base_url}/window"
url.sub! "#{Dom.base_url}/window.navigator", "#{Dom.base_url}/navigator"
url.sub! "#{Dom.base_url}/Selection/", "#{Dom.base_url}/Selection."
url.sub! "#{Dom.base_url}/windowTimers", "#{Dom.base_url}/window"
url.sub! "#{Dom.base_url}/windowEventHandlers", "#{Dom.base_url}/window"
url.sub! "#{Dom.base_url}/Screen.", "#{Dom.base_url}/window.screen"
url
end
end

Loading…
Cancel
Save