Commit graph

36113 commits

Author SHA1 Message Date
Hendiadyoin1
820e03e8d4 AK: Add a case insensitive of is_one_of to String[View] 2022-03-21 10:48:17 +01:00
Simon Wanner
e154c2c2ca LibWeb: Implement "has element in select scope" per-spec
The HTML Specification is quite tricky in this case.
Usually "have a particular element in <x> scope" mentions
"consisting of the following element types:", but in this case it's
"consisting of all element types except the following:"

Thanks to @AtkinsSJ for spotting this difference
2022-03-21 10:47:46 +01:00
Simon Wanner
1d55437a76 LibWeb: Ignore invalid encodings in Content-Type headers 2022-03-21 10:47:46 +01:00
Nico Weber
681fac07ed Meta: Always disable kvm on aarch64 hosts for now
run.sh builds i686 by default, and the aarch64 port of serenity
isn't very far along yet.

Without this change, `run.sh` without arguments unceremoniously
fails with:

    [0/1] cd .../serenity/Build/i686 && /usr...
          ENITY_ARCH=i686 /home/thakis/src/serenity/Meta/run.sh
    qemu-system-i386: invalid accelerator kvm

That's because /dev/kvm exists, but that's no good on a non-intel host.
2022-03-20 19:53:47 -07:00
Nico Weber
20c6dabaff Lagom: Build with -fsigned-char
When building on an arm host system, char defaults to unsigned,
leading to errors such as:

  serenity/AK/StringBuilder.cpp:198:20:
    error: comparison is always true due to limited range of data type
           [-Werror=type-limits]
    198 |             if (ch >= 0 && ch <= 0x1f)
        |

Building with -fsigned-char makes things work like on Intel, and
it's what we already do in Kernel/CMakeLists.txt for the same reasons.
2022-03-20 19:53:47 -07:00
Simon Wanner
917d06fa30 LibGfx: Clamp coordinates for bilinear blending correctly
Clamp these coordinates based on the src_rect's top/right/bottom/left
instead of assuming src_rect is positioned at 0,0
2022-03-21 01:48:21 +01:00
Andreas Kling
8f1a3f7878 LibWeb: Tweak our User-Agent string
- Switch from "Mozilla/4.0" to "Mozilla/5.0" to match other browsers.
- Remove references to KHTML and Gecko.
- Identify ourselves as "LibWeb+LibJS/1.0 Browser/1.0"

New UA: "Mozilla/5.0 (SerenityOS; x86_64) LibWeb+LibJS/1.0 Browser/1.0"
2022-03-20 23:16:22 +01:00
Brian Gianforcaro
97f622747b Everywhere: Move commonmark.spec.json to /home/anon/Tests 2022-03-20 22:20:59 +01:00
Brian Gianforcaro
95b295971d Everywhere: Move tests to /home/anon/Tests 2022-03-20 22:20:59 +01:00
Brian Gianforcaro
16bee0ba79 Everywhere: Move js/web/wasm tests under /home/anon/Tests 2022-03-20 22:20:59 +01:00
Brian Gianforcaro
67fc81a65a Everywhere: Move cpp-tests under /home/anon/Tests 2022-03-20 22:20:59 +01:00
Andreas Kling
d7492927e9 LibWeb: Avoid some layouts in getComputedStyle() property getter
For CSS properties that are known to not affect layout, we can avoid
doing a layout before returning their current resolved value.

It should be enough to only update style for the target element here,
but we don't currently have a mechanism for that.
2022-03-20 22:07:59 +01:00
Brian Gianforcaro
0998074230 LIbVT: Fix copy paste regression I introduced in #13102
I accidentally inverted this behavior in commit 2042d90997

