Commit graph

34851 commits

Author SHA1 Message Date
Itamar
af132fdbd1 Userland: Rename WindowManagerServerConnection
Rename WindowManagerServerConnection=>ConnectionToWindowManagerServer.

This was done with CLion's automatic rename feature.
2022-02-25 22:35:12 +01:00
Itamar
d88da82e28 Userland: Rename IPC::ServerConnection=>IPC::ConnectionToServer
This was done with CLion's automatic rename feature.
2022-02-25 22:35:12 +01:00
Itamar
3a71748e5d Userland: Rename IPC ClientConnection => ConnectionFromClient
This was done with CLion's automatic rename feature and with:
find . -name ClientConnection.h
    | rename 's/ClientConnection\.h/ConnectionFromClient.h/'

find . -name ClientConnection.cpp
    | rename 's/ClientConnection\.cpp/ConnectionFromClient.cpp/'
2022-02-25 22:35:12 +01:00
Andreas Kling
efac862570 LibWeb: Parse <style> element text content when inserted into document
1% progression on ACID3. :^)
2022-02-25 22:05:42 +01:00
Andreas Kling
fb11741f20 LibWeb: Use the prefix passed to Document.createElementNS()
1% progression on ACID3. :^)
2022-02-25 21:29:12 +01:00
Andreas Kling
fa17776a51 LibWeb: Support HTMLFormElement.elements and HTMLFormElement.length
Note that we implement .elements as a HTMLCollection for now, instead of
the correct HTMLFormControlsCollection subclass. This covers most
use-cases already.

1% progression on ACID3. :^)
2022-02-25 21:19:06 +01:00
Andreas Kling
fbee0490a3 LibWeb: Improve HTMLElement.click()
This API now follows the spec a bit more closely, with regards to the
event being dispatched. There are still FIXME's but this is already an
improvement.

2% progression on ACID3. :^)
2022-02-25 20:45:19 +01:00
Andreas Kling
c25d653c31 LibWeb: Implement Range.commonAncestorContainer 2022-02-25 20:45:03 +01:00
Andreas Kling
aec0e54f73 LibWeb: Expose Range.collapsed to JavaScript 2022-02-25 20:20:31 +01:00
Andreas Kling
f2663f477f AK: Ignore whitespace while decoding base64
This matches how other implementations behave.

1% progression on ACID3. :^)
2022-02-25 19:54:13 +01:00
Andreas Kling
17f34488f6 LibWeb: Implement HTMLImageElement.width and HTMLImageElement.height 2022-02-25 19:38:31 +01:00
Andreas Kling
b023308f5c LibWeb: Notify parent when DOM::CharacterData content changes
This makes <style> elements reparse the CSS when their text child is
programmatically changed.
2022-02-25 19:38:31 +01:00
Andreas Kling
d0ab546d7a LibWeb: Implement UIEvent.initUIEvent()
1% progression on ACID3. :^)
2022-02-25 19:38:31 +01:00
Andreas Kling
093e66afc0 LibWeb: Make document.createEvent("UIEvent") actually create a UIEvent
There were two things preventing this from working right:

- UIEvents::UIEvent::create() was actually just DOM::Event::create()
- We didn't return the right JavaScript wrapper type for UIEvent
2022-02-25 19:38:31 +01:00
Andreas Kling
31508b2788 LibWeb: Make CSS :empty selector match empty text nodes as well
Previously we were only matching elements with *no* text children.
With this patch, we now also allow any number of empty text children to
be present as well.

1% progression on ACID3. :^)
2022-02-25 19:38:31 +01:00
Andreas Kling
29144f9238 LibWeb: Allow all ASCII whitespace chars between element class names
1% progression on ACID3. :^)
2022-02-25 19:38:31 +01:00
Andreas Kling
dd7eb3d6d8 AK: Add String::split_view(Function<bool(char)>)
This allows you to split around a custom separator, and enables
expressive code like this:

    string.split_view(is_ascii_space);
