Commit Graph

27543 Commits

Author SHA1 Message Date
Luke Wilde
f62477c093 LibWeb: Implement HTML fragment serialisation and use it in innerHTML
The previous implementation was about a half implementation and was
tied to Element::innerHTML. This separates it and puts it into
HTMLDocumentParser, as this is in the parsing section of the spec.

This provides a near finished HTML fragment serialisation algorithm,
bar namespaces in attributes and the `is` value.
2021-09-14 02:09:18 +02:00
Idan Horowitz
ed5128d759 LibWeb: Add the URL::{protocol, pathname, search, hash} attributes 2021-09-14 00:14:45 +02:00
Idan Horowitz
7f9818bcbc LibWeb: Add the URL::host, URL::hostname & URL:port attributes 2021-09-14 00:14:45 +02:00
Idan Horowitz
e89320887e LibWeb: Add the URL::username, URL::password & URL::origin attributes 2021-09-14 00:14:45 +02:00
Idan Horowitz
fe32c9c3bd LibWeb: Add the URL::searchParams attribute 2021-09-14 00:14:45 +02:00
Idan Horowitz
1841fbd3e4 LibWeb: Add the URL::href attribute and URL::to_json method 2021-09-14 00:14:45 +02:00
Idan Horowitz
e6abc1b44e LibWeb: Add a bare implementation of the URL built-in
This only has the constructor implemented for now.
2021-09-14 00:14:45 +02:00
Idan Horowitz
30849b10d5 AK: Move the path argument of URL::append_path instead of copying it 2021-09-14 00:14:45 +02:00
Idan Horowitz
d6cfa34667 AK: Make URL::m_port an Optional<u16>, Expose raw port getter
Our current way of signalling a missing port with m_port == 0 was
lacking, as 0 is a valid port number in URLs.
2021-09-14 00:14:45 +02:00
Idan Horowitz
1c9c43785d AK: Add URL::cannot_have_a_username_or_password_or_port
As defined by the URL specification:
https://url.spec.whatwg.org/#cannot-have-a-username-password-port
2021-09-14 00:14:45 +02:00
Idan Horowitz
929af64a67 AK: Change URL::cannot_be_a_base_url, URL::is_valid return type to bool
There's no need to return a const reference (8 bytes) when the value is
always used as a temporary bool (1 byte).
2021-09-14 00:14:45 +02:00
Idan Horowitz
55b67ba7a7 AK: Accept optional url and state override parameters in URLParser
These are required in the specification and used by the web's URL
built-in, this commit also removes the Badge<AK::URL> from URLParser
to allow other classes that need to call the parser directly like the
web's URL built-in to do so.
2021-09-14 00:14:45 +02:00
Idan Horowitz
6fa4fc8353 AK: Add URL::serialize_origin based on HTML's origin definition 2021-09-14 00:14:45 +02:00
Idan Horowitz
af5b62d8cd LibWeb: Move url_{encode, decode} to URL/URLSearchParams.{h, cpp}
The new URL built-in that will reside in URL.{h, cpp} will have an
URLSearchParams member, which means it has to include its header, and
as such URLSearchParams.h can't include URL's header, which it needs as
it uses the url_{encode, decode} functions.
2021-09-14 00:14:45 +02:00
Idan Horowitz
23997005cf LibWeb: Allow IDL attribute setters to throw DOMExceptions 2021-09-14 00:14:45 +02:00
Idan Horowitz
f9a169380c LibWeb: Consume the extra whitespace in stringifier attributes 2021-09-14 00:14:45 +02:00
Mustafa Quraish
0f749681a9 Everywhere: Use my fancy new serenityos.org email :^) 2021-09-13 20:51:50 +00:00
Andreas Kling
268b36e2d1 Meta: Add Mustafa Quraish to the contributors list :^) 2021-09-13 22:21:57 +02:00
Andreas Kling
bf86419979 LibWeb: Use ComputedCSSStyleDeclaration to generate data for inspector 2021-09-13 22:21:57 +02:00
Andreas Kling
2e4b34b8c3 LibWeb: Generate CSS::{first,last}_property_id constants
These will allow us to iterate through all known CSS properties.
2021-09-13 22:21:57 +02:00
Andreas Kling
3ca2e701e6 LibJS: Log scripts parsed by JS::Script::parse() and how long it took 2021-09-13 22:21:57 +02:00
Andreas Kling
7f71f54fc3 Browser: Rename "DOM Inspector" to just "Inspector"
It inspects more than the DOM, after all. :^)
2021-09-13 22:21:57 +02:00
Tobias Christiansen
416559414c LibWeb: Use right dimension when positioning flex-items
Previously the cross-size was used to determine the position along the
main axis which is obviously wrong.
2021-09-13 21:20:35 +01:00
Linus Groh
8cd4a889fe LibWeb: Stop dumping selectors in ParentNode::query_selector{,_all}()
This isn't particularly useful (anymore), especially without any context
about _why_ this output suddenly appears in the debug console.
2021-09-13 21:16:33 +01:00
Mustafa Quraish
f28b2a875a PixelPaint: Make CloneTool change cursor temporarily while selecting
This just provides some nice visual feedback when you are in the
middle of selecting a color. An eyedropper might not be the ideal
choice here, but among the cursors we already have it is the
best one.
2021-09-13 22:13:22 +02:00
Mustafa Quraish
11263beaca PixelPaint: Add ImageEditor::update_tool_cursor() method
This just allows us to ask the image editor to update the tool's
current cursor. This is useful in cases where a tool may want to
change it's cursor for some operation, and wants to invalidate the
active cursor cached in the ImageEditor.
2021-09-13 22:13:22 +02:00
Mustafa Quraish
0472063b96 PixelPaint: Add a marker for CloneTool's selected position
Now we add a little marker to show the current sample position of
the CloneTool. The current implementation for updating the cursor
location is really dumb since it just updates the whole editor,
but that's a yak on the stack to fix.
2021-09-13 22:13:22 +02:00
Mustafa Quraish
fafbe417d1 PixelPaint: Incorporate CloneTool into toolbox 2021-09-13 22:13:22 +02:00
Mustafa Quraish
22b78226b3 PixelPaint: Add Clone Tool :^)
There's still a lot to be desired in terms of functionality and
usability, but this is a start. When using the clone tool, you
can press Alt to sample a location, and then the brush will clone
the color from there.
2021-09-13 22:13:22 +02:00
Mustafa Quraish
1dcf2f9d94 Base: Add new icon for PixelPaint clone tool 2021-09-13 22:13:22 +02:00
Linus Groh
35cc579264 LibJS: Also set ExecutionContext::realm in Bytecode::Interpreter::run()
I forgot to consider the bytecode Interpreter when adding a Realm to the
ExecutionContext. This should make it a lot less crashy again :^)
2021-09-13 21:06:18 +01:00
Tobias Christiansen
1d47ec380f LibWeb: FlexBox: Use correct source when querying for the main size
This was an error in understanding what calculated_values are and that
those are not what is wanted when getting the main available size of the
box in the FlexFormattingContext.
The calculation around the size calculation is still a bit wonky, but
this is definietly better.
2021-09-13 21:37:16 +02:00
Tobias Christiansen
4c1da4d43a LibWeb: Fix opacity ComputedCSSStyleDeclaration
There was a classic copy&paste error, opacity wasn't getting the right
computed value to convert.
2021-09-13 21:26:31 +02:00
Mohsan Ali
102d345a8f ImageViewer: Enable and disable navigation
Before there was dialogs to indicate if
current file is last or first.

