1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00
serenity/Userland/Libraries/LibWeb/DOM
Shannon Booth d8759d9656 LibWeb: Use UTF-16 code unit offsets and lengths in CharacterData
We were previously assuming that the input offsets and lengths were all
in raw byte offsets into a UTF-8 string. While internally our String
representation may be in UTF-8 from the external world it is seen as
UTF-16, with code unit offsets passed through, and used as the returned
length.

Beforehand, the included test included in this commit would crash
ladybird (and otherwise return wrong values).

The implementation here is very inefficient, I am sure there is a
much smarter way to write it so that we would not need a conversion
from UTF-8 to a UTF-16 string (and then back again).

Fixes: #20971
2023-12-23 20:41:41 +01:00
..
AbortController.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
AbortController.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
AbortController.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
AbortSignal.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
AbortSignal.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
AbortSignal.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
AbstractRange.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
AbstractRange.h
AbstractRange.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
AccessibilityTreeNode.cpp LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
AccessibilityTreeNode.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
Attr.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
Attr.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
Attr.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
CDATASection.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
CDATASection.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
CDATASection.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
CharacterData.cpp LibWeb: Use UTF-16 code unit offsets and lengths in CharacterData 2023-12-23 20:41:41 +01:00
CharacterData.h LibWeb: Use UTF-16 code unit offsets and lengths in CharacterData 2023-12-23 20:41:41 +01:00
CharacterData.idl LibWeb: Use UTF-16 code unit offsets and lengths in CharacterData 2023-12-23 20:41:41 +01:00
ChildNode.h LibWeb: Remove DeprecatedString support from {Child,Parent}Node 2023-10-06 08:25:40 +02:00
ChildNode.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
Comment.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
Comment.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
Comment.idl
CustomEvent.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
CustomEvent.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
CustomEvent.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
Document.cpp LibWeb: Scroll to the top after navigating to a new document 2023-12-20 09:48:06 -07:00
Document.h LibWeb: Make Document::page() return a Page& 2023-12-15 22:04:46 +01:00
Document.idl IDL: Fix syntax errors 2023-11-11 08:51:51 +01:00
DocumentFragment.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
DocumentFragment.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
DocumentFragment.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
DocumentLoadEventDelayer.cpp
DocumentLoadEventDelayer.h
DocumentLoading.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
DocumentLoading.h LibWeb: Consider content-type charset when determining XML encoding 2023-11-17 16:02:36 +01:00
DocumentObserver.cpp LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
DocumentObserver.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
DocumentType.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
DocumentType.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
DocumentType.idl
DOMEventListener.cpp LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
DOMEventListener.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
DOMImplementation.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
DOMImplementation.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
DOMImplementation.idl
DOMTokenList.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
DOMTokenList.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
DOMTokenList.idl
Element.cpp LibWeb: Hide select chevron icon when appearance: none; 2023-12-23 10:12:36 +01:00
Element.h LibWeb: Hide select chevron icon when appearance: none; 2023-12-23 10:12:36 +01:00
Element.idl LibWeb: Port Element interface from DeprecatedString 2023-10-06 08:25:40 +02:00
ElementFactory.cpp LibWeb: Add initial support for SVG <textPath> 2023-12-19 21:29:03 +01:00
ElementFactory.h LibWeb: Use FlyString for create_element() namespace strings 2023-11-04 21:28:30 +01:00
Event.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
Event.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
Event.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
EventDispatcher.cpp LibWeb: Port call_user_object_operation from DeprecatedString 2023-12-02 22:54:53 +01:00
EventDispatcher.h
EventHandler.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
EventTarget.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
EventTarget.h LibWeb: Only allocate EventTarget listener/handler storage on demand 2023-11-20 00:39:42 +01:00
EventTarget.idl
HTMLCollection.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
HTMLCollection.h LibWeb: Port supported property names from DeprecatedString to String 2023-11-28 17:15:27 -05:00
HTMLCollection.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
HTMLFormControlsCollection.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
HTMLFormControlsCollection.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
HTMLFormControlsCollection.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
IDLEventListener.cpp LibWeb/LibJS: Avoid GC visit of raw pointers where possible 2023-11-19 08:05:45 +00:00
IDLEventListener.h
InnerHTML.idl
LiveNodeList.cpp LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
LiveNodeList.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
MutationObserver.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
MutationObserver.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
MutationObserver.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
MutationRecord.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
MutationRecord.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
MutationRecord.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
MutationType.cpp
MutationType.h
NamedNodeMap.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
NamedNodeMap.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
NamedNodeMap.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
Node.cpp LibWeb: Use UTF-16 code unit offsets and lengths in CharacterData 2023-12-23 20:41:41 +01:00
Node.h LibWeb: Port DOM::Node from DeprecatedString 2023-12-02 22:54:53 +01:00
Node.idl LibWeb: Port Node interface from DeprecatedString to String 2023-09-17 20:29:18 +02:00
NodeFilter.cpp LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
NodeFilter.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
NodeFilter.idl IDL: Add missing spec links 2023-11-11 08:51:51 +01:00
NodeIterator.cpp LibWeb: Port call_user_object_operation from DeprecatedString 2023-12-02 22:54:53 +01:00
NodeIterator.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
NodeIterator.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
NodeList.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
NodeList.h
NodeList.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
NodeOperations.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
NodeOperations.h LibWeb: Remove DeprecatedString support from {Child,Parent}Node 2023-10-06 08:25:40 +02:00
NonDocumentTypeChildNode.h
NonElementParentNode.h LibWeb: Use Element::id() in getElementById() 2023-11-02 17:09:34 +01:00
ParentNode.cpp LibWeb: Remove DeprecatedString impls of get_elements_by_tag_name{_ns} 2023-11-06 11:37:08 +01:00
ParentNode.h LibWeb: Remove DeprecatedString impls of get_elements_by_tag_name{_ns} 2023-11-06 11:37:08 +01:00
ParentNode.idl
Position.cpp LibWeb: Add missing DOM::Position::visit_edges() 2023-12-12 01:08:07 +01:00
Position.h LibWeb: Add missing DOM::Position::visit_edges() 2023-12-12 01:08:07 +01:00
ProcessingInstruction.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
ProcessingInstruction.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
ProcessingInstruction.idl
QualifiedName.cpp LibWeb: Remove some now unused deprecated functions from QualifiedName 2023-11-06 11:37:08 +01:00
QualifiedName.h LibWeb: Remove some now unused deprecated functions from QualifiedName 2023-11-06 11:37:08 +01:00
RadioNodeList.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
RadioNodeList.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
RadioNodeList.idl
Range.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Range.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
Range.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
ShadowRoot.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
ShadowRoot.h LibWeb: Port XMLSerializer from DeprecatedString to String 2023-11-20 15:00:19 +01:00
ShadowRoot.idl
Slot.cpp
Slot.h
Slottable.cpp LibWeb: Skip assigning slottables for non-shadow roots 2023-11-03 20:50:34 +01:00
Slottable.h
Slottable.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
StaticNodeList.cpp LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
StaticNodeList.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
StaticRange.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
StaticRange.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
StaticRange.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
StyleElementUtils.cpp LibWeb: Make create_a_css_style_sheet() take String arguments 2023-12-01 20:48:13 +01:00
StyleElementUtils.h LibWeb: Make create_a_css_style_sheet() take String arguments 2023-12-01 20:48:13 +01:00
Text.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
Text.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
Text.idl
TreeWalker.cpp LibWeb: Don't get stuck in TreeWalker.nextNode() when current detached 2023-12-03 23:16:26 +01:00
TreeWalker.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
TreeWalker.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
XMLDocument.cpp LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
XMLDocument.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
XMLDocument.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00