summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Selection/Selection.h
AgeCommit message (Collapse)Author
2023-02-22LibWeb: Make factory method of Selection::Selection fallibleKenneth Myhra
2023-01-29LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errorsTimothy Flynn
Note that as of this commit, there aren't any such throwers, and the call site in Heap::allocate will drop exceptions on the floor. This commit only serves to change the declaration of the overrides, make sure they return an empty value, and to propagate OOM errors frm their base initialize invocations.
2023-01-12LibWeb: Use DOM Selection instead of ad-hoc layout tree selectionAndreas Kling
Before this patch, we were expressing the current selection as a range between two points in the layout tree. This was a made-up concept I called LayoutRange (2x LayoutPosition) and as it turns out, we don't actually need it! Instead, we can just use the Selection API from the Selection API spec. This API expresses selection in terms of the DOM, and we already had many of the building blocks implemented. To ensure that selections get visually updated when the underlying Range of an active Selection is programmatically manipulated, Range now has an "associated Selection". If a range is updated while associated with a selection, we recompute layout tree selection states and repaint the page to make it user-visible.
2023-01-12LibWeb: Add convenient Selection::range() accessorAndreas Kling
This is a lot smoother than calling the throwsy get_range_at() API, especially since we know there at most 1 range in the selection.
2023-01-10LibWeb: Move setting of Web object prototypes to initialize()Timothy Flynn
This needs to happen before prototype/constructor intitialization can be made lazy. Otherwise, GC could run during the C++ constructor and try to collect the object currently being created.
2022-12-10LibWeb: Implement Selection.collapse_to_endRafał Babiarz
2022-12-10LibWeb: Implement Selection.collapse_to_startRafał Babiarz
2022-12-10LibWeb: Implement Selection.collapseRafał Babiarz
2022-12-10LibWeb: Implement Selection.setBaseAndExtentLuke Wilde
2022-12-06Everywhere: Rename to_{string => deprecated_string}() where applicableLinus Groh
This will make it easier to support both string types at the same time while we convert code, and tracking down remaining uses. One big exception is Value::to_string() in LibJS, where the name is dictated by the ToString AO.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-10-11LibWeb: Implement a large chunk of the Selection APIAndreas Kling
This patch implements enough of the Selection API specification that we stop hitting unimplemented functions when loading Twitter.
2022-10-01LibWeb: Remove unecessary dependence on Window from assorted classesAndrew Kaster
These classes only needed Window to get at its realm. Pass a realm directly to construct Crypto, Encoding, HRT, IntersectionObserver, NavigationTiming, Page, RequestIdleCallback, Selection, Streams, URL, and XML classes.
2022-09-21LibWeb: Remove WRAPPER_HACK() macroLinus Groh
We no longer access Bindings::FooWrapper anywhere for a Foo platform object, so these can be removed :^)
2022-09-06LibWeb: Make Selection GC-allocatedAndreas Kling
2022-09-06LibWeb: Make AbstractRange and subclasses GC-allocatedAndreas Kling
2021-10-11LibWeb: Stub out a basic Selection interfaceAndreas Kling
This patch establishes scaffolding for the Selection API.