mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 03:39:17 +00:00
The previous code to determine the SourceDocument's lines was too naive: the source text can contain other newline characters and sequences, and the HTML/CSS/JS syntax highlighters would take those into account when determining what line a token is on. This disagreement would cause incorrect highlighting, or even crashes, if the source didn't solely use `\n` for its newlines. In order to have everyone agree on what a line is, this patch first processes the source to replace all newlines with `\n`. The need to copy the source like this is unfortunate, but viewing the source is a rare enough action that this should not cause any noticeable performance problems. As the callers have a String, and we want a String, this also changes the function parameters to keep the source as a String instead of converting it to StringView and back. Fixes https://github.com/LadybirdBrowser/ladybird/issues/3169 |
||
---|---|---|
.. | ||
EventLoop | ||
Plugins | ||
Application.cpp | ||
Application.h | ||
Attribute.cpp | ||
Attribute.h | ||
ChromeProcess.cpp | ||
ChromeProcess.h | ||
CMakeLists.txt | ||
CookieJar.cpp | ||
CookieJar.h | ||
Database.cpp | ||
Database.h | ||
Forward.h | ||
HelperProcess.cpp | ||
HelperProcess.h | ||
InspectorClient.cpp | ||
InspectorClient.h | ||
MachPortServer.cpp | ||
MachPortServer.h | ||
Native.css | ||
Options.h | ||
PageInfo.h | ||
Process.cpp | ||
Process.h | ||
ProcessHandle.cpp | ||
ProcessHandle.h | ||
ProcessManager.cpp | ||
ProcessManager.h | ||
ProcessType.h | ||
SearchEngine.cpp | ||
SearchEngine.h | ||
SourceHighlighter.cpp | ||
SourceHighlighter.h | ||
UIProcessClient.ipc | ||
UIProcessServer.ipc | ||
URL.cpp | ||
URL.h | ||
UserAgent.cpp | ||
UserAgent.h | ||
Utilities.cpp | ||
Utilities.h | ||
ViewImplementation.cpp | ||
ViewImplementation.h | ||
WebContentClient.cpp | ||
WebContentClient.h |