Previously it read:
```cpp
constexpr bool is_untouched() const { return !(flags & Touched); }
```
2022-03-20 21:50:58 +01:00
thankyouverycool
b8cc18896f LibGUI+FontEditor: Add context menu for editor actions
GlyphMapWidget now reports context menu requests when secondary
clicking the map. This also adds a new Select All action and updates
the Copy Character action to work on multi-glyph selections. Glyph
navigation actions have been moved to a separate Go menu, as is
common in other apps.
2022-03-20 20:00:25 +01:00
thankyouverycool
42284a1550 FontEditor: Change flip action shortcuts to Ctrl+Shift+{Q,W}
To not interfere with the command palette.
2022-03-20 20:00:25 +01:00
thankyouverycool
cdd1bc64f6 FontEditor: Set width on copy only if source glyph is present
Fixes empty glyphs copying as present in fixed-width fonts.
2022-03-20 20:00:25 +01:00
thankyouverycool
212817ea20 FontEditor: Restore selections on undo/redo actions
This makes navigating undo history a lot easier to follow.
Individual glyph alterations now reset selection size if necessary
to save space.
2022-03-20 20:00:25 +01:00
thankyouverycool
df443863bd LibGUI: Add set_selection() convenience helper to GlyphMapWidget 2022-03-20 20:00:25 +01:00
thankyouverycool
5c6326ae23 LibGUI: Add automatic scrolling to GlyphMapWidget
Similar to TextEditor, GlyphMapWidget now automatically scrolls
when dragging a selection outside its boundaries.
2022-03-20 20:00:25 +01:00
thankyouverycool
a26e71a137 LibGUI: Use system theme when painting GlyphMapWidget focus outline 2022-03-20 20:00:25 +01:00
thankyouverycool
cf13cf7225 LibGUI: Reset GlyphMapWidget only if clicking a new active glyph
Fixes an edge case in which mousing down on the active glyph within
a larger selection would reset the selection but fail to update the
glyph map. Now we can grow or shrink the selection by dragging the
active glyph even after an initial selection is made.
2022-03-20 20:00:25 +01:00
thankyouverycool
4f7b37de9c LibGUI: Use nicer API for contrained positions in GlyphMapWidget
Forgot about this little guy. Functionally the same here, but more
robust if scrollbars change.
2022-03-20 20:00:25 +01:00
thankyouverycool
54634fc2df LibGUI: Remove unnecessary MouseEvent calls in GlyphMapWidget
And pass KeyEvents directly to the relevant predecessor.
2022-03-20 20:00:25 +01:00
Simon Wanner
dc8ac83f77 Browser: Size the content box in "Box Model" based on its text 2022-03-20 19:57:09 +01:00
Simon Wanner
69fc7009bf LibWeb: Grey out invisible nodes in the DOM inspector
This makes it easier to navigate large DOM trees where
some nodes have display: none
2022-03-20 19:57:09 +01:00
Tim Schumacher
a128d4931d Base: Install symlinks instead of aliasing rgrep and egrep 2022-03-20 11:50:47 -07:00
Tim Schumacher
4a5d1db7f6 grep: Recognize mode based on the program name 2022-03-20 11:50:47 -07:00
circl
0865a06ef5 Ports: Add The Powder Toy port 2022-03-20 18:20:01 +00:00
circl
adcd39d928 Ports: Add FFTW port 2022-03-20 18:20:01 +00:00
circl
ce5f34f153 Ports: Add luajit port 2022-03-20 18:20:01 +00:00
Andreas Kling
8cc757b92b LibWeb: Always call Layout::Box::did_set_rect()
Since paintables have a default content size of 0x0, we were neglecting
to notify the corresponding layout node about size changes, if the used
content size came out to 0x0.

