ladybird/Libraries/LibWeb/CMakeLists.txt

1033 lines
33 KiB
Text
Raw Normal View History

include(libweb_generators)
include(vulkan)
include(skia)
if (APPLE)
find_package(unofficial-angle REQUIRED CONFIG)
endif()
set(SOURCES
2023-11-05 10:20:10 -07:00
Animations/Animatable.cpp
2023-11-06 15:17:19 +00:00
Animations/Animation.cpp
Animations/AnimationEffect.cpp
Animations/AnimationPlaybackEvent.cpp
Animations/AnimationTimeline.cpp
Animations/DocumentTimeline.cpp
2023-11-04 13:09:57 -07:00
Animations/KeyframeEffect.cpp
Animations/PseudoElementParsing.cpp
ARIA/AriaData.cpp
ARIA/ARIAMixin.cpp
ARIA/AttributeNames.cpp
ARIA/Roles.cpp
ARIA/RoleType.cpp
ARIA/StateAndProperties.cpp
Bindings/AudioConstructor.cpp
Bindings/HostDefined.cpp
Bindings/ImageConstructor.cpp
Bindings/Intrinsics.cpp
Bindings/LocationConstructor.cpp
Bindings/MainThreadVM.cpp
Bindings/OptionConstructor.cpp
Bindings/PlatformObject.cpp
Bindings/PrincipalHostDefined.cpp
Bindings/SyntheticHostDefined.cpp
Clipboard/Clipboard.cpp
Clipboard/ClipboardEvent.cpp
Clipboard/ClipboardItem.cpp
Clipboard/SystemClipboard.cpp
Compression/CompressionStream.cpp
Compression/DecompressionStream.cpp
ContentSecurityPolicy/BlockingAlgorithms.cpp
ContentSecurityPolicy/Directives/Directive.cpp
ContentSecurityPolicy/Directives/DirectiveFactory.cpp
ContentSecurityPolicy/Directives/DirectiveOperations.cpp
ContentSecurityPolicy/Directives/Names.cpp
ContentSecurityPolicy/Directives/SerializedDirective.cpp
ContentSecurityPolicy/Policy.cpp
ContentSecurityPolicy/PolicyList.cpp
ContentSecurityPolicy/SecurityPolicyViolationEvent.cpp
ContentSecurityPolicy/SerializedPolicy.cpp
ContentSecurityPolicy/Violation.cpp
Cookie/Cookie.cpp
Cookie/ParsedCookie.cpp
CredentialManagement/Credential.cpp
CredentialManagement/CredentialsContainer.cpp
CredentialManagement/FederatedCredential.cpp
CredentialManagement/PasswordCredential.cpp
Crypto/Crypto.cpp
Crypto/CryptoAlgorithms.cpp
Crypto/CryptoBindings.cpp
2023-12-15 20:25:35 +01:00
Crypto/CryptoKey.cpp
Crypto/KeyAlgorithms.cpp
Crypto/SubtleCrypto.cpp
CSS/Angle.cpp
CSS/AnimationEvent.cpp
CSS/BooleanExpression.cpp
CSS/CalculatedOr.cpp
CSS/CascadedProperties.cpp
CSS/Clip.cpp
CSS/ComputedProperties.cpp
CSS/CountersSet.cpp
2023-03-15 10:55:53 -04:00
CSS/CSS.cpp
CSS/CSSAnimation.cpp
CSS/CSSConditionRule.cpp
CSS/CSSFontFaceDescriptors.cpp
CSS/CSSFontFaceRule.cpp
CSS/CSSGroupingRule.cpp
CSS/CSSImportRule.cpp
CSS/CSSKeyframeRule.cpp
CSS/CSSKeyframesRule.cpp
CSS/CSSLayerBlockRule.cpp
CSS/CSSLayerStatementRule.cpp
CSS/CSSMediaRule.cpp
CSS/CSSNamespaceRule.cpp
CSS/CSSNestedDeclarations.cpp
CSS/CSSNumericType.cpp
CSS/CSSPropertyRule.cpp
CSS/CSSRule.cpp
CSS/CSSRuleList.cpp
CSS/CSSStyleDeclaration.cpp
CSS/CSSStyleProperties.cpp
CSS/CSSStyleRule.cpp
CSS/CSSStyleSheet.cpp
CSS/CSSStyleValue.cpp
CSS/CSSSupportsRule.cpp
CSS/CSSTransition.cpp
CSS/Descriptor.cpp
CSS/Display.cpp
CSS/EdgeRect.cpp
CSS/Fetch.cpp
CSS/Flex.cpp
CSS/FontFace.cpp
CSS/FontFaceSet.cpp
CSS/Frequency.cpp
CSS/GridTrackPlacement.cpp
CSS/GridTrackSize.cpp
CSS/Interpolation.cpp
CSS/InvalidationSet.cpp
CSS/Length.cpp
CSS/LengthBox.cpp
CSS/MediaList.cpp
CSS/MediaQuery.cpp
CSS/MediaQueryList.cpp
CSS/MediaQueryListEvent.cpp
CSS/Number.cpp
CSS/ParsedFontFace.cpp
CSS/Parser/ComponentValue.cpp
CSS/Parser/DescriptorParsing.cpp
CSS/Parser/GradientParsing.cpp
CSS/Parser/Helpers.cpp
CSS/Parser/MediaParsing.cpp
CSS/Parser/Parser.cpp
CSS/Parser/PropertyParsing.cpp
CSS/Parser/RuleContext.cpp
CSS/Parser/RuleParsing.cpp
CSS/Parser/SelectorParsing.cpp
CSS/Parser/Token.cpp
CSS/Parser/Tokenizer.cpp
CSS/Parser/Types.cpp
CSS/Parser/ValueParsing.cpp
CSS/PreferredColorScheme.cpp
2024-06-13 01:03:56 +02:00
CSS/PreferredContrast.cpp
CSS/PreferredMotion.cpp
CSS/Ratio.cpp
CSS/Resolution.cpp
CSS/Screen.cpp
CSS/ScreenOrientation.cpp
CSS/Selector.cpp
CSS/SelectorEngine.cpp
CSS/Serialize.cpp
CSS/Size.cpp
CSS/Sizing.cpp
CSS/StyleComputer.cpp
CSS/StyleInvalidation.cpp
CSS/StyleInvalidationData.cpp
CSS/StyleProperty.cpp
CSS/StyleSheet.cpp
CSS/StyleSheetIdentifier.cpp
CSS/StyleSheetList.cpp
CSS/StyleValues/AngleStyleValue.cpp
CSS/StyleValues/BackgroundRepeatStyleValue.cpp
CSS/StyleValues/BackgroundSizeStyleValue.cpp
CSS/StyleValues/BasicShapeStyleValue.cpp
CSS/StyleValues/BorderRadiusStyleValue.cpp
CSS/StyleValues/CalculatedStyleValue.cpp
CSS/StyleValues/ColorFunctionStyleValue.cpp
CSS/StyleValues/ColorMixStyleValue.cpp
CSS/StyleValues/ColorSchemeStyleValue.cpp
CSS/StyleValues/ConicGradientStyleValue.cpp
CSS/StyleValues/ContentStyleValue.cpp
CSS/StyleValues/CounterDefinitionsStyleValue.cpp
CSS/StyleValues/CounterStyleValue.cpp
CSS/StyleValues/CSSColorValue.cpp
CSS/StyleValues/CSSHSL.cpp
CSS/StyleValues/CSSHWB.cpp
CSS/StyleValues/CSSKeywordValue.cpp
CSS/StyleValues/CSSLabLike.cpp
CSS/StyleValues/CSSLCHLike.cpp
CSS/StyleValues/CSSLightDark.cpp
CSS/StyleValues/CSSRGB.cpp
CSS/StyleValues/CursorStyleValue.cpp
CSS/StyleValues/DisplayStyleValue.cpp
CSS/StyleValues/EasingStyleValue.cpp
CSS/StyleValues/EdgeStyleValue.cpp
CSS/StyleValues/FilterValueListStyleValue.cpp
CSS/StyleValues/FontSourceStyleValue.cpp
CSS/StyleValues/FontStyleStyleValue.cpp
CSS/StyleValues/GridAutoFlowStyleValue.cpp
CSS/StyleValues/GridTemplateAreaStyleValue.cpp
CSS/StyleValues/GridTrackPlacementStyleValue.cpp
CSS/StyleValues/GridTrackSizeListStyleValue.cpp
CSS/StyleValues/ImageStyleValue.cpp
CSS/StyleValues/IntegerStyleValue.cpp
CSS/StyleValues/LengthStyleValue.cpp
CSS/StyleValues/LinearGradientStyleValue.cpp
CSS/StyleValues/MathDepthStyleValue.cpp
CSS/StyleValues/NumberStyleValue.cpp
CSS/StyleValues/OpenTypeTaggedStyleValue.cpp
CSS/StyleValues/PositionStyleValue.cpp
CSS/StyleValues/RadialGradientStyleValue.cpp
CSS/StyleValues/RectStyleValue.cpp
CSS/StyleValues/ShadowStyleValue.cpp
CSS/StyleValues/ShorthandStyleValue.cpp
CSS/StyleValues/StyleValueList.cpp
CSS/StyleValues/TransformationStyleValue.cpp
2024-02-19 19:01:34 -07:00
CSS/StyleValues/TransitionStyleValue.cpp
CSS/StyleValues/UnicodeRangeStyleValue.cpp
CSS/StyleValues/UnresolvedStyleValue.cpp
CSS/Supports.cpp
CSS/SyntaxHighlighter/SyntaxHighlighter.cpp
CSS/SystemColor.cpp
CSS/Time.cpp
CSS/Transformation.cpp
CSS/TransitionEvent.cpp
CSS/URL.cpp
CSS/VisualViewport.cpp
DOM/AbortController.cpp
DOM/AbortSignal.cpp
DOM/AbstractRange.cpp
DOM/AccessibilityTreeNode.cpp
DOM/AdoptedStyleSheets.cpp
DOM/Attr.cpp
DOM/CDATASection.cpp
DOM/CharacterData.cpp
DOM/Comment.cpp
DOM/CustomEvent.cpp
DOM/Document.cpp
DOM/DocumentFragment.cpp
DOM/DocumentLoadEventDelayer.cpp
DOM/DocumentLoading.cpp
DOM/DocumentObserver.cpp
DOM/DocumentType.cpp
DOM/DOMEventListener.cpp
DOM/DOMImplementation.cpp
DOM/DOMTokenList.cpp
LibWeb: Separate text control input events handling from contenteditable This input event handling change is intended to address the following design issues: - Having `DOM::Position` is unnecessary complexity when `Selection` exists because caret position could be described by the selection object with a collapsed state. Before this change, we had to synchronize those whenever one of them was modified, and there were already bugs caused by that, i.e., caret position was not changed when selection offset was modified from the JS side. - Selection API exposes selection offset within `<textarea>` and `<input>`, which is not supposed to happen. These objects should manage their selection state by themselves and have selection offset even when they are not displayed. - `EventHandler` looks only at `DOM::Text` owned by `DOM::Position` while doing text manipulations. It works fine for `<input>` and `<textarea>`, but `contenteditable` needs to consider all text descendant text nodes; i.e., if the cursor is moved outside of `DOM::Text`, we need to look for an adjacent text node to move the cursor there. With this change, `EventHandler` no longer does direct manipulations on caret position or text content, but instead delegates them to the active `InputEventsTarget`, which could be either `FormAssociatedTextControlElement` (for `<input>` and `<textarea>`) or `EditingHostManager` (for `contenteditable`). The `Selection` object is used to manage both selection and caret position for `contenteditable`, and text control elements manage their own selection state that is not exposed by Selection API. This change improves text editing on Discord, as now we don't have to refocus the `contenteditable` element after character input. The problem was that selection manipulations from the JS side were not propagated to `DOM::Position`. I expect this change to make future correctness improvements for `contenteditable` (and `designMode`) easier, as now it's decoupled from `<input>` and `<textarea>` and separated from `EventHandler`, which is quite a busy file.
2024-10-23 21:26:58 +02:00
DOM/EditingHostManager.cpp
DOM/Element.cpp
DOM/ElementByIdMap.cpp
DOM/ElementFactory.cpp
DOM/Event.cpp
DOM/EventDispatcher.cpp
DOM/EventTarget.cpp
DOM/HTMLCollection.cpp
DOM/IDLEventListener.cpp
DOM/LiveNodeList.cpp
DOM/MutationObserver.cpp
DOM/MutationRecord.cpp
DOM/MutationType.cpp
DOM/NamedNodeMap.cpp
DOM/Node.cpp
DOM/NodeFilter.cpp
DOM/NodeIterator.cpp
2022-09-01 16:30:26 +02:00
DOM/NodeList.cpp
DOM/NodeOperations.cpp
DOM/ParentNode.cpp
DOM/Position.cpp
DOM/ProcessingInstruction.cpp
DOM/QualifiedName.cpp
DOM/Range.cpp
DOM/ShadowRoot.cpp
DOM/Slot.cpp
DOM/Slottable.cpp
DOM/StaticNodeList.cpp
2022-01-30 23:37:42 +00:00
DOM/StaticRange.cpp
DOM/StyleElementUtils.cpp
DOM/Text.cpp
DOM/TreeWalker.cpp
DOM/Utils.cpp
DOM/XMLDocument.cpp
DOMURL/DOMURL.cpp
DOMURL/URLSearchParams.cpp
DOMURL/URLSearchParamsIterator.cpp
Dump.cpp
Editing/CommandNames.cpp
Editing/Commands.cpp
Editing/ExecCommand.cpp
Editing/Internal/Algorithms.cpp
Encoding/TextDecoder.cpp
Encoding/TextEncoder.cpp
Encoding/TextEncoderCommon.cpp
Encoding/TextEncoderStream.cpp
EntriesAPI/FileSystemEntry.cpp
EventTiming/PerformanceEventTiming.cpp
Fetch/Body.cpp
2022-09-22 00:04:06 +01:00
Fetch/BodyInit.cpp
Fetch/Enums.cpp
Fetch/Fetching/Checks.cpp
Fetch/Fetching/FetchedDataReceiver.cpp
Fetch/Fetching/Fetching.cpp
Fetch/Fetching/PendingResponse.cpp
Fetch/Fetching/RefCountedFlag.cpp
Fetch/FetchMethod.cpp
Fetch/Headers.cpp
Fetch/HeadersIterator.cpp
Fetch/Infrastructure/FetchAlgorithms.cpp
Fetch/Infrastructure/FetchController.cpp
Fetch/Infrastructure/FetchParams.cpp
Fetch/Infrastructure/FetchRecord.cpp
Fetch/Infrastructure/FetchTimingInfo.cpp
Fetch/Infrastructure/HTTP.cpp
Fetch/Infrastructure/HTTP/Bodies.cpp
Fetch/Infrastructure/HTTP/Headers.cpp
Fetch/Infrastructure/HTTP/Methods.cpp
Fetch/Infrastructure/HTTP/Requests.cpp
Fetch/Infrastructure/HTTP/Responses.cpp
Fetch/Infrastructure/HTTP/Statuses.cpp
Fetch/Infrastructure/IncrementalReadLoopReadRequest.cpp
Fetch/Infrastructure/MimeTypeBlocking.cpp
Fetch/Infrastructure/NetworkPartitionKey.cpp
Fetch/Infrastructure/NoSniffBlocking.cpp
Fetch/Infrastructure/PortBlocking.cpp
Fetch/Infrastructure/Task.cpp
Fetch/Infrastructure/URL.cpp
Fetch/Request.cpp
Fetch/Response.cpp
2022-07-10 18:31:17 +02:00
FileAPI/Blob.cpp
FileAPI/BlobURLStore.cpp
FileAPI/File.cpp
FileAPI/FileList.cpp
FileAPI/FileReader.cpp
FileAPI/FileReaderSync.cpp
Geometry/DOMMatrix.cpp
Geometry/DOMMatrixReadOnly.cpp
Geometry/DOMPoint.cpp
Geometry/DOMPointReadOnly.cpp
2023-08-20 22:03:41 +02:00
Geometry/DOMQuad.cpp
Geometry/DOMRect.cpp
Geometry/DOMRectList.cpp
Geometry/DOMRectReadOnly.cpp
HighResolutionTime/Performance.cpp
HighResolutionTime/TimeOrigin.cpp
HTML/AbstractWorker.cpp
HTML/AnimatedBitmapDecodedImageData.cpp
HTML/AnimationFrameCallbackDriver.cpp
HTML/AttributeNames.cpp
HTML/AudioTrack.cpp
HTML/AudioTrackList.cpp
HTML/AutocompleteElement.cpp
HTML/BarProp.cpp
HTML/BeforeUnloadEvent.cpp
HTML/BroadcastChannel.cpp
HTML/BrowsingContext.cpp
HTML/BrowsingContextGroup.cpp
HTML/Canvas/CanvasDrawImage.cpp
HTML/Canvas/CanvasPath.cpp
HTML/Canvas/CanvasState.cpp
HTML/CanvasGradient.cpp
HTML/CanvasPattern.cpp
HTML/CanvasRenderingContext2D.cpp
HTML/CloseEvent.cpp
HTML/CloseWatcher.cpp
HTML/CloseWatcherManager.cpp
HTML/CommandEvent.cpp
HTML/CORSSettingAttribute.cpp
HTML/CrossOrigin/AbstractOperations.cpp
HTML/CrossOrigin/Reporting.cpp
HTML/CustomElements/CustomElementDefinition.cpp
HTML/CustomElements/CustomElementName.cpp
HTML/CustomElements/CustomElementReactionNames.cpp
HTML/CustomElements/CustomElementRegistry.cpp
HTML/DataTransfer.cpp
HTML/DataTransferItem.cpp
HTML/DataTransferItemList.cpp
HTML/Dates.cpp
HTML/DecodedImageData.cpp
HTML/DedicatedWorkerGlobalScope.cpp
HTML/DocumentState.cpp
HTML/DOMParser.cpp
2024-07-14 12:31:50 +01:00
HTML/DOMStringList.cpp
HTML/DOMStringMap.cpp
HTML/DragDataStore.cpp
HTML/DragEvent.cpp
HTML/ElementInternals.cpp
HTML/EmbedderPolicy.cpp
HTML/ErrorEvent.cpp
HTML/EventHandler.cpp
HTML/EventLoop/EventLoop.cpp
HTML/EventLoop/Task.cpp
HTML/EventLoop/TaskQueue.cpp
HTML/EventNames.cpp
HTML/EventSource.cpp
HTML/FileFilter.cpp
HTML/Focus.cpp
HTML/FormAssociatedElement.cpp
HTML/FormControlInfrastructure.cpp
HTML/FormDataEvent.cpp
HTML/GlobalEventHandlers.cpp
2024-04-15 04:25:24 +02:00
HTML/HashChangeEvent.cpp
HTML/History.cpp
HTML/HTMLAllCollection.cpp
HTML/HTMLAnchorElement.cpp
HTML/HTMLAreaElement.cpp
HTML/HTMLAudioElement.cpp
HTML/HTMLBaseElement.cpp
HTML/HTMLBodyElement.cpp
HTML/HTMLBRElement.cpp
HTML/HTMLButtonElement.cpp
HTML/HTMLCanvasElement.cpp
HTML/HTMLDataElement.cpp
HTML/HTMLDataListElement.cpp
HTML/HTMLDetailsElement.cpp
HTML/HTMLDialogElement.cpp
HTML/HTMLDirectoryElement.cpp
HTML/HTMLDivElement.cpp
HTML/HTMLDListElement.cpp
HTML/HTMLDocument.cpp
HTML/HTMLElement.cpp
HTML/HTMLEmbedElement.cpp
HTML/HTMLFieldSetElement.cpp
HTML/HTMLFontElement.cpp
HTML/HTMLFormControlsCollection.cpp
HTML/HTMLFormElement.cpp
HTML/HTMLFrameElement.cpp
HTML/HTMLFrameSetElement.cpp
HTML/HTMLHeadElement.cpp
HTML/HTMLHeadingElement.cpp
HTML/HTMLHRElement.cpp
HTML/HTMLHtmlElement.cpp
HTML/HTMLHyperlinkElementUtils.cpp
HTML/HTMLIFrameElement.cpp
HTML/HTMLImageElement.cpp
HTML/HTMLInputElement.cpp
HTML/HTMLLabelElement.cpp
HTML/HTMLLegendElement.cpp
HTML/HTMLLIElement.cpp
HTML/HTMLLinkElement.cpp
HTML/HTMLMapElement.cpp
HTML/HTMLMarqueeElement.cpp
HTML/HTMLMediaElement.cpp
HTML/HTMLMenuElement.cpp
HTML/HTMLMetaElement.cpp
HTML/HTMLMeterElement.cpp
HTML/HTMLModElement.cpp
HTML/HTMLObjectElement.cpp
HTML/HTMLOListElement.cpp
HTML/HTMLOptGroupElement.cpp
HTML/HTMLOptionElement.cpp
HTML/HTMLOptionsCollection.cpp
HTML/HTMLOrSVGElement.cpp
HTML/HTMLOutputElement.cpp
HTML/HTMLParagraphElement.cpp
HTML/HTMLParamElement.cpp
HTML/HTMLPictureElement.cpp
HTML/HTMLPreElement.cpp
HTML/HTMLProgressElement.cpp
HTML/HTMLQuoteElement.cpp
HTML/HTMLScriptElement.cpp
HTML/HTMLSelectElement.cpp
HTML/HTMLSlotElement.cpp
HTML/HTMLSourceElement.cpp
HTML/HTMLSpanElement.cpp
HTML/HTMLStyleElement.cpp
HTML/HTMLSummaryElement.cpp
HTML/HTMLTableCaptionElement.cpp
HTML/HTMLTableCellElement.cpp
HTML/HTMLTableColElement.cpp
HTML/HTMLTableElement.cpp
HTML/HTMLTableRowElement.cpp
HTML/HTMLTableSectionElement.cpp
HTML/HTMLTemplateElement.cpp
HTML/HTMLTextAreaElement.cpp
HTML/HTMLTimeElement.cpp
HTML/HTMLTitleElement.cpp
HTML/HTMLTrackElement.cpp
HTML/HTMLUListElement.cpp
HTML/HTMLUnknownElement.cpp
HTML/HTMLVideoElement.cpp
HTML/ImageBitmap.cpp
HTML/ImageData.cpp
HTML/ImageRequest.cpp
HTML/ListOfAvailableImages.cpp
HTML/Location.cpp
HTML/MediaError.cpp
HTML/MessageChannel.cpp
HTML/MessageEvent.cpp
HTML/MessagePort.cpp
HTML/MimeType.cpp
HTML/MimeTypeArray.cpp
HTML/Navigable.cpp
HTML/NavigableContainer.cpp
HTML/NavigateEvent.cpp
HTML/Navigation.cpp
HTML/NavigationCurrentEntryChangeEvent.cpp
HTML/NavigationDestination.cpp
HTML/NavigationHistoryEntry.cpp
HTML/NavigationObserver.cpp
HTML/NavigationParams.cpp
HTML/NavigationTransition.cpp
HTML/Navigator.cpp
HTML/NavigatorBeacon.cpp
HTML/NavigatorID.cpp
HTML/Numbers.cpp
HTML/PageTransitionEvent.cpp
HTML/Parser/Entities.cpp
HTML/Parser/HTMLEncodingDetection.cpp
HTML/Parser/HTMLParser.cpp
HTML/Parser/HTMLToken.cpp
HTML/Parser/HTMLTokenizer.cpp
HTML/Parser/ListOfActiveFormattingElements.cpp
HTML/Parser/StackOfOpenElements.cpp
2022-08-11 16:50:23 +01:00
HTML/Path2D.cpp
HTML/Plugin.cpp
HTML/PluginArray.cpp
HTML/PolicyContainers.cpp
HTML/PopoverInvokerElement.cpp
HTML/PopStateEvent.cpp
HTML/PotentialCORSRequest.cpp
HTML/PromiseRejectionEvent.cpp
HTML/RadioNodeList.cpp
HTML/RenderingThread.cpp
HTML/Scripting/Agent.cpp
HTML/Scripting/ClassicScript.cpp
HTML/Scripting/Environments.cpp
HTML/Scripting/EnvironmentSettingsSnapshot.cpp
HTML/Scripting/ExceptionReporter.cpp
HTML/Scripting/Fetching.cpp
2024-04-13 21:22:05 +01:00
HTML/Scripting/ImportMap.cpp
HTML/Scripting/ImportMapParseResult.cpp
HTML/Scripting/ModuleMap.cpp
HTML/Scripting/ModuleScript.cpp
HTML/Scripting/Script.cpp
HTML/Scripting/SerializedEnvironmentSettingsObject.cpp
HTML/Scripting/SimilarOriginWindowAgent.cpp
HTML/Scripting/SyntheticRealmSettings.cpp
HTML/Scripting/TemporaryExecutionContext.cpp
HTML/Scripting/WindowEnvironmentSettingsObject.cpp
HTML/Scripting/WorkerAgent.cpp
HTML/Scripting/WorkerEnvironmentSettingsObject.cpp
HTML/SelectedFile.cpp
HTML/SelectItem.cpp
HTML/SerializedPolicyContainer.cpp
HTML/SessionHistoryEntry.cpp
HTML/SessionHistoryTraversalQueue.cpp
HTML/ShadowRealmGlobalScope.cpp
HTML/SharedResourceRequest.cpp
HTML/SharedWorker.cpp
HTML/SharedWorkerGlobalScope.cpp
HTML/SourceSet.cpp
HTML/SourceSnapshotParams.cpp
HTML/Storage.cpp
HTML/StorageEvent.cpp
HTML/StructuredSerialize.cpp
HTML/SubmitEvent.cpp
HTML/SyntaxHighlighter/SyntaxHighlighter.cpp
HTML/TagNames.cpp
HTML/TextMetrics.cpp
HTML/TextTrack.cpp
HTML/TextTrackCue.cpp
HTML/TextTrackCueList.cpp
HTML/TextTrackList.cpp
HTML/Timer.cpp
HTML/TimeRanges.cpp
HTML/ToggleEvent.cpp
HTML/TokenizedFeatures.cpp
HTML/TrackEvent.cpp
HTML/TraversableNavigable.cpp
HTML/UniversalGlobalScope.cpp
2024-05-25 12:40:44 +01:00
HTML/UserActivation.cpp
HTML/ValidityState.cpp
HTML/VideoTrack.cpp
HTML/VideoTrackList.cpp
HTML/WebViewHints.cpp
HTML/Window.cpp
2022-06-27 19:48:54 +01:00
HTML/WindowEventHandlers.cpp
HTML/WindowOrWorkerGlobalScope.cpp
HTML/WindowProxy.cpp
HTML/Worker.cpp
HTML/WorkerAgentParent.cpp
HTML/WorkerDebugConsoleClient.cpp
HTML/WorkerGlobalScope.cpp
HTML/WorkerLocation.cpp
HTML/WorkerNavigator.cpp
HTML/WorkletGlobalScope.cpp
HTML/XMLSerializer.cpp
2024-11-07 18:49:31 +01:00
IndexedDB/IDBCursor.cpp
IndexedDB/IDBDatabase.cpp
2024-05-19 17:58:06 +12:00
IndexedDB/IDBFactory.cpp
2024-11-07 18:52:59 +01:00
IndexedDB/IDBIndex.cpp
2024-11-07 19:04:11 +01:00
IndexedDB/IDBKeyRange.cpp
2024-11-07 18:56:26 +01:00
IndexedDB/IDBObjectStore.cpp
IndexedDB/IDBOpenDBRequest.cpp
IndexedDB/IDBRequest.cpp
2024-11-07 19:00:20 +01:00
IndexedDB/IDBTransaction.cpp
2024-11-04 19:17:54 +01:00
IndexedDB/IDBVersionChangeEvent.cpp
IndexedDB/Internal/Algorithms.cpp
IndexedDB/Internal/Database.cpp
2025-04-01 18:26:13 +02:00
IndexedDB/Internal/Index.cpp
IndexedDB/Internal/Key.cpp
IndexedDB/Internal/ObjectStore.cpp
IndexedDB/Internal/RequestList.cpp
Infra/ByteSequences.cpp
Infra/JSON.cpp
Infra/Strings.cpp
Internals/InternalAnimationTimeline.cpp
Internals/Internals.cpp
Internals/InternalsBase.cpp
Internals/WebUI.cpp
IntersectionObserver/IntersectionObserver.cpp
IntersectionObserver/IntersectionObserverEntry.cpp
Layout/AudioBox.cpp
Layout/AvailableSpace.cpp
Layout/BlockContainer.cpp
Layout/BlockFormattingContext.cpp
Layout/Box.cpp
Layout/BreakNode.cpp
Layout/CanvasBox.cpp
Layout/CheckBox.cpp
Layout/FieldSetBox.cpp
Layout/FlexFormattingContext.cpp
Layout/FormattingContext.cpp
2022-08-23 10:36:27 +02:00
Layout/GridFormattingContext.cpp
Layout/ImageBox.cpp
Layout/ImageProvider.cpp
Layout/InlineFormattingContext.cpp
Layout/InlineLevelIterator.cpp
Layout/InlineNode.cpp
Layout/Label.cpp
Layout/LabelableNode.cpp
Layout/LayoutState.cpp
Layout/LegendBox.cpp
Layout/LineBox.cpp
Layout/LineBoxFragment.cpp
Layout/LineBuilder.cpp
Layout/ListItemBox.cpp
Layout/ListItemMarkerBox.cpp
Layout/NavigableContainerViewport.cpp
Layout/Node.cpp
Layout/RadioButton.cpp
Layout/ReplacedBox.cpp
Layout/SVGBox.cpp
Layout/SVGClipBox.cpp
Layout/SVGForeignObjectBox.cpp
Layout/SVGFormattingContext.cpp
Layout/SVGGeometryBox.cpp
Layout/SVGGraphicsBox.cpp
Layout/SVGImageBox.cpp
Layout/SVGMaskBox.cpp
Layout/SVGSVGBox.cpp
Layout/SVGTextBox.cpp
Layout/SVGTextPathBox.cpp
Layout/TableFormattingContext.cpp
Layout/TableGrid.cpp
Layout/TableWrapper.cpp
Layout/TextNode.cpp
Layout/TreeBuilder.cpp
Layout/VideoBox.cpp
Layout/Viewport.cpp
Loader/ContentFilter.cpp
Loader/FileRequest.cpp
Loader/GeneratedPagesLoader.cpp
Loader/LoadRequest.cpp
Loader/ProxyMappings.cpp
Loader/Resource.cpp
Loader/ResourceLoader.cpp
MathML/MathMLElement.cpp
MathML/TagNames.cpp
MediaCapabilitiesAPI/MediaCapabilities.cpp
MediaSourceExtensions/BufferedChangeEvent.cpp
MediaSourceExtensions/EventNames.cpp
MediaSourceExtensions/ManagedMediaSource.cpp
MediaSourceExtensions/ManagedSourceBuffer.cpp
MediaSourceExtensions/MediaSource.cpp
MediaSourceExtensions/MediaSourceHandle.cpp
MediaSourceExtensions/SourceBuffer.cpp
MediaSourceExtensions/SourceBufferList.cpp
MimeSniff/MimeType.cpp
MimeSniff/Resource.cpp
MixedContent/AbstractOperations.cpp
2020-10-10 02:48:05 +01:00
Namespace.cpp
NavigationTiming/EntryNames.cpp
NavigationTiming/PerformanceNavigation.cpp
NavigationTiming/PerformanceTiming.cpp
Page/DragAndDropEventHandler.cpp
Page/EventHandler.cpp
Page/InputEvent.cpp
Page/Page.cpp
Painting/AudioPaintable.cpp
Painting/BackgroundPainting.cpp
Painting/BackingStore.cpp
Painting/BorderPainting.cpp
Painting/BorderRadiiData.cpp
Painting/BorderRadiusCornerClipper.cpp
Painting/BordersData.cpp
Painting/BoxModelMetrics.cpp
Painting/CanvasPaintable.cpp
Painting/CheckBoxPaintable.cpp
Painting/ClipFrame.cpp
Painting/ClippableAndScrollable.cpp
Painting/Command.cpp
Painting/DisplayList.cpp
Painting/DisplayListPlayerSkia.cpp
Painting/DisplayListRecorder.cpp
Painting/FieldSetPaintable.cpp
Painting/GradientPainting.cpp
Painting/ImagePaintable.cpp
Painting/LabelablePaintable.cpp
Painting/MarkerPaintable.cpp
Painting/MediaPaintable.cpp
Painting/NavigableContainerViewportPaintable.cpp
Painting/Paintable.cpp
Painting/PaintableBox.cpp
Painting/PaintableFragment.cpp
Painting/PaintContext.cpp
Painting/RadioButtonPaintable.cpp
Painting/ScrollFrame.cpp
Painting/ScrollState.cpp
Painting/ShadowPainting.cpp
Painting/StackingContext.cpp
Painting/SVGClipPaintable.cpp
Painting/SVGForeignObjectPaintable.cpp
Painting/SVGGraphicsPaintable.cpp
Painting/SVGMaskable.cpp
Painting/SVGMaskPaintable.cpp
Painting/SVGPaintable.cpp
Painting/SVGPathPaintable.cpp
Painting/SVGSVGPaintable.cpp
Painting/TableBordersPainting.cpp
Painting/TextPaintable.cpp
Painting/VideoPaintable.cpp
Painting/ViewportPaintable.cpp
PerformanceTimeline/EntryTypes.cpp
2025-02-26 15:51:05 +00:00
PerformanceTimeline/EventNames.cpp
PerformanceTimeline/PerformanceEntry.cpp
2023-08-25 01:26:47 +01:00
PerformanceTimeline/PerformanceObserver.cpp
PerformanceTimeline/PerformanceObserverEntryList.cpp
PermissionsPolicy/AutoplayAllowlist.cpp
PixelUnits.cpp
Platform/AudioCodecPlugin.cpp
Platform/AudioCodecPluginAgnostic.cpp
Platform/EventLoopPlugin.cpp
Platform/EventLoopPluginSerenity.cpp
Platform/FontPlugin.cpp
Platform/ImageCodecPlugin.cpp
Platform/Timer.cpp
Platform/TimerSerenity.cpp
ReferrerPolicy/AbstractOperations.cpp
ReferrerPolicy/ReferrerPolicy.cpp
RequestIdleCallback/IdleDeadline.cpp
ResizeObserver/ResizeObservation.cpp
ResizeObserver/ResizeObserver.cpp
ResizeObserver/ResizeObserverEntry.cpp
ResizeObserver/ResizeObserverSize.cpp
2025-02-26 15:51:05 +00:00
ResourceTiming/PerformanceResourceTiming.cpp
SecureContexts/AbstractOperations.cpp
Selection/Selection.cpp
ServiceWorker/EventNames.cpp
ServiceWorker/Job.cpp
ServiceWorker/Registration.cpp
ServiceWorker/ServiceWorker.cpp
ServiceWorker/ServiceWorkerContainer.cpp
ServiceWorker/ServiceWorkerGlobalScope.cpp
ServiceWorker/ServiceWorkerRecord.cpp
ServiceWorker/ServiceWorkerRegistration.cpp
SRI/SRI.cpp
StorageAPI/NavigatorStorage.cpp
StorageAPI/StorageBottle.cpp
StorageAPI/StorageEndpoint.cpp
StorageAPI/StorageKey.cpp
StorageAPI/StorageManager.cpp
StorageAPI/StorageShed.cpp
StorageAPI/StorageShelf.cpp
Streams/AbstractOperations.cpp
Streams/ByteLengthQueuingStrategy.cpp
Streams/CountQueuingStrategy.cpp
Streams/GenericTransformStream.cpp
Streams/ReadableByteStreamController.cpp
Streams/ReadableStream.cpp
Streams/ReadableStreamAsyncIterator.cpp
Streams/ReadableStreamBYOBReader.cpp
Streams/ReadableStreamBYOBRequest.cpp
Streams/ReadableStreamDefaultController.cpp
Streams/ReadableStreamDefaultReader.cpp
Streams/ReadableStreamGenericReader.cpp
Streams/ReadableStreamOperations.cpp
Streams/ReadableStreamPipeTo.cpp
Streams/ReadableStreamTee.cpp
Streams/Transformer.cpp
Streams/TransformStream.cpp
Streams/TransformStreamDefaultController.cpp
Streams/TransformStreamOperations.cpp
Streams/UnderlyingSink.cpp
Streams/UnderlyingSource.cpp
Streams/WritableStream.cpp
Streams/WritableStreamDefaultController.cpp
Streams/WritableStreamDefaultWriter.cpp
Streams/WritableStreamOperations.cpp
SVG/AttributeNames.cpp
SVG/AttributeParser.cpp
SVG/SVGAElement.cpp
2025-02-21 13:22:15 +01:00
SVG/SVGAnimatedEnumeration.cpp
SVG/SVGAnimatedLength.cpp
SVG/SVGAnimatedNumber.cpp
SVG/SVGAnimatedRect.cpp
2023-11-14 00:18:09 +00:00
SVG/SVGAnimatedString.cpp
SVG/SVGAnimatedTransformList.cpp
SVG/SVGCircleElement.cpp
SVG/SVGClipPathElement.cpp
SVG/SVGDecodedImageData.cpp
SVG/SVGDefsElement.cpp
2024-04-15 18:43:01 +01:00
SVG/SVGDescElement.cpp
SVG/SVGElement.cpp
SVG/SVGEllipseElement.cpp
SVG/SVGFilterElement.cpp
SVG/SVGForeignObjectElement.cpp
SVG/SVGGElement.cpp
SVG/SVGGeometryElement.cpp
SVG/SVGGradientElement.cpp
SVG/SVGGraphicsElement.cpp
SVG/SVGImageElement.cpp
SVG/SVGLength.cpp
SVG/SVGLinearGradientElement.cpp
SVG/SVGLineElement.cpp
SVG/SVGMaskElement.cpp
SVG/SVGMetadataElement.cpp
SVG/SVGPathElement.cpp
SVG/SVGPolygonElement.cpp
SVG/SVGPolylineElement.cpp
SVG/SVGRadialGradientElement.cpp
SVG/SVGRectElement.cpp
SVG/SVGScriptElement.cpp
SVG/SVGStopElement.cpp
SVG/SVGStyleElement.cpp
SVG/SVGSVGElement.cpp
SVG/SVGSymbolElement.cpp
SVG/SVGTextContentElement.cpp
SVG/SVGTextElement.cpp
SVG/SVGTextPathElement.cpp
SVG/SVGTextPositioningElement.cpp
SVG/SVGTitleElement.cpp
2024-03-31 14:41:00 +01:00
SVG/SVGTransform.cpp
2024-03-31 14:54:00 +01:00
SVG/SVGTransformList.cpp
SVG/SVGTSpanElement.cpp
SVG/SVGUseElement.cpp
SVG/TagNames.cpp
SVG/ViewBox.cpp
UIEvents/CompositionEvent.cpp
UIEvents/EventNames.cpp
UIEvents/FocusEvent.cpp
2024-07-18 19:35:14 +01:00
UIEvents/InputEvent.cpp
UIEvents/InputTypes.cpp
UIEvents/KeyboardEvent.cpp
UIEvents/MouseEvent.cpp
UIEvents/PointerEvent.cpp
2024-10-05 14:44:59 +01:00
UIEvents/TextEvent.cpp
UIEvents/UIEvent.cpp
2022-10-17 20:54:01 +03:00
UIEvents/WheelEvent.cpp
URLPattern/URLPattern.cpp
UserTiming/PerformanceMark.cpp
UserTiming/PerformanceMeasure.cpp
WebAssembly/Global.cpp
WebAssembly/Instance.cpp
2023-03-15 19:29:57 -04:00
WebAssembly/Memory.cpp
2023-03-15 14:47:54 -04:00
WebAssembly/Module.cpp
2023-03-15 20:16:22 -04:00
WebAssembly/Table.cpp
WebAssembly/WebAssembly.cpp
WebAudio/AnalyserNode.cpp
WebAudio/AudioBuffer.cpp
2024-07-21 15:24:25 +03:00
WebAudio/AudioBufferSourceNode.cpp
WebAudio/AudioContext.cpp
WebAudio/AudioDestinationNode.cpp
WebAudio/AudioListener.cpp
WebAudio/AudioNode.cpp
WebAudio/AudioParam.cpp
WebAudio/AudioScheduledSourceNode.cpp
WebAudio/BaseAudioContext.cpp
2024-07-21 21:25:14 +03:00
WebAudio/BiquadFilterNode.cpp
WebAudio/ChannelMergerNode.cpp
WebAudio/ChannelSplitterNode.cpp
WebAudio/ConstantSourceNode.cpp
WebAudio/DelayNode.cpp
WebAudio/DynamicsCompressorNode.cpp
WebAudio/GainNode.cpp
WebAudio/MediaElementAudioSourceNode.cpp
WebAudio/OfflineAudioContext.cpp
WebAudio/OscillatorNode.cpp
WebAudio/PannerNode.cpp
WebAudio/PeriodicWave.cpp
WebAudio/StereoPannerNode.cpp
WebDriver/Actions.cpp
WebDriver/Capabilities.cpp
WebDriver/Client.cpp
WebDriver/Contexts.cpp
WebDriver/ElementLocationStrategies.cpp
WebDriver/ElementReference.cpp
WebDriver/Error.cpp
WebDriver/ExecuteScript.cpp
WebDriver/HeapTimer.cpp
WebDriver/InputSource.cpp
WebDriver/InputState.cpp
WebDriver/JSON.cpp
WebDriver/Proxy.cpp
WebDriver/Response.cpp
WebDriver/Screenshot.cpp
WebDriver/TimeoutsConfiguration.cpp
WebDriver/UserPrompt.cpp
WebGL/EventNames.cpp
WebGL/Extensions/ANGLEInstancedArrays.cpp
WebGL/Extensions/EXTBlendMinMax.cpp
WebGL/Extensions/EXTColorBufferFloat.cpp
WebGL/Extensions/OESVertexArrayObject.cpp
WebGL/Extensions/WebGLCompressedTextureS3tc.cpp
WebGL/Extensions/WebGLDrawBuffers.cpp
WebGL/Extensions/WebGLVertexArrayObjectOES.cpp
WebGL/OpenGLContext.cpp
WebGL/WebGL2RenderingContext.cpp
2024-11-13 10:15:42 +01:00
WebGL/WebGLActiveInfo.cpp
2024-11-13 09:35:57 +01:00
WebGL/WebGLBuffer.cpp
WebGL/WebGLContextAttributes.cpp
WebGL/WebGLContextEvent.cpp
2024-11-13 09:46:25 +01:00
WebGL/WebGLFramebuffer.cpp
2024-11-13 09:31:46 +01:00
WebGL/WebGLObject.cpp
2024-11-13 09:59:10 +01:00
WebGL/WebGLProgram.cpp
WebGL/WebGLQuery.cpp
2024-11-13 10:03:53 +01:00
WebGL/WebGLRenderbuffer.cpp
WebGL/WebGLRenderingContext.cpp
WebGL/WebGLSampler.cpp
2024-11-13 10:06:07 +01:00
WebGL/WebGLShader.cpp
2024-11-13 10:18:51 +01:00
WebGL/WebGLShaderPrecisionFormat.cpp
WebGL/WebGLSync.cpp
2024-11-13 10:08:30 +01:00
WebGL/WebGLTexture.cpp
WebGL/WebGLTransformFeedback.cpp
2024-11-13 10:11:08 +01:00
WebGL/WebGLUniformLocation.cpp
WebGL/WebGLVertexArrayObject.cpp
WebIDL/AbstractOperations.cpp
WebIDL/AsyncIterator.cpp
WebIDL/Buffers.cpp
WebIDL/CallbackType.cpp
WebIDL/DOMException.cpp
WebIDL/ObservableArray.cpp
WebIDL/OverloadResolution.cpp
WebIDL/Promise.cpp
WebIDL/Tracing.cpp
WebSockets/WebSocket.cpp
WebVTT/VTTCue.cpp
WebVTT/VTTRegion.cpp
Worker/WebWorkerClient.cpp
XHR/EventNames.cpp
XHR/FormData.cpp
XHR/FormDataIterator.cpp
XHR/ProgressEvent.cpp
XHR/XMLHttpRequest.cpp
XHR/XMLHttpRequestEventTarget.cpp
XHR/XMLHttpRequestUpload.cpp
XLink/AttributeNames.cpp
XML/XMLDocumentBuilder.cpp
)
compile_ipc(Worker/WebWorkerClient.ipc Worker/WebWorkerClientEndpoint.h)
compile_ipc(Worker/WebWorkerServer.ipc Worker/WebWorkerServerEndpoint.h)
invoke_generator(
"AriaRoles.cpp"
Lagom::GenerateAriaRoles
"${CMAKE_CURRENT_SOURCE_DIR}/ARIA/AriaRoles.json"
"ARIA/AriaRoles.h"
"ARIA/AriaRoles.cpp"
arguments -j "${CMAKE_CURRENT_SOURCE_DIR}/ARIA/AriaRoles.json"
)
generate_css_implementation()
LibWeb: Make named character references more spec-compliant & efficient There are two changes happening here: a correctness fix, and an optimization. In theory they are unrelated, but the optimization actually paves the way for the correctness fix. Before this commit, the HTML tokenizer would attempt to look for named character references by checking from after the `&` until the end of m_decoded_input, which meant that it was unable to recognize things like named character references that are inserted via `document.write` one byte at a time. For example, if `&notin;` was written one-byte-at-a-time with `document.write`, then the tokenizer would only check against `n` since that's all that would exist at the time of the check and therefore erroneously conclude that it was an invalid named character reference. This commit modifies the approach taken for named character reference matching by using a trie-like structure (specifically, a deterministic acyclic finite state automaton or DAFSA), which allows for efficiently matching one-character-at-a-time and therefore it is able to pick up matching where it left off after each code point is consumed. Note: Because it's possible for a partial match to not actually develop into a full match (e.g. `&notindo` which could lead to `&notindot;`), some backtracking is performed after-the-fact in order to only consume the code points within the longest match found (e.g. `&notindo` would backtrack back to `&not`). With this new approach, `document.write` being called one-byte-at-a-time is handled correctly, which allows for passing more WPT tests, with the most directly relevant tests being `/html/syntax/parsing/html5lib_entities01.html` and `/html/syntax/parsing/html5lib_entities02.html` when run with `?run_type=write_single`. Additionally, the implementation now better conforms to the language of the spec (and resolves a FIXME) because exactly the matched characters are consumed and nothing more, so SWITCH_TO is able to be used as the spec says instead of RECONSUME_IN. The new approach is also an optimization: - Instead of a linear search using `starts_with`, the usage of a DAFSA means that it is always aware of which characters can lead to a match at any given point, and will bail out whenever a match is no longer possible. - The DAFSA is able to take advantage of the note in the section `13.5 Named character references` that says "This list is static and will not be expanded or changed in the future." and tailor its Node struct accordingly to tightly pack each node's data into 32-bits. Together with the inherent DAFSA property of redundant node deduplication, the amount of data stored for named character reference matching is minimized. In my testing: - A benchmark tokenizing an arbitrary set of HTML test files was about 1.23x faster (2070ms to 1682ms). - A benchmark tokenizing a file with tens of thousands of named character references mixed in with truncated named character references and arbitrary ASCII characters/ampersands runs about 8x faster (758ms to 93ms). - The size of `liblagom-web.so` was reduced by 94.96KiB. Some technical details: A DAFSA (deterministic acyclic finite state automaton) is essentially a trie flattened into an array, but it also uses techniques to minimize redundant nodes. This provides fast lookups while minimizing the required data size, but normally does not allow for associating data related to each word. However, by adding a count of the number of possible words from each node, it becomes possible to also use it to achieve minimal perfect hashing for the set of words (which allows going from word -> unique index as well as unique index -> word). This allows us to store a second array of data so that the DAFSA can be used as a lookup for e.g. the associated code points. For the Swift implementation, the new NamedCharacterReferenceMatcher was used to satisfy the previous API and the tokenizer was left alone otherwise. In the future, the Swift implementation should be updated to use the same implementation for its NamedCharacterReference state as the updated C++ implementation.
2024-12-22 07:09:31 -08:00
generate_html_implementation()
invoke_generator(
"WebGLRenderingContextImpl.cpp"
Lagom::GenerateWebGLRenderingContext
"${CMAKE_CURRENT_SOURCE_DIR}/WebGL/WebGLRenderingContextBase.idl"
"WebGL/WebGLRenderingContextImpl.h"
"WebGL/WebGLRenderingContextImpl.cpp"
arguments -b "${CMAKE_CURRENT_SOURCE_DIR}" -b "${CMAKE_CURRENT_BINARY_DIR}" -i "${CMAKE_CURRENT_SOURCE_DIR}/WebGL/WebGLRenderingContext.idl"
# NOTE: GeneratedCSSStyleProperties.idl is listed because it's transitively included by WebGLRenderingContextBase.idl
# and we need to make sure it's generated before we generate the WebGLRenderingContext implementation.
dependencies WebGL/WebGLRenderingContextBase.idl WebGL/WebGLRenderingContextOverloads.idl CSS/GeneratedCSSStyleProperties.idl
)
invoke_generator(
"WebGL2RenderingContextImpl.cpp"
Lagom::GenerateWebGLRenderingContext
"${CMAKE_CURRENT_SOURCE_DIR}/WebGL/WebGL2RenderingContextBase.idl"
"WebGL/WebGL2RenderingContextImpl.h"
"WebGL/WebGL2RenderingContextImpl.cpp"
arguments -b "${CMAKE_CURRENT_SOURCE_DIR}" -b "${CMAKE_CURRENT_BINARY_DIR}" -i "${CMAKE_CURRENT_SOURCE_DIR}/WebGL/WebGL2RenderingContext.idl"
# NOTE: GeneratedCSSStyleProperties.idl is listed because it's transitively included by WebGLRenderingContextBase.idl
# and we need to make sure it's generated before we generate the WebGLRenderingContext implementation.
dependencies WebGL/WebGL2RenderingContextBase.idl WebGL/WebGL2RenderingContextOverloads.idl WebGL/WebGLRenderingContextBase.idl WebGL/WebGLRenderingContextOverloads.idl CSS/GeneratedCSSStyleProperties.idl
)
set(GENERATED_SOURCES
ARIA/AriaRoles.cpp
CSS/DefaultStyleSheetSource.cpp
CSS/DescriptorID.cpp
CSS/Enums.cpp
CSS/GeneratedCSSStyleProperties.cpp
CSS/GeneratedCSSStyleProperties.idl
CSS/Keyword.cpp
CSS/MathFunctions.cpp
CSS/MediaFeatureID.cpp
CSS/PropertyID.cpp
CSS/PseudoClass.cpp
CSS/PseudoElement.cpp
CSS/QuirksModeStyleSheetSource.cpp
CSS/TransformFunctions.cpp
MathML/MathMLStyleSheetSource.cpp
SVG/SVGStyleSheetSource.cpp
WebGL/WebGL2RenderingContextImpl.cpp
WebGL/WebGLRenderingContextImpl.cpp
Worker/WebWorkerClientEndpoint.h
Worker/WebWorkerServerEndpoint.h
LibWeb: Make named character references more spec-compliant & efficient There are two changes happening here: a correctness fix, and an optimization. In theory they are unrelated, but the optimization actually paves the way for the correctness fix. Before this commit, the HTML tokenizer would attempt to look for named character references by checking from after the `&` until the end of m_decoded_input, which meant that it was unable to recognize things like named character references that are inserted via `document.write` one byte at a time. For example, if `&notin;` was written one-byte-at-a-time with `document.write`, then the tokenizer would only check against `n` since that's all that would exist at the time of the check and therefore erroneously conclude that it was an invalid named character reference. This commit modifies the approach taken for named character reference matching by using a trie-like structure (specifically, a deterministic acyclic finite state automaton or DAFSA), which allows for efficiently matching one-character-at-a-time and therefore it is able to pick up matching where it left off after each code point is consumed. Note: Because it's possible for a partial match to not actually develop into a full match (e.g. `&notindo` which could lead to `&notindot;`), some backtracking is performed after-the-fact in order to only consume the code points within the longest match found (e.g. `&notindo` would backtrack back to `&not`). With this new approach, `document.write` being called one-byte-at-a-time is handled correctly, which allows for passing more WPT tests, with the most directly relevant tests being `/html/syntax/parsing/html5lib_entities01.html` and `/html/syntax/parsing/html5lib_entities02.html` when run with `?run_type=write_single`. Additionally, the implementation now better conforms to the language of the spec (and resolves a FIXME) because exactly the matched characters are consumed and nothing more, so SWITCH_TO is able to be used as the spec says instead of RECONSUME_IN. The new approach is also an optimization: - Instead of a linear search using `starts_with`, the usage of a DAFSA means that it is always aware of which characters can lead to a match at any given point, and will bail out whenever a match is no longer possible. - The DAFSA is able to take advantage of the note in the section `13.5 Named character references` that says "This list is static and will not be expanded or changed in the future." and tailor its Node struct accordingly to tightly pack each node's data into 32-bits. Together with the inherent DAFSA property of redundant node deduplication, the amount of data stored for named character reference matching is minimized. In my testing: - A benchmark tokenizing an arbitrary set of HTML test files was about 1.23x faster (2070ms to 1682ms). - A benchmark tokenizing a file with tens of thousands of named character references mixed in with truncated named character references and arbitrary ASCII characters/ampersands runs about 8x faster (758ms to 93ms). - The size of `liblagom-web.so` was reduced by 94.96KiB. Some technical details: A DAFSA (deterministic acyclic finite state automaton) is essentially a trie flattened into an array, but it also uses techniques to minimize redundant nodes. This provides fast lookups while minimizing the required data size, but normally does not allow for associating data related to each word. However, by adding a count of the number of possible words from each node, it becomes possible to also use it to achieve minimal perfect hashing for the set of words (which allows going from word -> unique index as well as unique index -> word). This allows us to store a second array of data so that the DAFSA can be used as a lookup for e.g. the associated code points. For the Swift implementation, the new NamedCharacterReferenceMatcher was used to satisfy the previous API and the tokenizer was left alone otherwise. In the future, the Swift implementation should be updated to use the same implementation for its NamedCharacterReference state as the updated C++ implementation.
2024-12-22 07:09:31 -08:00
HTML/Parser/NamedCharacterReferences.cpp
)
serenity_lib(LibWeb web)
target_link_libraries(LibWeb PRIVATE LibCore LibCompress LibCrypto LibJS LibHTTP LibGfx LibIPC LibRegex LibSyntax LibTextCodec LibUnicode LibMedia LibWasm LibXML LibIDL LibURL LibTLS LibRequests LibGC LibThreading skia)
if (APPLE)
target_link_libraries(LibWeb PRIVATE unofficial::angle::libEGL unofficial::angle::libGLESv2)
endif()
# FIXME: https://github.com/microsoft/vcpkg/issues/42324
target_include_directories(LibWeb PRIVATE ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include)
generate_js_bindings(LibWeb)
if (ENABLE_SWIFT)
include(collections)
set(generated_headers ${GENERATED_SOURCES})
list(FILTER generated_headers INCLUDE REGEX "\\.h$")
list(TRANSFORM generated_headers PREPEND "${CMAKE_CURRENT_BINARY_DIR}/")
list(APPEND LIBWEB_ALL_GENERATED_HEADERS ${generated_headers})
generate_clang_module_map(LibWeb GENERATED_FILES ${LIBWEB_ALL_GENERATED_HEADERS})
target_sources(LibWeb PRIVATE
HTML/Parser/HTMLToken.swift
HTML/Parser/HTMLTokenizer.swift
HTML/Parser/HTMLTokenizerHelpers.cpp
HTML/Parser/SpeculativeHTMLParser.swift
)
target_link_libraries(LibWeb PRIVATE AK Collections)
add_swift_target_properties(LibWeb LAGOM_LIBRARIES AK LibGfx LibGC)
endif()