2022-02-25 19:38:31 +01:00
Andreas Kling
7ed6549c8b LibWeb: Fix off-by-one in calculation of available space for line boxes
The rightmost edge of the available space ends exactly at the leftmost
right-side floating box, not one pixel away from it.
2022-02-25 19:38:31 +01:00
Andreas Kling
a5c2ab69ec LibWeb: Look for nearest available size when using bitmap fonts
Use the new Gfx::Font::AllowInexactSizeMatch parameter when doing CSS
font lookups. This fixes a long-standing issue where text with e.g text
with "font-size:12px" would be larger than "font-size:13px" since there
was an exact match for 12, but none for 13 (so we'd fall back to 10).
2022-02-25 19:38:31 +01:00
Andreas Kling
4dd9e2df78 LibGfx: Add Font::AllowInexactSizeMatch parameter to font lookup
This allows bitmap font lookup to return the best matching size instead
of failing completely. The previous behavior (exact matches only)
remains the default.
2022-02-25 19:38:31 +01:00
Andreas Kling
95715f0c8f LibWeb: Fix rounding errors in calculation of final line box width
Instead of re-measuring the distance between the left and right edges of
a line box, we now simply adjust the final width based on how much the
rightmost fragment moved during the alignment process.
2022-02-25 19:38:31 +01:00
thankyouverycool
f457e43885 Assistant+CommandPalette: Use FrameShape::Window for main widgets 2022-02-25 19:38:23 +01:00
thankyouverycool
e1a72c6df8 Taskbar: Update ClockWidget FrameShape and adjust dimensions
Uses the new Window FrameShape. Fixes some erroneously elided text
and incorrect calendar window placement.
2022-02-25 19:38:23 +01:00
thankyouverycool
10afd5a721 Applets: Update Audio applet FrameShape and adjust dimensions
Uses the new Window FrameShape. Fixes margins for erroneously
elided CheckBoxes. Demystifies the numbers used to calculate the
slider window rect.
2022-02-25 19:38:23 +01:00
thankyouverycool
bb4963a697 LibGfx+LibGUI: Add FrameShape::Window
This shape is for use by the main widget of a frameless window
that still wishes to have proper borders but no title.

Raised Containers were used previously for this pattern but did not
always represent perspective and shadow correctly depending on thread
highlighting and the immediate background color. Containers are
really meant to be used inside other widgets where the background
color can be controlled.
2022-02-25 19:38:23 +01:00
thankyouverycool
7a7e57ced0 LibGfx+LibGUI: Remove {Horizontal,Vertical}Line FrameShapes
These were added 3 years ago but never used. Their intended purpose
was probably superceded by the Separator widget.
2022-02-25 19:38:23 +01:00
Sam Atkins
f3cda3c830 LibWeb: Add a rule-cache for PseudoElements
This works a little differently from the other caches - ALL rules
containing a pseudo-element are in this bucket. This lets us only look
at this bucket when finding styles for a pseudo-element, and ignore it
if we're not.
2022-02-25 19:35:34 +01:00
Sam Atkins
817cd13d59 LibWeb: Implement the ::marker pseudo-element
This matches the marker boxes of list-items.
2022-02-25 19:35:34 +01:00
Sam Atkins
8411ff3f14 fixup! Base: Add a pseudo-element test page 2022-02-25 19:35:34 +01:00
Sam Atkins
5113128bc9 LibWeb: Paint InlineNode overlay in correct phase, skip pseudo-elements
We were painting this in the Foreground phase by mistake. Also, the
`inspected_node() == dom_node()` check returns true for pseudo-elements
(both values are nullptr) so I've added an extra check there. As noted,
once pseudo-elements are inspectable we will need to revisit this.
2022-02-25 19:35:34 +01:00
Sam Atkins
b76ee0e30d LibWeb: Account for all simple-selectors when calculating specificity
This fixes the Acid2 blue nose when hovering. :^)
2022-02-25 19:35:34 +01:00
Sam Atkins
ab2c47542d LibWeb: Create layout nodes for ::before and ::after pseudo-elements :^)
For now, we only handle their `content` being text, but it's a start!
2022-02-25 19:35:34 +01:00
Sam Atkins
1de0ca3286 LibWeb: Compute value for content property 2022-02-25 19:35:34 +01:00
Sam Atkins
7eb7396f8b LibWeb: Match styles for pseudo-elements
Since each selector can only have zero or one pseudo-element, we match
against it as a separate step, before matching the rest of the
selector. This should be faster, but mostly I did this because I could
not figure out how else to stop selectors without a pseudo-element from
matching the pseudo-element, eg so `.foo` styles don't affect
`.foo::before`.
2022-02-25 19:35:34 +01:00
Sam Atkins
caef4ec157 LibWeb: Move PseudoElement enum up a level
This in preparation for changing how we store these, plus it's unwieldy
having to type CSS::Selector::SimpleSelector::PseudoElement.
2022-02-25 19:35:34 +01:00
Sam Atkins
5390e05851 LibWeb: Extract code for creating a Layout::Node based on display type
We need to run the same logic for creating the ::before and ::after
pseudo-elements, so this saves us from duplicating the code.
2022-02-25 19:35:34 +01:00
Sam Atkins
7bb721bea2 LibWeb: Make display: foo box constructors take the Element by pointer
This means we can instantiate them for pseudo-elements, which don't have
an associated Element. They all pass it to their parent as a
`Layout::Node*` and handle a lack of `layout_node()` already so this
won't affect any functionality.
2022-02-25 19:35:34 +01:00
Sam Atkins
adaab23149 LibWeb: Parse the content property
For now, we only understand `none`, `normal`, `<image>` and `<string>`.
The various other functions and identifiers can be added later.

