ladybird/Libraries/LibWeb/HTML/Parser
InvalidUsernameException 0e1eb4d4a7 LibWeb: Respect scroll position set by script during page load
When setting scroll position during page load we need to consider
whether we actually have a fragment to scroll to. A script may already
have run at that point and may already have set a scroll position.

If there is an actual fragment to scroll to, it is fine to scroll to
that fragment, since it should take precedence. If we don't have a
fragment however, we should not unnecessarily overwrite the scroll
position set by the script back to (0, 0).

Since this problem is caused by a spec bug, I have tested the behavior
in the three major browsers engines. Unfortunately they do not agree
fully with each other. If there is no fragment at all (e.g. `foo.html`),
all browsers will respect the scroll position set by the script. If
there is a fragment (e.g. `foo.html#bar`), all browsers will set the
scroll position to the fragment element and ignore the one set by
script. However, when the fragment is empty (e.g. `foo.html#`), then
Blink and WebKit will set scroll position to the fragment, while Gecko
will set scroll position from script. Since all of this is ad-hoc
behavior anyway, I simply implemented the Blink/WebKit behavior because
of the majority vote for now.

This fixes a regression introduced in 51102254b5.
2025-03-10 17:14:13 +01:00
..
Entities.cpp
Entities.h
HTMLEncodingDetection.cpp LibWeb: Check charset UTF-16LE/BE separately for UTF-8 conversion 2025-02-24 14:51:41 +01:00
HTMLEncodingDetection.h
HTMLParser.cpp LibWeb: Respect scroll position set by script during page load 2025-03-10 17:14:13 +01:00
HTMLParser.h LibWeb: Remember when HTML parser should ignore next line feed character 2025-02-20 14:32:13 +01:00
HTMLToken.cpp
HTMLToken.h
HTMLToken.swift
HTMLTokenizer.cpp LibWeb: Emit comment token for unterminated bogus comments on EOF 2025-01-11 11:09:47 +01:00
HTMLTokenizer.h
HTMLTokenizer.swift
HTMLTokenizerHelpers.cpp
HTMLTokenizerHelpers.h
ListOfActiveFormattingElements.cpp
ListOfActiveFormattingElements.h
StackOfOpenElements.cpp LibWeb: Fix various typos 2025-01-30 15:00:16 +00:00
StackOfOpenElements.h