1 ;;; Copyright 2009-2011 Vladimir Sedach
3 ;;; SPDX-License-Identifier: BSD-3-Clause
5 ;;; Redistribution and use in source and binary forms, with or
6 ;;; without modification, are permitted provided that the following
7 ;;; conditions are met:
9 ;;; 1. Redistributions of source code must retain the above copyright
10 ;;; notice, this list of conditions and the following disclaimer.
12 ;;; 2. Redistributions in binary form must reproduce the above
13 ;;; copyright notice, this list of conditions and the following
14 ;;; disclaimer in the documentation and/or other materials provided
15 ;;; with the distribution.
17 ;;; 3. Neither the name of the copyright holder nor the names of its
18 ;;; contributors may be used to endorse or promote products derived
19 ;;; from this software without specific prior written permission.
21 ;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
22 ;;; CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
23 ;;; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 ;;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 ;;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
26 ;;; BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 ;;; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
28 ;;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 ;;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30 ;;; ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31 ;;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 ;;; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 ;;; POSSIBILITY OF SUCH DAMAGE.
35 (in-package #:parenscript
)
36 (in-readtable :parenscript
)
38 ;; These are convenience packages that export JS and browser DOM
39 ;; symbols. If you :use the packages in a package FOO and then
40 ;; obfuscate FOO, it will prevent the JS symbols from getting
43 ;; For most web development tasks, you want to import PS-JS-SYMBOLS,
44 ;; PS-WINDOW-WD-SYMBOLS (which includes DOM level 2 and the w3c Window
45 ;; working draft), and possibly the PS-DOM-NONSTANDARD-SYMBOLS.
47 (defun re-export-symbols (from-package to-package
)
48 (do-external-symbols (symbol from-package
)
49 (multiple-value-bind (cl-symbol type
) (find-symbol (symbol-name symbol
) '#:cl
)
50 (when (eq type
:external
)
51 (shadowing-import cl-symbol from-package
)))
52 (shadowing-import symbol to-package
)
53 (export (list symbol
) to-package
)))
55 (defpackage #:ps-js-symbols
56 (:documentation
"JavaScript standard function and property names.")
59 #:encode-u-r-i-component
#:encodeURIComponent
71 (re-export-symbols '#:ps-js-symbols
'#:parenscript
)
73 (defpackage #:ps-dom1-symbols
74 (:documentation
"DOM Level 1 symbols.")
79 #:has-feature
#:hasFeature
85 #:document-element
#:documentElement
87 #:create-element
#:createElement
88 #:create-document-fragment
#:createDocumentElement
89 #:create-text-node
#:createTextNode
90 #:create-comment
#:createComment
91 #:create-c-d-a-t-a-section
#:createCDATASection
92 #:create-processing-instruction
#:createProcessingInstruction
93 #:create-attribute
#:createAttribute
94 #:create-entity-reference
#:createEntityReference
95 #:get-elements-by-tag-name
#:getElementsByTagName
99 #:node-name
#:nodeName
100 #:node-value
#:nodeValue
101 #:node-type
#:nodeType
102 #:parent-node
#:parentNode
103 #:child-nodes
#:childNodes
104 #:first-child
#:firstChild
105 #:last-child
#:lastChild
106 #:previous-sibling
#:previousSibling
107 #:next-sibling
#:nextSibling
109 #:owner-document
#:ownerDocument
111 #:insert-before
#:insertBefore
112 #:replace-child
#:replaceChild
113 #:remove-child
#:removeChild
114 #:append-child
#:appendChild
115 #:has-child-nodes
#:hasChildNodes
116 #:clone-node
#:cloneNode
118 ;; nodelist interface
126 #:get-named-item
#:getNamedItem
127 #:set-named-item
#:setNamedItem
128 #:remove-named-item
#:removeNamedItem
138 #:substring-data
#:substringData
139 #:append-data
#:appendData
140 #:insert-data
#:insertData
141 #:delete-data
#:deleteData
142 #:replace-data
#:replaceData
154 #:get-attribute
#:getAttribute
155 #:set-attribute
#:setAttribute
156 #:remove-attribute
#:removeAttribute
157 #:get-attribute-node
#:getAttributeNode
158 #:set-attribute-node
#:setAttributeNode
159 #:remove-attribute-node
#:removeAttributeNode
160 #:get-elements-by-tag-name
#:getElementsByTagName
165 #:split-text
#:splitText
167 ;;; Level 1 extended interfaces (XML)
176 #:public-id
#:publicId
177 #:system-id
#:systemId
181 #:public-id
#:publicId
182 #:system-id
#:systemId
183 #:notation-name
#:notationName
185 ;; processing instruction
191 ;; HTMLcollection/live NodeList
196 #:named-item
#:namedItem
217 #:get-element-by-id
#:getElementById
218 #:get-elements-by-name
#:getElementsByName
220 ;; generic HTML element
226 #:class-name
#:className
228 ;; HTML document root
255 #:http-equiv
#:httpEquiv
289 #:accept-charset
#:acceptCharset
301 #:selected-index
#:selectedIndex
310 #:tab-index
#:tabIndex
325 #:default-selected
#:defaultSelected
335 #:default-value
#:defaultValue
336 #:default-checked
#:defaultChecked
339 #:access-key
#:accessKey
344 #:max-length
#:maxLength
346 #:read-only
#:readOnly
349 #:tab-index
#:tabIndex
361 #:default-value
#:defaultValue
363 #:access-key
#:accessKey
367 #:read-only
#:readOnly
369 #:tab-index
#:tabIndex
380 #:access-key
#:accessKey
383 #:tab-index
#:tabIndex
390 #:access-key
#:accessKey
400 #:access-key
#:accessKey
427 ;; div, p, and h1/h2/hn
455 #:date-time
#:dateTime
459 #:access-key
#:accessKey
468 #:tab-index
#:tabIndex
485 #:long-desc
#:longDesc
498 #:code-base
#:codeBase
499 #:code-type
#:codeType
506 #:tab-index
#:tabIndex
517 #:value-type
#:valueType
525 #:code-base
#:codeBase
540 #:access-key
#:accessKey
546 #:tab-index
#:tabIndex
569 #:cell-padding
#:cellPadding
570 #:cell-spacing
#:cellSpacing
576 #:create-t-head
#:createTHead
577 #:delete-t-head
#:deleteTHead
578 #:create-t-foot
#:createTFoot
579 #:delete-t-foot
#:deleteTFoot
580 #:create-caption
#:createCaption
581 #:delete-caption
#:deleteCaption
582 #:insert-row
#:insertRow
583 #:delete-row
#:deleteRow
598 ;; thead, tfoot, tbody
606 #:insert-row
#:insertRow
607 #:delete-row
#:deleteRow
611 #:row-index
#:rowIndex
612 #:section-row-index
#:sectionRowIndex
620 #:insert-cell
#:insertCell
621 #:delete-cell
#:deleteCell
625 #:cell-index
#:cellIndex
648 #:frame-border
#:frameBorder
649 #:long-desc
#:longDesc
650 #:margin-height
#:marginHeight
651 #:margin-width
#:marginWidth
653 #:no-resize
#:noResize
660 #:frame-border
#:frameBorder
662 #:long-desc
#:longDesc
663 #:margin-height
#:marginHeight
664 #:margin-width
#:marginWidth
671 (defpackage #:ps-dom2-symbols
672 (:documentation
"DOM Level 2 symbols. Includes DOM Level 1 symbols.")
677 #:create-document
#:createDocument
678 #:create-document-type
#:createDocumentType
680 ;; document interface
682 #:create-attribute-n-s
#:createAttributeNS
683 #:create-element-n-s
#:createElementNS
684 #:get-element-by-id
#:getElementById
685 #:get-elements-by-tag-name-n-s
#:getElementsByTagNameNS
686 #:import-node
#:importNode
690 #:local-name
#:localName
691 #:namespace-u-r-i
#:namespaceURI
694 #:is-supported
#:isSupported
698 #:get-named-item-n-s
#:getNamedItemNS
699 #:remove-named-item-n-s
#:removeNamedItermNS
700 #:set-named-item-n-s
#:setNamedItemNS
704 #:get-attribute-n-s
#:getAttributeNS
705 #:get-attribute-node-n-s
#:getAttributeNodeNS
706 #:get-elements-by-tag-name-n-s
#:getElementsByTagNameNS
707 #:has-attribute-n-s
#:hasAttributeNS
708 #:remove-attribute-n-s
#:removeAttributeNS
709 #:set-attribute-n-s
#:setAttributeNS
710 #:set-attribute-node-n-s
#:setAttributeNodeNS
712 ;;; Level 2 extended interfaces
715 #:internal-subset
#:internalSubset
716 #:public-id
#:publicId
717 #:system-id
#:systemId
720 ;; object, frame, iframe
722 #:content-document
#:contentDocument
730 #:owner-node
#:ownerNode
731 #:parent-style-sheet
#:parenStyleSheet
738 #:media-text
#:mediaText
740 #:append-medium
#:appendMedium
741 #:delete-medium
#:deleteMedium
750 #:style-sheets
#:styleSheets
755 #:css-rules
#:cssRules
756 #:owner-rule
#:ownerRule
758 #:delete-rule
#:deleteRule
759 #:insert-rule
#:insertRule
764 #:parent-rule
#:parentRule
765 #:parent-style-sheet
#:parentStyleSheet
770 #:selector-text
#:selectorText
775 #:css-rules
#:cssRules
778 #:delete-rule
#:deleteRule
779 #:insert-rule
#:insertRule
785 #:style-sheet
#:styleSheet
791 ;; css style declaration
795 #:parent-rule
#:parentRule
797 #:get-property-c-s-s-value
#:getPropertyCSSValue
798 #:get-property-priority
#:getPropertyPriority
799 #:get-property-value
#:getPropertyValue
801 #:remove-property
#:removeProperty
802 #:set-property
#:setProperty
807 #:css-value-type
#:cssValueType
809 ;; css primitive value
811 #:primitive-type
#:primitiveType
813 #:get-counter-value
#:getCounterValue
814 #:get-float-value
#:getFloatValue
815 #:get-r-g-b-color-value
#:getRGBColorValue
816 #:get-rect-value
#:getRectValue
817 #:get-string-value
#:getStringValue
818 #:set-float-value
#:setFloatValue
819 #:set-string-value
#:setStringValue
837 #:list-style
#:listStyle
842 #:get-computed-style
#:getComputedStyle
846 #:get-override-style
#:getOverrideStyle
850 #:create-c-s-s-style-sheet
#:createCSSStyleSheet
852 ;;; CSS 2.0 extended interface
856 #:background-attachment
#:backgroundAttachment
857 #:background-color
#:backgroundColor
858 #:background-image
#:backgroundImage
859 #:background-position
#:backgroundPosition
860 #:background-repeat
#:backgroundRepeat
862 #:border-bottom
#:borderBottom
863 #:border-bottom-color
#:borderBottomColor
864 #:border-bottom-style
#:borderBottomStyle
865 #:border-bottom-width
#:borderBottomWidth
866 #:border-collapse
#:borderCollapse
867 #:border-color
#:borderColor
868 #:border-left
#:borderLeft
869 #:border-left-color
#:borderLeftColor
870 #:border-left-style
#:borderLeftStyle
871 #:border-left-width
#:borderLeftWidth
872 #:border-right
#:borderRight
873 #:border-right-color
#:borderRightColor
874 #:border-right-style
#:borderRightStyle
875 #:border-right-width
#:borderRightWidth
876 #:border-spacing
#:borderSpacing
877 #:border-style
#:borderStyle
878 #:border-top
#:borderTop
879 #:border-top-color
#:borderTopColor
880 #:border-top-style
#:borderTopStyle
881 #:border-top-width
#:borderTopWidth
882 #:border-width
#:borderWidth
884 #:caption-side
#:captionSide
889 #:counter-increment
#:counterIncrement
890 #:counter-reset
#:counterReset
891 #:css-float
#:cssFloat
893 #:cue-after
#:cueAfter
894 #:cue-before
#:cueBefore
899 #:empty-cells
#:emptyCells
901 #:font-family
#:fontFamily
902 #:font-size
#:fontSize
903 #:font-size-adjust
#:fontSizeAdjust
904 #:font-stretch
#:fontStretch
905 #:font-style
#:fontStyle
906 #:font-variant
#:fontVariant
907 #:font-weight
#:fontWeight
910 #:letter-spacing
#:letterSpacing
911 #:line-height
#:lineHeight
912 #:list-style
#:listStyle
913 #:list-style-image
#:listStyleImage
914 #:list-style-position
#:listStylePosition
915 #:list-style-type
#:listStyleType
917 #:margin-bottom
#:marginBottom
918 #:margin-left
#:marginLeft
919 #:margin-right
#:marginRight
920 #:margin-top
#:marginTop
921 #:marker-offset
#:markerOffset
923 #:max-height
#:maxHeight
924 #:max-width
#:maxWidth
925 #:min-height
#:minHeight
926 #:min-width
#:minWidth
929 #:outline-color
#:outlineColor
930 #:outline-style
#:outlineStyle
931 #:outline-width
#:outlineWidth
934 #:padding-bottom
#:paddingBottom
935 #:padding-left
#:paddingLeft
936 #:padding-right
#:paddingRight
937 #:padding-top
#:paddingTop
939 #:page-break-after
#:pageBreakAfter
940 #:page-break-before
#:pageBreakBefore
941 #:page-break-inside
#:pageBreakInside
943 #:pause-after
#:pauseAfter
944 #:pause-before
#:pauseBefore
946 #:pitch-range
#:pitchRange
947 #:play-during
#:playDuring
954 #:speak-header
#:speakHeader
955 #:speak-numeral
#:speakNumeral
956 #:speak-punctuation
#:speakPunctuation
957 #:speech-rate
#:speechRate
959 #:table-layout
#:tableLayout
960 #:text-align
#:textAlign
961 #:text-decoration
#:textDecoration
962 #:text-indent
#:textIndent
963 #:text-shadow
#:textShadow
964 #:text-transform
#:textTransform
966 #:unicode-bidi
#:unicodeBidi
967 #:vertical-align
#:verticalAlign
969 #:voice-family
#:voiceFamily
971 #:white-space
#:whiteSpace
974 #:word-spacing
#:wordSpacing
978 ;; event target interface
980 #:add-event-listener
#:addEventListener
981 #:dispatch-event
#:dispatchEvent
982 #:remove-event-listener
#:removeEventListener
984 ;; event listener interface
986 #:handle-event
#:handleEvent
992 #:current-target
#:currentTarget
993 #:event-phase
#:eventPhase
995 #:time-stamp
#:timeStamp
998 #:init-event
#:initEvent
999 #:prevent-default
#:preventDefault
1000 #:stop-propagation
#:stopPropagation
1002 ;; document event interface
1004 #:create-event
#:createEvent
1011 #:init-u-i-event
#:initUIEvent
1017 #:client-x
#:clientX
1018 #:client-y
#:clientY
1019 #:ctrl-key
#:ctrlKey
1020 #:meta-key
#:metaKey
1021 #:related-target
#:relatedTarget
1022 #:screen-x
#:screenX
1023 #:screen-y
#:screenY
1024 #:shift-key
#:shiftKey
1026 #:init-mouse-event
#:initMouseEvent
1028 ;; mutation event interface
1030 #:attr-change
#:attrChange
1031 #:attr-name
#:attrName
1032 #:new-value
#:newValue
1033 #:prev-value
#:prevValue
1034 #:related-node
#:relatedNode
1036 #:init-mutation-event
#:initMutationEvent
1039 (re-export-symbols '#:ps-dom1-symbols
'#:ps-dom2-symbols
)
1041 (defpackage #:ps-window-wd-symbols
1042 (:documentation
"Funtions and properties of the W3C Working Draft Window object. Includes DOM level 2 symbols.")
1049 ;; location interface
1068 #:frame-element
#:frameElement
1072 #:set-timeout
#:setTimeout
1073 #:set-interval
#:setInterval
1074 #:clear-timeout
#:clearTimeout
1075 #:clear-interval
#:clearInterval
1078 (re-export-symbols '#:ps-dom2-symbols
'#:ps-window-wd-symbols
)
1080 (defpackage #:ps-dom-nonstandard-symbols
1081 (:documentation
"Non-W3C-standard (incl. DOM level 0) but widely implemented functions and properties.")
1083 #:inner-h-t-m-l
#:innerHTML
1086 #:offset-left
#:offsetLeft
1087 #:offset-top
#:offsetTop
1088 #:offset-height
#:offsetHeight
1089 #:offset-width
#:offsetWidth
1091 #:offset-parent
#:offsetParent
1093 #:scroll-left
#:scrollLeft
1094 #:scroll-top
#:scrollTop
1095 #:scroll-width
#:scrollWidth
1096 #:scroll-height
#:scrollHeight
1098 #:page-x-offset
#:pageXOffset
1099 #:page-y-offset
#:pageYOffset
1101 #:client-height
#:clientHeight
1102 #:client-width
#:clientWidth
1105 (defpackage #:ps-dhtml-symbols
1106 (:documentation
"Meta-package containing function/property symbols
1107 of typical HTML4/DHTML browsers. Includes DOM Levels 0 to 2, Window
1108 working draft, and de-facto standard symbols.
1110 This is probably the package you want to :USE if you're doing
1111 obfuscation in Parenscript and want to target the pre-HTML5 generation
1114 (re-export-symbols '#:ps-window-wd-symbols
'#:ps-dhtml-symbols
)
1115 (re-export-symbols '#:ps-dom-nonstandard-symbols
'#:ps-dhtml-symbols
)