@locker/shared-dom
Advanced tools
Comparing version 0.14.7 to 0.14.11
@@ -117,2 +117,3 @@ /*! | ||
querySelector: ElementProtoQuerySelector, | ||
remove: ElementProtoRemove, | ||
removeAttributeNode: ElementProtoRemoveAttributeNode, | ||
@@ -167,2 +168,6 @@ setAttributeNodeNS: ElementProtoSetAttributeNodeNS | ||
function ElementRemove(el) { | ||
return shared.ReflectApply(ElementProtoRemove, el, shared.emptyArray); | ||
} | ||
function ElementRemoveAttributeNode(el, attrNode) { | ||
@@ -201,2 +206,3 @@ return shared.ReflectApply(ElementProtoRemoveAttributeNode, el, [attrNode]); | ||
const NodeProtoFirstChildGetter = shared.ObjectLookupOwnGetter(Node.prototype, 'firstChild'); | ||
const NodeProtoLastChildGetter = shared.ObjectLookupOwnGetter(Node.prototype, 'lastChild'); | ||
const NodeProtoNodeNameGetter = shared.ObjectLookupOwnGetter(Node.prototype, 'nodeName'); | ||
@@ -227,2 +233,6 @@ const NodeProtoOwnerDocumentGetter = shared.ObjectLookupOwnGetter(Node.prototype, 'ownerDocument'); | ||
function NodeLastChildGetter(node) { | ||
return shared.ReflectApply(NodeProtoLastChildGetter, node, shared.emptyArray); | ||
} | ||
function NodeNameGetter(node) { | ||
@@ -243,6 +253,6 @@ // Normalize nodeName to upper case. | ||
const { | ||
document | ||
document: document$1 | ||
} = window; | ||
const leftTpl = DocumentCreateElement(document, 'template'); | ||
const rightTpl = DocumentCreateElement(document, 'template'); | ||
const leftTpl = DocumentCreateElement(document$1, 'template'); | ||
const rightTpl = DocumentCreateElement(document$1, 'template'); | ||
@@ -280,3 +290,3 @@ function deepIsEqualNode(leftRoot, rightRoot) { | ||
function isSharedElement(element) { | ||
let doc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document; | ||
let doc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document$1; | ||
return element === DocumentHeadGetter(doc) || element === DocumentBodyGetter(doc); | ||
@@ -481,2 +491,24 @@ } | ||
} = Storage.prototype; | ||
/** | ||
* The following provides a temporary solution to handle | ||
* "Magic Object" behavior in Safari prior to version 15. | ||
* | ||
* Properties of HTMLElement.prototype.style will lose their | ||
* "magic" (ie. updating the element's style="" attribute) if | ||
* a style property is written via Define Property operation. | ||
* | ||
* In order to prevent near-membrane from using Reflect.defineProperty, | ||
* we must send a signal that tells it to use Reflect.set in very | ||
* limited special cases. | ||
* | ||
*/ | ||
const HAS_BREAKABLE_CSS_STYLE_DECLARATION_MAGIC_OBJECT = (() => { | ||
const div = document.createElement('div'); | ||
shared.ReflectDefineProperty(div.style, 'color', { | ||
value: 'red' | ||
}); | ||
return div.getAttribute('style') === ''; | ||
})(); | ||
const SVGElementProtoDatasetGetter = shared.ObjectLookupOwnGetter(SVGElement.prototype, 'dataset'); | ||
@@ -731,2 +763,3 @@ | ||
exports.ElementQuerySelector = ElementQuerySelector; | ||
exports.ElementRemove = ElementRemove; | ||
exports.ElementRemoveAttributeNode = ElementRemoveAttributeNode; | ||
@@ -740,2 +773,3 @@ exports.ElementSetAttribute = ElementSetAttribute; | ||
exports.EventTargetAddEventListener = EventTargetAddEventListener; | ||
exports.HAS_BREAKABLE_CSS_STYLE_DECLARATION_MAGIC_OBJECT = HAS_BREAKABLE_CSS_STYLE_DECLARATION_MAGIC_OBJECT; | ||
exports.HTMLAnchorElementHostnameGetter = HTMLAnchorElementHostnameGetter; | ||
@@ -769,2 +803,3 @@ exports.HTMLAnchorElementHrefGetter = HTMLAnchorElementHrefGetter; | ||
exports.NodeIsEqualNode = NodeIsEqualNode; | ||
exports.NodeLastChildGetter = NodeLastChildGetter; | ||
exports.NodeNameGetter = NodeNameGetter; | ||
@@ -808,2 +843,2 @@ exports.NodeOwnerDocumentGetter = NodeOwnerDocumentGetter; | ||
exports.nsCookieRootKey = nsCookieRootKey; | ||
/*! version: 0.14.7 */ | ||
/*! version: 0.14.11 */ |
/*! | ||
* Copyright (C) 2019 salesforce.com, inc. | ||
*/ | ||
import { ObjectLookupOwnGetter, ReflectGetOwnPropertyDescriptor, ReflectApply, emptyArray, ObjectLookupOwnSetter, StringToUpperCase, StringToLowerCase, ObjectLookupOwnValue, WeakMapCtor, WeakMapGet, WeakMapSet, ObjectHasOwnProperty, ReflectSetPrototypeOf, FunctionBind, ReflectDefineProperty } from '@locker/shared'; | ||
import { ObjectLookupOwnGetter, ReflectGetOwnPropertyDescriptor, ReflectApply, emptyArray, ObjectLookupOwnSetter, StringToUpperCase, StringToLowerCase, ObjectLookupOwnValue, ReflectDefineProperty, WeakMapCtor, WeakMapGet, WeakMapSet, ObjectHasOwnProperty, ReflectSetPrototypeOf, FunctionBind } from '@locker/shared'; | ||
const AttrProtoNameGetter = ObjectLookupOwnGetter(Attr.prototype, 'name'); | ||
@@ -110,2 +110,3 @@ const AttrProtoNamespaceURIGetter = ObjectLookupOwnGetter(Attr.prototype, 'namespaceURI'); | ||
querySelector: ElementProtoQuerySelector, | ||
remove: ElementProtoRemove, | ||
removeAttributeNode: ElementProtoRemoveAttributeNode, | ||
@@ -160,2 +161,6 @@ setAttributeNodeNS: ElementProtoSetAttributeNodeNS | ||
function ElementRemove(el) { | ||
return ReflectApply(ElementProtoRemove, el, emptyArray); | ||
} | ||
function ElementRemoveAttributeNode(el, attrNode) { | ||
@@ -194,2 +199,3 @@ return ReflectApply(ElementProtoRemoveAttributeNode, el, [attrNode]); | ||
const NodeProtoFirstChildGetter = ObjectLookupOwnGetter(Node.prototype, 'firstChild'); | ||
const NodeProtoLastChildGetter = ObjectLookupOwnGetter(Node.prototype, 'lastChild'); | ||
const NodeProtoNodeNameGetter = ObjectLookupOwnGetter(Node.prototype, 'nodeName'); | ||
@@ -220,2 +226,6 @@ const NodeProtoOwnerDocumentGetter = ObjectLookupOwnGetter(Node.prototype, 'ownerDocument'); | ||
function NodeLastChildGetter(node) { | ||
return ReflectApply(NodeProtoLastChildGetter, node, emptyArray); | ||
} | ||
function NodeNameGetter(node) { | ||
@@ -236,6 +246,6 @@ // Normalize nodeName to upper case. | ||
const { | ||
document | ||
document: document$1 | ||
} = window; | ||
const leftTpl = DocumentCreateElement(document, 'template'); | ||
const rightTpl = DocumentCreateElement(document, 'template'); | ||
const leftTpl = DocumentCreateElement(document$1, 'template'); | ||
const rightTpl = DocumentCreateElement(document$1, 'template'); | ||
@@ -273,3 +283,3 @@ function deepIsEqualNode(leftRoot, rightRoot) { | ||
function isSharedElement(element) { | ||
let doc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document; | ||
let doc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document$1; | ||
return element === DocumentHeadGetter(doc) || element === DocumentBodyGetter(doc); | ||
@@ -474,2 +484,24 @@ } | ||
} = Storage.prototype; | ||
/** | ||
* The following provides a temporary solution to handle | ||
* "Magic Object" behavior in Safari prior to version 15. | ||
* | ||
* Properties of HTMLElement.prototype.style will lose their | ||
* "magic" (ie. updating the element's style="" attribute) if | ||
* a style property is written via Define Property operation. | ||
* | ||
* In order to prevent near-membrane from using Reflect.defineProperty, | ||
* we must send a signal that tells it to use Reflect.set in very | ||
* limited special cases. | ||
* | ||
*/ | ||
const HAS_BREAKABLE_CSS_STYLE_DECLARATION_MAGIC_OBJECT = (() => { | ||
const div = document.createElement('div'); | ||
ReflectDefineProperty(div.style, 'color', { | ||
value: 'red' | ||
}); | ||
return div.getAttribute('style') === ''; | ||
})(); | ||
const SVGElementProtoDatasetGetter = ObjectLookupOwnGetter(SVGElement.prototype, 'dataset'); | ||
@@ -684,3 +716,3 @@ | ||
export { AttrNameGetter, AttrNamespaceURIGetter, AttrOwnerElementGetter, AttrValueGetter, AttrValueSetter, BlobCtor, BlobSizeGetter, BlobSlice, BlobTypeGetter, CookieStoreProtoDelete, CookieStoreProtoGet, CookieStoreProtoGetAll, CookieStoreProtoSet, CustomElementRegistryProtoDefine, CustomElementRegistryProtoGet, DOMTokenListValueGetter, DocumentBodyGetter, DocumentCookieGetter, DocumentCookieSetter, DocumentCreateComment, DocumentCreateElement, DocumentCreateElementNS, DocumentFragmentGetElementById, DocumentGetElementById, DocumentHeadGetter, DocumentProtoExecCommand, ElementAttributesGetter, ElementClosest, ElementGetAttributeNode, ElementGetAttributeNodeNS, ElementInnerHTMLGetter, ElementInnerHTMLSetter, ElementOuterHTMLGetter, ElementOuterHTMLSetter, ElementProtoAttachShadow, ElementProtoInsertAdjacentHTML, ElementProtoSetAttribute, ElementProtoSetAttributeNS, ElementProtoSetAttributeNode, ElementQuerySelector, ElementRemoveAttributeNode, ElementSetAttribute, ElementSetAttributeNS, ElementSetAttributeNode, ElementSetAttributeNodeNS, EventCurrentTargetGetter, EventProtoComposedPath, EventTargetAddEventListener, HTMLAnchorElementHostnameGetter, HTMLAnchorElementHrefGetter, HTMLAnchorElementHrefSetter, HTMLAnchorElementPathnameGetter, HTMLAnchorElementProtocolGetter, HTMLElementDatasetGetter, HTMLElementInnerTextSetter, HTMLElementOuterTextSetter, HTMLElementStyleGetter, HTMLFrameElementContentDocumentGetter, HTMLFrameElementContentWindowGetter, HTMLIFrameElementContentDocumentGetter, HTMLIFrameElementContentWindowGetter, HTMLIFrameElementSrcSetter, HTMLLinkElementRelListSetter, HTMLLinkElementRelSetter, HTMLObjectElementContentDocumentGetter, HTMLObjectElementContentWindowGetter, HTMLScriptElementProtoSrcGetter, HTMLScriptElementProtoSrcSetter, HTMLTemplateElementContentGetter, MessageEventSourceGetter, NamedNodeMapProtoSetNamedItem, NodeAppendChild, NodeChildNodesGetter, NodeClone, NodeFirstChildGetter, NodeIsEqualNode, NodeNameGetter, NodeOwnerDocumentGetter, NodeTextContentSetter, RangeProtoCreateContextualFragment, RequestURLGetter, SVGElementDatasetGetter, StorageProtoGetItem, StorageProtoKey, StorageProtoRemoveItem, StorageProtoSetItem, URLCreateObjectURL, URLRevokeObjectURL, WindowClearInterval, WindowLengthGetter, WindowOpenerGetter, WindowParentGetter, WindowSelfGetter, WindowSetInterval, WindowStaticDecodeURIComponent, WindowStaticEncodeURIComponent, WindowStaticFetch, WindowStaticOpen, WindowStaticSetInterval, WindowStaticSetTimeout, XhrCtor, XhrOpen, XhrProtoOpen, XhrResponseTextGetter, XhrSend, XhrStatusGetter, XhrWithCredentialsSetter, getPatchedWindow, isEqualDomString, isSharedElement, isWindow, isWindowLike, nsCookieKey, nsCookieRootKey }; | ||
/*! version: 0.14.7 */ | ||
export { AttrNameGetter, AttrNamespaceURIGetter, AttrOwnerElementGetter, AttrValueGetter, AttrValueSetter, BlobCtor, BlobSizeGetter, BlobSlice, BlobTypeGetter, CookieStoreProtoDelete, CookieStoreProtoGet, CookieStoreProtoGetAll, CookieStoreProtoSet, CustomElementRegistryProtoDefine, CustomElementRegistryProtoGet, DOMTokenListValueGetter, DocumentBodyGetter, DocumentCookieGetter, DocumentCookieSetter, DocumentCreateComment, DocumentCreateElement, DocumentCreateElementNS, DocumentFragmentGetElementById, DocumentGetElementById, DocumentHeadGetter, DocumentProtoExecCommand, ElementAttributesGetter, ElementClosest, ElementGetAttributeNode, ElementGetAttributeNodeNS, ElementInnerHTMLGetter, ElementInnerHTMLSetter, ElementOuterHTMLGetter, ElementOuterHTMLSetter, ElementProtoAttachShadow, ElementProtoInsertAdjacentHTML, ElementProtoSetAttribute, ElementProtoSetAttributeNS, ElementProtoSetAttributeNode, ElementQuerySelector, ElementRemove, ElementRemoveAttributeNode, ElementSetAttribute, ElementSetAttributeNS, ElementSetAttributeNode, ElementSetAttributeNodeNS, EventCurrentTargetGetter, EventProtoComposedPath, EventTargetAddEventListener, HAS_BREAKABLE_CSS_STYLE_DECLARATION_MAGIC_OBJECT, HTMLAnchorElementHostnameGetter, HTMLAnchorElementHrefGetter, HTMLAnchorElementHrefSetter, HTMLAnchorElementPathnameGetter, HTMLAnchorElementProtocolGetter, HTMLElementDatasetGetter, HTMLElementInnerTextSetter, HTMLElementOuterTextSetter, HTMLElementStyleGetter, HTMLFrameElementContentDocumentGetter, HTMLFrameElementContentWindowGetter, HTMLIFrameElementContentDocumentGetter, HTMLIFrameElementContentWindowGetter, HTMLIFrameElementSrcSetter, HTMLLinkElementRelListSetter, HTMLLinkElementRelSetter, HTMLObjectElementContentDocumentGetter, HTMLObjectElementContentWindowGetter, HTMLScriptElementProtoSrcGetter, HTMLScriptElementProtoSrcSetter, HTMLTemplateElementContentGetter, MessageEventSourceGetter, NamedNodeMapProtoSetNamedItem, NodeAppendChild, NodeChildNodesGetter, NodeClone, NodeFirstChildGetter, NodeIsEqualNode, NodeLastChildGetter, NodeNameGetter, NodeOwnerDocumentGetter, NodeTextContentSetter, RangeProtoCreateContextualFragment, RequestURLGetter, SVGElementDatasetGetter, StorageProtoGetItem, StorageProtoKey, StorageProtoRemoveItem, StorageProtoSetItem, URLCreateObjectURL, URLRevokeObjectURL, WindowClearInterval, WindowLengthGetter, WindowOpenerGetter, WindowParentGetter, WindowSelfGetter, WindowSetInterval, WindowStaticDecodeURIComponent, WindowStaticEncodeURIComponent, WindowStaticFetch, WindowStaticOpen, WindowStaticSetInterval, WindowStaticSetTimeout, XhrCtor, XhrOpen, XhrProtoOpen, XhrResponseTextGetter, XhrSend, XhrStatusGetter, XhrWithCredentialsSetter, getPatchedWindow, isEqualDomString, isSharedElement, isWindow, isWindowLike, nsCookieKey, nsCookieRootKey }; | ||
/*! version: 0.14.11 */ |
{ | ||
"name": "@locker/shared-dom", | ||
"version": "0.14.7", | ||
"version": "0.14.11", | ||
"license": "Salesforce Developer Agreement", | ||
@@ -9,2 +9,3 @@ "author": "Salesforce UI Security Team", | ||
"module": "dist/index.js", | ||
"sideEffects": false, | ||
"typings": "types/index.d.ts", | ||
@@ -19,3 +20,3 @@ "publishConfig": { | ||
"dependencies": { | ||
"@locker/shared": "0.14.7" | ||
"@locker/shared": "0.14.11" | ||
}, | ||
@@ -26,3 +27,3 @@ "files": [ | ||
], | ||
"gitHead": "3e2c8ce19585715d0db2d0980088de1e5c4e2998" | ||
"gitHead": "3ac0b52b291246692fa015a42e52661c6feea82f" | ||
} |
@@ -11,2 +11,3 @@ export declare const ElementProtoAttachShadow: (init: ShadowRootInit) => ShadowRoot, ElementProtoInsertAdjacentHTML: (where: InsertPosition, html: string) => void, ElementProtoSetAttribute: (qualifiedName: string, value: string) => void, ElementProtoSetAttributeNS: (namespace: string | null, qualifiedName: string, value: string) => void, ElementProtoSetAttributeNode: (attr: Attr) => Attr | null; | ||
export declare function ElementGetAttributeNodeNS(el: Element, namespace: string, nodeName: string): ReturnType<typeof Element.prototype.getAttributeNodeNS>; | ||
export declare function ElementRemove(el: Element): Element; | ||
export declare function ElementRemoveAttributeNode(el: Element, attrNode: Attr): ReturnType<typeof Element.prototype.removeAttributeNode>; | ||
@@ -13,0 +14,0 @@ export declare function ElementSetAttribute(el: Element, name: string, value: string): ReturnType<typeof Element.prototype.setAttribute>; |
@@ -26,2 +26,3 @@ export * from './Attr'; | ||
export * from './Storage'; | ||
export * from './support'; | ||
export * from './SVGElement'; | ||
@@ -28,0 +29,0 @@ export * from './types'; |
@@ -6,2 +6,3 @@ export declare function NodeAppendChild(node: Node, childNode: ChildNode | DocumentFragment): ReturnType<typeof Node.prototype.appendChild>; | ||
export declare function NodeIsEqualNode(node: Node, otherNode: Node): ReturnType<typeof Node.prototype.isEqualNode>; | ||
export declare function NodeLastChildGetter(node: Node): typeof Node.prototype.lastChild; | ||
export declare function NodeNameGetter(node: Node): typeof Node.prototype.nodeName; | ||
@@ -8,0 +9,0 @@ export declare function NodeOwnerDocumentGetter(node: Node): typeof Node.prototype.ownerDocument; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
92973
69
1456
+ Added@locker/shared@0.14.11(transitive)
- Removed@locker/shared@0.14.7(transitive)
Updated@locker/shared@0.14.11