Truly independent web browser
Find a file
Ryan Liptak df87a9689c LibWeb: Fix numeric character reference at EOF leaking its last digit
Previously, if the NumericCharacterReferenceEnd state was reached when
current_input_character was None, then the
DONT_CONSUME_NEXT_INPUT_CHARACTER macro would restore back before the
EOF, and allow the next state (after the SWITCH_TO_RETURN_STATE) to
proceed with the last digit of the numeric character reference.

For example, with something like `&#1111`, before this commit the
output would incorrectly be `<code point with the value 1111>1` instead
of just `<code point with the value 1111>`.

Instead of putting the `if (current_input_character.has_value())` check
inside NumericCharacterReferenceEnd directly, it was instead added to
DONT_CONSUME_NEXT_INPUT_CHARACTER, because all usages of the macro
benefit from this check, even if the other existing usage sites don't
exhibit any bugs without it:

- In MarkupDeclarationOpen, if the current_input_character is EOF, then
  the previous character is always `!`, so restoring and then checking
  forward for strings like `--`, `DOCTYPE`, etc won't match and the
  BogusComment state will run one extra time (once for `!` and once
  for EOF) with no practical consequences. With the `has_value()` check,
  BogusComment will only run once with EOF.

- In AfterDOCTYPEName, ConsumeNextResult::RanOutOfCharacters can only
  occur when stopping at the insertion point, and because of how
  the code is structured, it is guaranteed that current_input_character
  is either `P` or `S`, so the `has_value()` check is irrelevant.
2025-01-07 00:43:41 +01:00
.devcontainer
.github
AK AK: Stub out AK::demangle on Windows 2025-01-05 15:02:32 +00:00
Base/res
Documentation Documentation: Mention TODOs and FIXMEs as potential sources of work 2025-01-05 12:02:16 +01:00
Libraries LibWeb: Fix numeric character reference at EOF leaking its last digit 2025-01-07 00:43:41 +01:00
Meta CMake: Enable -Wl,--no-undefined on ELF platforms 2025-01-06 12:41:47 -07:00
Services
Tests LibWeb: Fix numeric character reference at EOF leaking its last digit 2025-01-07 00:43:41 +01:00
Toolchain
UI UI/Qt: Add menu action to clear all cookies 2025-01-05 13:58:27 +00:00
Utilities
.clang-format
.clang-tidy
.clangd
.editorconfig
.gitattributes
.gitignore
.gn
.mailmap
.pre-commit-config.yaml
.prettierignore
.prettierrc
.swift-format
.ycm_extra_conf.py
CMakeLists.txt
CMakePresets.json
CODE_OF_CONDUCT.md
CONTRIBUTING.md
flake.lock
flake.nix
ISSUES.md
LICENSE
README.md
SECURITY.md
shell.nix
vcpkg-configuration.json
vcpkg.json Meta: Update ffmpeg to 7.1 2025-01-06 12:29:02 +01:00

Ladybird

Ladybird is a truly independent web browser, using a novel engine based on web standards.

Important

Ladybird is in a pre-alpha state, and only suitable for use by developers

Features

We aim to build a complete, usable browser for the modern web.

Ladybird uses a multi-process architecture with a main UI process, several WebContent renderer processes, an ImageDecoder process, and a RequestServer process.

Image decoding and network connections are done out of process to be more robust against malicious content. Each tab has its own renderer process, which is sandboxed from the rest of the system.

At the moment, many core library support components are inherited from SerenityOS:

  • LibWeb: Web rendering engine
  • LibJS: JavaScript engine
  • LibWasm: WebAssembly implementation
  • LibCrypto/LibTLS: Cryptography primitives and Transport Layer Security
  • LibHTTP: HTTP/1.1 client
  • LibGfx: 2D Graphics Library, Image Decoding and Rendering
  • LibUnicode: Unicode and locale support
  • LibMedia: Audio and video playback
  • LibCore: Event loop, OS abstraction layer
  • LibIPC: Inter-process communication

How do I build and run this?

See build instructions for information on how to build Ladybird.

Ladybird runs on Linux, macOS, Windows (with WSL2), and many other *Nixes.

How do I read the documentation?

Code-related documentation can be found in the documentation folder.

Get in touch and participate!

Join our Discord server to participate in development discussion.

Please read Getting started contributing if you plan to contribute to Ladybird for the first time.

Before opening an issue, please see the issue policy and the detailed issue-reporting guidelines.

The full contribution guidelines can be found in CONTRIBUTING.md.

License

Ladybird is licensed under a 2-clause BSD license.