So in this commit, I added functionality to enable
and disable forward and backward navigation based
on if the next file is avialable or not and if the
pervious file is avialable or not, respectively.

ImageViewer: Refactor code and init data

Data intialization was not happening properly, now I did
Initializations properly so that navigation can work from
the very first image.
2021-09-13 23:46:16 +04:30
Tobias Christiansen
f160fe0407 LibWeb: Add support for a bunch of ComputedCSSStyleDeclarations
This patch adds support for a whole lot of other more easy
ComputedCSSStyleDeclararions.
2021-09-13 20:31:06 +02:00
James Puleo
ae6862cb2d AK: Remove unimplemented method fill_buffer from UUID 2021-09-13 20:19:34 +02:00
Andreas Kling
daead75e9c LibGfx/TTF: Ignore unsupported composite glyph flags
Replace some program-stopping TODO()'s with FIXME comments, since many
fonts actually render mostly fine without support for all features.
2021-09-13 20:12:58 +02:00
Linus Groh
7c39a5860d LibJS: Convert Temporal.ZonedDateTime.prototype to be a PrototypeObject 2021-09-13 19:07:26 +01:00
Linus Groh
297bf19508 LibJS: Convert Temporal.TimeZone.prototype to be a PrototypeObject 2021-09-13 19:07:26 +01:00
Linus Groh
fdd26567c1 LibJS: Convert Temporal.PlainYearMonth.prototype to be a PrototypeObject 2021-09-13 19:07:26 +01:00
Linus Groh
06f3defcf5 LibJS: Convert Temporal.PlainTime.prototype to be a PrototypeObject 2021-09-13 19:07:26 +01:00
Linus Groh
6e5d6060fa LibJS: Convert Temporal.PlainMonthDay.prototype to be a PrototypeObject 2021-09-13 19:07:26 +01:00
Linus Groh
c47c660477 LibJS: Convert Temporal.PlainDateTime.prototype to be a PrototypeObject 2021-09-13 19:07:26 +01:00
Linus Groh
0a30705cf2 LibJS: Convert Temporal.PlainDate.prototype to be a PrototypeObject 2021-09-13 19:07:26 +01:00
Linus Groh
7314d05ca7 LibJS: Convert Temporal.Instant.prototype to be a PrototypeObject 2021-09-13 19:07:26 +01:00
Linus Groh
a5f559f38a LibJS: Convert Temporal.Duration.prototype to be a PrototypeObject 2021-09-13 19:07:26 +01:00
Linus Groh
47bbdd157f LibJS: Convert Temporal.Calendar.prototype to be a PrototypeObject 2021-09-13 19:07:26 +01:00
Linus Groh
8253e14818 LibJS: Convert Intl.NumberFormat.prototype to be a PrototypeObject 2021-09-13 19:07:26 +01:00
Linus Groh
b0c1179ff8 LibJS: Convert Intl.Locale.prototype to be a PrototypeObject 2021-09-13 19:07:26 +01:00
Linus Groh
c277658ca6 LibJS: Convert Intl.ListFormat.prototype to be a PrototypeObject 2021-09-13 19:07:26 +01:00