This fixes an issue where resizing an iframe to 0x0 didn't take effect.
2022-03-20 19:03:43 +01:00
Andreas Kling
07a4d590dd LibWeb: Layout browsing context parent before its children
When updating layout inside a nested browsing context, try first to
perform layout in the parent document (the nested browsing context's
container's document).

This ensures that nested browsing contexts have the right viewport
dimensions in case the parent layout changes them somehow.
2022-03-20 19:03:43 +01:00
Andreas Kling
6ac3bf2982 LibWeb: Don't crash in BrowsingContextContainer::content_document()
Instead of choking on the VERIFY(document), let's just return null if
there's no active document for now. This is incorrect, but sidesteps
a frequent crash that happens on content with iframes.

I've left a FIXME about removing the hack once it's no longer needed.
2022-03-20 19:03:43 +01:00
Andreas Kling
d03680a9e7 LibWeb: Always defer callbacks in ResourceClient::set_resource()
Previously, we'd invoke the load/fail callbacks synchronously for
resources that were already loaded and cached.

This patch uses deferred_invoke() in the already-loaded case to ensure
that we always invoke these callbacks in a consistent manner.

This isn't to fix a specific issue, but rather because I kept seeing
these callbacks being invoked synchronously on top of an already-tall
call stack, and it was hard to reason about what was going on.
2022-03-20 19:03:43 +01:00
Sam Atkins
d60b3be29a LibWeb: Implement the :focus-within selector
This matches if it has focus, or any nodes inside it do.
2022-03-20 17:35:31 +00:00
Sam Atkins
4827092554 Base: Add a :focus/:focus-within test page 2022-03-20 17:35:31 +00:00
Andreas Kling
02497888a6 LibWeb: Ignore linked stylesheets with MIME types other than text/css
This makes the "Acid3" text on ACID3 not show up in red. :^)
2022-03-20 17:20:59 +01:00
Andreas Kling
2b7775118d LibWeb: Clear element.style when the "style" attribute is removed
We were hanging on to element inline style, even after the style
attribute was removed. This made inline style sticky and impossible to
remove. This patch fixes that. :^)
2022-03-20 16:31:40 +01:00
Andreas Kling
485ef276bd LibWeb: Invalidate style & layout inside iframes when they change size 2022-03-20 16:25:54 +01:00
Andreas Kling
618b857457 LibWeb: Evaluate @media CSS rules when updating style
In case we have new @media rules, we need to make sure we've evaluated
them before actually recomputing styles for the document.
2022-03-20 16:19:47 +01:00
Andreas Kling
80ed2ab557 LibWeb: Implement HTMLOptionElement.selected 2022-03-20 16:19:47 +01:00
Andreas Kling
a606345576 LibWeb: Implement HTMLSelectElement.selectedIndex 2022-03-20 16:19:47 +01:00
Ali Mohammad Pur
5dc0855489 Spreadsheet: Use the correct top-center alignment when set to Top+Center 2022-03-20 13:20:33 +00:00
Ali Mohammad Pur
292e459901 Spreadsheet: Allow the user to format Identity cells via JS expressions
Also add some hints as to what the format field expects as it would be
very confusing otherwise.
2022-03-20 13:20:33 +00:00
Ali Mohammad Pur
8919e4b2b6 Spreadsheet: Only update the selection on primary mousedown
Otherwise we'd end up clearing the selected rect before doing anything
with it if the user right-clicks on it.
2022-03-20 13:20:33 +00:00
Ali Mohammad Pur
0d302516d5 Spreadsheet: Skip over "invalid" saved cell values
These can be generated by saving something that's not serialisable (e.g.
functions), skip over them and let the load logic reevaluate them when
needed.
2022-03-20 13:20:33 +00:00
safarp
b0b8d14a2c LibC: Automatically append null terminator in vswprintf 2022-03-20 08:40:36 -04:00
Andreas Kling
96db8d64f6 LibWeb: Include entire border box when painting stacking context layer
For stacking contexts that have opacity between 0 and 1, and also
contexts with a 2D transform, we first paint them into a temporary layer
buffer. Then we blend that buffer with the contents in one go.

Before this patch, we were only drawing the content box of the stacking
context into this layer buffer, which led to padding and borders missing
from elements painted this way.
2022-03-20 13:36:45 +01:00
Andreas Kling
159d4d772a LibWeb: Assign the used top/bottom border widths to inline-block boxes
We were forgetting to update these values, which led to missing top and
bottom borders for elements with display:inline-block.
2022-03-20 13:36:45 +01:00
Andreas Kling
bdd42c9b0e LibWeb: Add basic support for :lang() CSS selector
This doesn't have parsing support for multiple languages in the same
selector. Support for language subcodes is not great either. But it
does do the basics.
2022-03-20 13:36:45 +01:00