We can *almost* use a StyleValueList for this, except it's divided into
two parts - the content, and the optional "alt text". So, I've added a
new StyleValue for it.
2022-02-25 19:35:34 +01:00
Sam Atkins
a9ad72cc0f Base: Add a pseudo-element test page 2022-02-25 19:35:34 +01:00
networkException
692757c489 Base: Use "Library Functions" instead of "Libraries" for man section 3 2022-02-25 12:06:31 -05:00
networkException
9279dd783b Everywhere: Use title case for man section titles
In addition to the section headings on man.serenityos.org,
all occurances of man section titles are now formatted in title case.
2022-02-25 12:06:31 -05:00
Linus Groh
967300e1e3 Meta: Title case 'File Formats' on man.serenityos.org 2022-02-24 23:04:22 +00:00
networkException
156e8a80c7 Meta: Use correct man page title for section 5 on man.serenityos.org 2022-02-24 22:49:03 +00:00
Karol Kosek
4cab5bbead Base: Make U+0126, U+0132, U+0152 and U+0153 wider in Katica Regular 10 2022-02-24 22:26:17 +00:00
Karol Kosek
906e7aebe4 Base: Add Latin Extended-A to font Katica Regular 12
0100-017E: https://www.unicode.org/charts/PDF/U0100.pdf
2022-02-24 22:26:17 +00:00
Jan Grau
9311b685fe Taskbar: Minimize/activate window on Super+Digit event
Handle the SuperDigitKeyPressed event in the taskbar. Toggle the
respective taskbar button.
2022-02-24 18:57:20 +00:00
Jan Grau
6992a07afc LibGUI+WindowServer: Add new WMEvent Super+Digit
This adds a keyboard event for Super+0 to Super+9. Later to be consumed
in the taskbar.

Currently only this keyboard sequence is supported:
  - Super key down
  - Digit key down

But not this:
  - Super key down
  - Digit key down
  - Digit key up
  - Digit key down
2022-02-24 18:57:20 +00:00
Andreas Kling
001b08dec9 LibGUI: Put TextEditor widgets in "Wrap at Words" mode by default 2022-02-24 19:40:26 +01:00
thankyouverycool
29504ae5b6 HackStudio: Adjust heights for Locator and Find widgets
These were two pixels too small and, in Locator's case, blurring
the boundary with Statusbar.
2022-02-24 19:09:41 +01:00
thankyouverycool
77c4b20157 HackStudio: Segment the status bar and setup override text 2022-02-24 19:09:41 +01:00