diff --git a/config/quickdraw.rb b/config/quickdraw.rb index 533f6e3f..b3b0bc7e 100644 --- a/config/quickdraw.rb +++ b/config/quickdraw.rb @@ -7,6 +7,12 @@ command_name "quickdraw" enable_coverage_for_eval enable_coverage :branch + add_filter %r{^/fixtures/} + + add_group "SGML", "lib/phlex/sgml" + add_group "HTML", "lib/phlex/html" + add_group "SVG", "lib/phlex/svg" + add_group "CSV", "lib/phlex/csv" end end diff --git a/lib/phlex/html.rb b/lib/phlex/html.rb index 2eec8aae..5fa1eb74 100644 --- a/lib/phlex/html.rb +++ b/lib/phlex/html.rb @@ -7,7 +7,7 @@ class Phlex::HTML < Phlex::SGML # A list of HTML attributes that have the potential to execute unsafe JavaScript. UNSAFE_ATTRIBUTES = Set.new(%w[onabort onafterprint onbeforeprint onbeforeunload onblur oncanplay oncanplaythrough onchange onclick oncontextmenu oncopy oncuechange oncut ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended onerror onfocus onhashchange oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmessage onmousedown onmousemove onmouseout onmouseover onmouseup onmousewheel onoffline ononline onpagehide onpageshow onpaste onpause onplay onplaying onpopstate onprogress onratechange onreset onresize onscroll onsearch onseeked onseeking onselect onstalled onstorage onsubmit onsuspend ontimeupdate ontoggle onunload onvolumechange onwaiting onwheel srcdoc]).freeze - extend Phlex::Elements + extend Phlex::SGML::Elements include VoidElements, StandardElements # Output an HTML doctype. diff --git a/lib/phlex/html/standard_elements.rb b/lib/phlex/html/standard_elements.rb index cfce3029..43efbb1a 100644 --- a/lib/phlex/html/standard_elements.rb +++ b/lib/phlex/html/standard_elements.rb @@ -2,7 +2,7 @@ # Standard HTML elements accept content and always have a closing tag. module Phlex::HTML::StandardElements - extend Phlex::Elements + extend Phlex::SGML::Elements # @!method a(**attributes, &content) # Outputs an `` tag. diff --git a/lib/phlex/html/void_elements.rb b/lib/phlex/html/void_elements.rb index e7ab4882..0c9b1576 100644 --- a/lib/phlex/html/void_elements.rb +++ b/lib/phlex/html/void_elements.rb @@ -2,7 +2,7 @@ # Void HTML elements don't accept content and never have a closing tag. module Phlex::HTML::VoidElements - extend Phlex::Elements + extend Phlex::SGML::Elements # @!method area(**attributes, &content) # Outputs an `` tag. diff --git a/lib/phlex/sgml.rb b/lib/phlex/sgml.rb index 6b625e01..e3eca4cc 100644 --- a/lib/phlex/sgml.rb +++ b/lib/phlex/sgml.rb @@ -2,6 +2,7 @@ # **Standard Generalized Markup Language** for behaviour common to {HTML} and {SVG}. class Phlex::SGML + autoload :Elements, "phlex/sgml/elements" autoload :SafeObject, "phlex/sgml/safe_object" autoload :SafeValue, "phlex/sgml/safe_value" @@ -29,7 +30,7 @@ def __element_method__?(method_name) if instance_methods.include?(method_name) owner = instance_method(method_name).owner - if Phlex::Elements === owner && owner.__registered_elements__[method_name] + if Phlex::SGML::Elements === owner && owner.__registered_elements__[method_name] true else false diff --git a/lib/phlex/elements.rb b/lib/phlex/sgml/elements.rb similarity index 99% rename from lib/phlex/elements.rb rename to lib/phlex/sgml/elements.rb index 6c41280d..ece0236c 100644 --- a/lib/phlex/elements.rb +++ b/lib/phlex/sgml/elements.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Phlex::Elements +module Phlex::SGML::Elements def __registered_elements__ @__registered_elements__ ||= {} end diff --git a/lib/phlex/svg/standard_elements.rb b/lib/phlex/svg/standard_elements.rb index c6f9285c..47579761 100644 --- a/lib/phlex/svg/standard_elements.rb +++ b/lib/phlex/svg/standard_elements.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Phlex::SVG::StandardElements - extend Phlex::Elements + extend Phlex::SGML::Elements # @!method a(**attributes, &content) # Outputs an `` tag.