본문 바로가기
Tech/DOM

DOMString

by egas 2021. 7. 31.

DOMString은 UTF-16 문자열을 위한 독립적으로 구현된 DOM 인터페이스이다.

 

JavaScript 문자열은 이미 UTF-16 문자열이므로 JavaScript의 모든 인스턴스 String는 자동으로 DOMString 인스턴스이기도 하다.

 

DOMString 허용하는 특정 Web API의 경우, ToString으로 문자열화한다.

 

DOMString 허용하는 특정 Web API의 경우,  null일 때, "null" 대신 빈문자열을 전달하는 레거시 동작이 있다.

 

오.. 충격적 사실.

 

참고

https://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMString

 

Document Object Model Core

1.1.1 The DOM Structure Model The DOM presents documents as a hierarchy of Node objects that also implement other, more specialized interfaces. Some types of nodes may have child nodes of various types, and others are leaf nodes that cannot have anything b

www.w3.org

https://developer.mozilla.org/en-US/docs/Web/API/DOMString

 

DOMString - Web APIs | MDN

A DOMString is a sequence of 16-bit unsigned integers, typically interpreted as UTF-16 code units. This corresponds exactly to the JavaScript primitive String type. When a DOMString is provided to JavaScript, it maps directly to the corresponding St

developer.mozilla.org

https://stackoverflow.com/questions/35123890/what-is-a-domstring-really

 

What is a DOMString really?

I came across DOMString while reading the HTML spec. On some research, found the following data regarding it: From MDN: DOMString is a UTF-16 String. As JavaScript already uses such strings,

stackoverflow.com

 

728x90

'Tech > DOM' 카테고리의 다른 글

DOM Level 3 Events  (0) 2021.08.07
HTMLElement  (0) 2021.08.02
This value was evaluated upon first expanding. it may have changed since then.  (0) 2021.07.31
classList  (0) 2021.07.31
[MouseEvent] clientX, offsetX, pageX, screenX  (0) 2021.07.23

댓글