ladybird/Libraries/LibWeb/DOM
Timothy Flynn 2803d66d87 AK: Support UTF-16 string formatting
The underlying storage used during string formatting is StringBuilder.
To support UTF-16 strings, this patch allows callers to specify a mode
during StringBuilder construction. The default mode is UTF-8, for which
StringBuilder remains unchanged.

In UTF-16 mode, we treat the StringBuilder's internal ByteBuffer as a
series of u16 code units. Appending a single character will append 2
bytes for that character (cast to a char16_t). Appending a StringView
will transcode the string to UTF-16.

Utf16String also gains the same memory optimization that we added for
String, where we hand-off the underlying buffer to Utf16String to avoid
having to re-allocate.

In the future, we may want to further optimize for ASCII strings. For
example, we could defer committing to the u16-esque storage until we
see a non-ASCII code point.
2025-07-18 12:45:38 -04:00
..
AbortController.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
AbortController.h
AbortController.idl
AbortSignal.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
AbortSignal.h LibWeb: Support removing callbacks from AbortSignal 2025-04-11 12:10:46 -04:00
AbortSignal.idl
AbstractElement.cpp LibWeb/DOM: Add document getter to AbstractElement 2025-07-16 14:47:45 +01:00
AbstractElement.h LibWeb/DOM: Add document getter to AbstractElement 2025-07-16 14:47:45 +01:00
AbstractRange.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
AbstractRange.h LibWeb: Only clear command states and values if range actually changed 2025-01-24 23:53:26 +01:00
AbstractRange.idl
AccessibilityTreeNode.cpp
AccessibilityTreeNode.h
AdoptedStyleSheets.cpp LibWeb: Fix insert/delete rule invalidation for adopted style sheets 2025-01-13 23:03:07 +01:00
AdoptedStyleSheets.h LibWeb: Fix insert/delete rule invalidation for adopted style sheets 2025-01-13 23:03:07 +01:00
Attr.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
Attr.h LibWeb: Make node cloning methods const 2025-01-11 23:10:09 +01:00
Attr.idl
CDATASection.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
CDATASection.h
CDATASection.idl
CharacterData.cpp AK: Support UTF-16 string formatting 2025-07-18 12:45:38 -04:00
CharacterData.h
CharacterData.idl
ChildNode.h
ChildNode.idl
Comment.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
Comment.h
Comment.idl
CustomEvent.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
CustomEvent.h
CustomEvent.idl
Document.cpp LibWeb: Use forward-declarations of structured serialized types 2025-07-18 10:09:02 -04:00
Document.h LibWeb/CSS: Add basic registered properties with initial values 2025-07-18 11:12:39 +01:00
Document.idl LibWeb: Implement Document.rootElement (SVG2 extension to Document) 2025-05-16 20:36:07 +02:00
DocumentFragment.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
DocumentFragment.h LibWeb: Maintain a mapping for fast lookup in getElementById() 2025-03-26 08:36:25 +00:00
DocumentFragment.idl
DocumentLoadEventDelayer.cpp LibWeb: Allow moving document load event delayers 2025-05-22 17:44:40 -04:00
DocumentLoadEventDelayer.h LibWeb: Allow moving document load event delayers 2025-05-22 17:44:40 -04:00
DocumentLoading.cpp LibWeb: Correct some spec typos 2025-04-10 04:01:37 +02:00
DocumentLoading.h LibURL+LibWeb: Make URL::Origin default constructor private 2025-06-17 20:54:03 +02:00
DocumentObserver.cpp LibWeb/DOM: Support changing document to observe in DocumentObserver 2025-06-24 09:56:14 +02:00
DocumentObserver.h LibWeb/DOM: Support changing document to observe in DocumentObserver 2025-06-24 09:56:14 +02:00
DocumentOrShadowRoot.idl
DocumentType.cpp LibWeb: Update DOMImplementation.createDocumentType() name validation 2025-06-19 07:55:47 -04:00
DocumentType.h LibWeb: Update DOMImplementation.createDocumentType() name validation 2025-06-19 07:55:47 -04:00
DocumentType.idl
DOMEventListener.cpp
DOMEventListener.h LibWeb: Correctly implement event listeners default passive attribute 2024-12-25 14:57:22 +00:00
DOMImplementation.cpp LibWeb: Update DOMImplementation.createDocumentType() name validation 2025-06-19 07:55:47 -04:00
DOMImplementation.h LibWeb: Update DOMImplementation.createDocumentType() name validation 2025-06-19 07:55:47 -04:00
DOMImplementation.idl
DOMTokenList.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
DOMTokenList.h LibWeb: Improve relList feature detection support 2024-12-06 18:09:53 +00:00
DOMTokenList.idl
EditingHostManager.cpp LibWeb: Start integrating the editing API with user keyboard input 2025-05-17 00:29:19 +02:00
EditingHostManager.h LibWeb: Start integrating the editing API with user keyboard input 2025-05-17 00:29:19 +02:00
Element.cpp LibWeb: Remove XML-derived attribute name validation from DOMStringMap 2025-07-17 13:54:01 +02:00
Element.h LibWeb/CSS: Add :unchecked pseudo-class 2025-07-15 21:27:44 +02:00
Element.idl LibWeb/DOM: Actually stub out pointer-capture API 2025-04-14 12:55:44 +02:00
ElementByIdMap.cpp LibWeb: Don't crash if ElementByIdMap already has an element 2025-03-27 14:44:51 +00:00
ElementByIdMap.h LibWeb: Maintain a mapping for fast lookup in getElementById() 2025-03-26 08:36:25 +00:00
ElementFactory.cpp LibWeb/SVG: Add FEGaussianBlurElement 2025-07-09 18:07:12 +01:00
ElementFactory.h
Event.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
Event.h LibJS+LibWeb: Add JS::Object::fast_is<T> helpers for some LibWeb types 2025-04-18 14:45:56 +02:00
Event.idl
EventDispatcher.cpp LibWeb: Do not create a RootVector to invoke IDL callbacks 2025-04-16 07:32:02 -04:00
EventDispatcher.h
EventHandler.idl LibWeb/HTML: Dispatch command events 2025-04-18 12:09:57 +01:00
EventTarget.cpp LibWeb/CSP: Implement the script-src directive 2025-07-09 15:52:54 -06:00
EventTarget.h LibWeb: Avoid dynamic_cast in EventTarget initialization 2025-04-18 14:45:56 +02:00
EventTarget.idl LibWeb: Correctly implement event listeners default passive attribute 2024-12-25 14:57:22 +00:00
HTMLCollection.cpp Meta: Enforce newlines around namespaces 2025-05-14 02:01:59 -06:00
HTMLCollection.h LibGC: Rename MarkedVector => RootVector 2024-12-26 19:10:44 +01:00
HTMLCollection.idl
IDLEventListener.cpp
IDLEventListener.h LibWeb: Correctly implement event listeners default passive attribute 2024-12-25 14:57:22 +00:00
InputEventsTarget.h LibWeb: Start integrating the editing API with user keyboard input 2025-05-17 00:29:19 +02:00
LiveNodeList.cpp LibGC: Rename MarkedVector => RootVector 2024-12-26 19:10:44 +01:00
LiveNodeList.h LibGC: Rename MarkedVector => RootVector 2024-12-26 19:10:44 +01:00
MutationObserver.cpp LibWeb: Split out SimilarOriginWindowAgent from HTML::Agent 2025-04-25 14:07:51 +02:00
MutationObserver.h LibWeb: Make Agent's MutationObserver list weak 2025-02-07 16:53:11 +01:00
MutationObserver.idl
MutationRecord.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
MutationRecord.h
MutationRecord.idl
MutationType.cpp LibWeb: Remove the initialize_strings methods 2025-01-12 00:35:58 +01:00
MutationType.h LibWeb: Remove the initialize_strings methods 2025-01-12 00:35:58 +01:00
NamedNodeMap.cpp LibWeb/CSS: Match *-namespace selectors against all attributes 2025-05-16 16:41:57 +01:00
NamedNodeMap.h LibWeb/CSS: Match *-namespace selectors against all attributes 2025-05-16 16:41:57 +01:00
NamedNodeMap.idl
Node.cpp LibWeb: Defer invalidation sets processing until update_style() 2025-07-17 00:43:26 +02:00
Node.h LibWeb: Add CustomStateSet IDL type 2025-07-04 18:10:28 +01:00
Node.idl
NodeFilter.cpp
NodeFilter.h
NodeFilter.idl
NodeIterator.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
NodeIterator.h LibWeb: Return actual callback object from NodeIterator::filter 2025-02-24 18:29:03 +01:00
NodeIterator.idl LibWeb: Return actual callback object from NodeIterator::filter 2025-02-24 18:29:03 +01:00
NodeList.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
NodeList.h
NodeList.idl
NodeOperations.cpp
NodeOperations.h
NodeType.h LibWeb: Move DOM::NodeType to its own file 2025-02-19 08:45:51 -05:00
NonDocumentTypeChildNode.h AK+Everywhere: Rename verify_cast to as 2025-01-21 11:34:06 -05:00
ParentNode.cpp LibWeb: Implement 'State-preserving atomic move integration' 2025-04-26 08:45:37 -06:00
ParentNode.h LibWeb: Implement 'State-preserving atomic move integration' 2025-04-26 08:45:37 -06:00
ParentNode.idl LibWeb: Implement 'State-preserving atomic move integration' 2025-04-26 08:45:37 -06:00
Position.cpp
Position.h
ProcessingInstruction.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
ProcessingInstruction.h
ProcessingInstruction.idl
PseudoElement.cpp LibWeb: Support counter-* properties on pseudo-elements 2025-06-19 12:35:31 +01:00
PseudoElement.h LibWeb: Include or declare missing definitions for PseudoElement.h 2025-07-15 13:54:17 +01:00
QualifiedName.cpp LibWeb: Make sure we run selectors for mixed-case tag names 2025-07-09 14:36:08 +02:00
QualifiedName.h LibWeb: Make sure we run selectors for mixed-case tag names 2025-07-09 14:36:08 +02:00
Range.cpp LibWeb: Reset document's cursor blink timer after selection change 2025-07-15 17:25:02 +01:00
Range.h LibWeb: Delete unused Range::inverted() 2025-07-03 15:00:49 +02:00
Range.idl
SelectionchangeEventDispatching.h LibWeb: Fix selectionchange typo 2025-01-06 08:55:00 +00:00
ShadowRoot.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
ShadowRoot.h LibWeb: Include own shadow root in for_each_shadow_including_descendant 2025-07-11 16:21:11 +02:00
ShadowRoot.idl
Slot.cpp
Slot.h
Slottable.cpp LibWeb/DOM: Implement 'find flattened slottables' 2025-05-19 23:26:02 +12:00
Slottable.h LibWeb/DOM: Implement 'find flattened slottables' 2025-05-19 23:26:02 +12:00
Slottable.idl
StaticNodeList.cpp
StaticNodeList.h
StaticRange.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
StaticRange.h
StaticRange.idl
StyleElementUtils.cpp LibWeb/CSP: Implement the style-src directive 2025-07-18 11:58:04 +12:00
StyleElementUtils.h
StyleInvalidator.cpp LibWeb: Defer invalidation sets processing until update_style() 2025-07-17 00:43:26 +02:00
StyleInvalidator.h LibWeb: Defer invalidation sets processing until update_style() 2025-07-17 00:43:26 +02:00
Text.cpp LibWeb: Modify range start & end directly where applicable 2025-05-15 11:44:32 +01:00
Text.h LibWeb: Remove unused pointer from DOM::Text to its "owner" element 2024-12-27 12:27:03 +01:00
Text.idl
TreeWalker.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
TreeWalker.h LibWeb: Return actual callback object from TreeWalker::filter 2025-02-24 18:29:03 +01:00
TreeWalker.idl LibWeb: Return actual callback object from TreeWalker::filter 2025-02-24 18:29:03 +01:00
Utils.cpp AK+Everywhere: Rename verify_cast to as 2025-01-21 11:34:06 -05:00
Utils.h
XMLDocument.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
XMLDocument.h Everywhere: Use URL::about_XXX factory functions 2025-02-15 17:05:55 +00:00
XMLDocument.idl