summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-02-15LibWeb: Port CSS::UnicodeRange to new StringsSam Atkins
2023-02-15LibWeb: Use StringView in CSS::PreferredColorSchemeSam Atkins
This doesn't need to hold the string data.
2023-02-15LibWeb: Port CSS::Display to new StringsSam Atkins
2023-02-15LibWeb: Port CSS::Parser::Rule to new StringsSam Atkins
`Rule::to_deprecated_string()` and `DeclarationOrAtRule::to_deprecated_string()` are not used anywhere, so we can just delete them.
2023-02-15LibWeb: Port CSS::Parser::Declaration to new StringsSam Atkins
2023-02-15LibWeb: Port CSS::Parser::ComponentValue to new StringsSam Atkins
2023-02-15LibWeb: Port CSS::Parser::Function to new StringsSam Atkins
2023-02-15LibWeb: Port CSS::Parser::Block to new StringsSam Atkins
2023-02-15LibWeb: Port ComputedValues to new StringsSam Atkins
2023-02-15LibWeb: Remove unused includes for DeprecatedStringSam Atkins
Missed these before, oops.
2023-02-15LibWeb: Port CSS Tokenizer to new StringsSam Atkins
Specifically, this uses FlyString, because the data gets held long-term as a FlyString anyway.
2023-02-15LibWeb: Implement ASCII case-insensitive matchingSam Atkins
While DeprecatedString and StringView use ASCII case-insensitivity when matching, String uses the Unicode rules, so in order to match the spec, we need to *not* use `String::equals_ignoring_case()`. This function needs to be used everywhere that the spec refers to an "ASCII case-insensitive match".
2023-02-15AK: Add StringBuilder::to_fly_string()Sam Atkins
2023-02-15AK: Let FlyStrings be assigned from StringsSam Atkins
2023-02-15AK+Tests+LibWeb: Make `URL::complete_url()` take a StringViewSam Atkins
All it does is pass this to `URLParser::parse()` which takes a StringView, so we might as well take one here too.
2023-02-15LibWeb: Construct CSS Tokenizer and Parser with a StringView encodingSam Atkins
This doesn't need to be a full (Deprecated)String, so let's not force it to be.
2023-02-15LibTextCodec+Everywhere: Make TextCodec::decoder_for() take a StringViewSam Atkins
We don't need a full String/DeprecatedString inside this function, so we might as well not force users to create one.
2023-02-15LibJS: Keep escaping forward slashesNico Weber
Reverts 5dce916a504. Now: > new RegExp('/').source "\/" This matches spec (and v8).
2023-02-15HexEditor: Add selection strings to the value inspectorMetallicSquid
Strings include ASCII, UTF-8, and UTF-16 Co-authored-by: Andreas Krohn <hamburger1984@gmail.com>
2023-02-15Piano: Fix insertion and deletion of notesFlorian Kaiser
On mouse move the pressed button is not present in the event argument which causes the corresponding code to never fire. Instead it now stores the original mouse down event and acts according to that on mouse move.
2023-02-15LibGUI: Use Unicode's text segmentation for traversing word breaksTimothy Flynn
Note that for traversing words with ctrl+(left or right arrow) on the keyboard, we want to "skip" some boundaries. Consider the text: The ("quick") fox can't jump 32.3 feet, right? Using "|" to denote word break boundaries, we will have: |The| |(|"|quick|"|)| |fox| |can't| |jump| |32.3| |feet|,| |right|?| When starting at "The" and using ctrl+right to move rightward in this text, it is unlikely that users will want to break at every single one of those boundaries. Most text editors, for example, will skip from the end of "The" to the end of "quick", not breaking at the parentheses or opening quotation marks. We try to mimic such desired behavior here. It likely isn't perfect, but we can improve upon it as we find edge cases.
2023-02-15LibUnicode: Fix typos causing text segmentation on mid-word punctuationTimothy Flynn
For example the words "can't" and "32.3" should not have boundaries detected on the "'" and "." code points, respectively. The String test cases fixed here are because "b'ar" is now considered one word.
2023-02-15LibUnicode: Support finding the next/previous text segmentation boundaryTimothy Flynn
2023-02-15LibUnicode: Allow iterating over text segmentation boundariesTimothy Flynn
This will be useful for e.g. finding the next boundary after a specific index - we can just stop iterating once a condition is satisfied.
2023-02-15LibUnicode: Implement text segmentation algorithms for all UTF encodingsTimothy Flynn
Similar to commit 6d710eeb431d4fc729e4692ac8db4270183cd039. Rather than pick-and-chosing what to support, let's just support all encodings now, as it is trivial. For example, LibGUI will want the UTF-32 overloads.
2023-02-15LibUnicode+LibJS: Move text segmentation algorithms to their own filesTimothy Flynn
These algorithms are quite chonky, and more APIs around them are to be added, so let's move them to their own files for a bit of organization.
2023-02-15LibGfx: Move ICC::Profile towards "Fallible Constructors" patternNico Weber
Not quite there yet due to check_required_tags() / check_tag_types(), but getting closer :^)
2023-02-15LibGfx: Move ICC::Profile::read_header() out of classNico Weber
This one is slightly more involved: To make it nice, extract all the Profile fields that belong to the header into a separate struct.
2023-02-15LibGfx: Move ICC::Profile::read_tag_table() out of classNico Weber
2023-02-15LibGfx: Move ICC::Profile::read_tag() out of classNico Weber
2023-02-15LibRegex: Bail out of atomic rewrite if a block doesn't contain comparesAli Mohammad Pur
If a block jumps before performing a compare, we'd need to recursively find the first of the jumped-to block. While this is doable, it's not really worth spending the time as most such cases won't actually qualify for atomic loop rewrite anyway. Fixes an invalid rewrite when `.+` is followed by an alternation, e.g. /.+(a|b|c)/.
2023-02-15LibRegex: Consider the inverse=true case when finding pattern overlapAli Mohammad Pur
Previously we were only checking for overlap when the range wasn't in inverse mode, which made us miss things like /[^x]x/; this patch makes it so we don't miss that.
2023-02-15LibRegex: Make '.' reject matching LF / LS / PS as per the ECMA262 specAli Mohammad Pur
Previously we allowed it to match those, but the ECMA262 spec disallows these (except in DotAll).
2023-02-15Tests: Use .is_flag_set() instead of bitwise & in Regex flag testsAli Mohammad Pur
The default flag might not be zero, so don't assume masking off flags will yield zero.
2023-02-15LibJS: Don't escape backslashes in RegExp.sourceAli Mohammad Pur
The spec doesn't require this, and no one else does so.
2023-02-14Documentation: Fix Ladybird debug instructionsYedaya Katsman
The current Meta/serenity.sh script only accepts the `gdb` subcommand, not `debug`.
2023-02-14LibGfx: Validate ICC namedColor2Tag consistencyNico Weber
2023-02-14LibGfx: Add v2 "ncol" tag, expand commentNico Weber
I had missed this in 21cc0c0cb2f because this tag is missing in "Table 32 — Tag list" in the v2 ICC spec O_o. But it's in "6.4.26 namedColorTag". Also add a comment pointing to a page saying that all these tags are very deprecated and not even recommended for new v2 profiles. (That's how I noticed that namedColorTag was missing.)
2023-02-13Meta: Add a `Shell --posix` parser fuzzerAli Mohammad Pur
2023-02-13Everywhere: Use /bin/Shell as the shebang for Shell scriptsAli Mohammad Pur
2023-02-13Shell: Use the POSIX parser if run as /bin/sh or passed the --posix flagAli Mohammad Pur
Note that the default shellrc is most likely not valid posix sh code, so passing --skip-shellrc is suggested until we come up with a separate shellrc file for the POSIX parser to use when interactive.
2023-02-13Shell: Start implementing a POSIX-compliant parserAli Mohammad Pur
The parser is still very much a work-in-progress, but it can currently parse most of the basic bits, the only *completely* unimplemented things in the parser are: - heredocs (io_here) - alias expansion - arithmetic expansion There are a whole suite of bugs, and syntax highlighting is unreliable at best. For now, this is not attached anywhere, a future commit will enable it for /bin/sh or a `Shell --posix` invocation.
2023-02-13LibGUI: Take gutter into account when measuring TextEditor content areaSam Atkins
2023-02-13LibGUI: Don't show caret cursor when hovering TextEditor's gutterSam Atkins
2023-02-13LibGUI: Combine wrapping/non-wrapping TextEditor code pathsSam Atkins
The `is_wrapping_enabled()` paths function just fine when wrapping is disabled. We already calculate `m_line_visual_data`. The only reason to use a special path is for speed, since you can skip some steps if you know each line is only 1 line high visually. However, with code-folding being added, we can't make assumptions about line height because a line could be hidden and have an effective height of 0px. So `text_position_at_content_position()` always needs to loop through the lines to see what our position is, and that function always needs to be called to calculate the real position.
2023-02-13LibGUI: Fix typo in `span_consumed` variableSam Atkins
2023-02-13LibWeb: Convert CSS Token::to_debug_string() to ::to_string() :^)Sam Atkins
Using from_utf8_short_string() for all cases that are <= 3 bytes long. Which is almost all of the static ones.
2023-02-13LibWeb: Convert CSS Token/ComponentValue::to_debug_string() to StringSam Atkins
These are only used for debugging, so I've decided that logging the ErrorOr<String> itself is fine instead of trying to handle that error more gracefully in those cases. If you're getting OOM trying to debug log things, you have bigger problems.
2023-02-13LibWeb: Convert CSS Token value to new FlyStringSam Atkins
2023-02-13LibWeb: Return StringViews from CSS Token bracket-string gettersSam Atkins
These don't need to be full Strings, so let's be lightweight.