-
-
Notifications
You must be signed in to change notification settings - Fork 980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LibWeb+WebContent: Do not include DOM HTML in text test expectations #1603
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trflynn89
force-pushed
the
text_tests
branch
2 times, most recently
from
October 2, 2024 16:51
cdd45f9
to
ddd104a
Compare
There are now a couple of tests whose expected files are empty, will a failure still be detected? |
These tests were mostly async tests written in a manual way. This ports them to use the standard asyncTest() infrastructure. This is mostly just to reduce calls to internals.signalTextTestIsDone, which will have a required parameter in an upcoming test.
trflynn89
force-pushed
the
text_tests
branch
2 times, most recently
from
October 2, 2024 18:03
21f237f
to
922760e
Compare
The events tested here are decidedly async. We also can't really write sync tests of the form "test(async () => {})". Nothing will await the async callback.
We were signaling that the test is complete too early in some Stream tests.
For example, in the following abbreviated test HTML: <span>some text</span> <script>println("whf")</script> We would have to craft the expectation file to include the "some text" segment, usually with some leading whitespace. This is a bit annoying, and makes it difficult to manually craft expectation files. So instead of comparing the expectation against the entire DOM inner text, we now send the inner text of just the <pre> element containing the test output when we invoke `internals.signalTextTestIsDone`.
awesomekling
approved these changes
Oct 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hahaha yes! Yes!!
kalenikaliaksandr
approved these changes
Oct 3, 2024
nico
pushed a commit
to nico/serenity
that referenced
this pull request
Oct 27, 2024
Ignoring the fact that we should serialize a simplified form of calc() expressions, the following are wrong: - grid-auto-columns - grid-auto-rows - grid-template-columns - grid-template-rows - transform-origin Generated in part with this python script (though I've since iterated on the output repeatedly so it's quite different): ```py import json properties_file = open("./Userland/Libraries/LibWeb/CSS/Properties.json") properties = json.load(properties_file) for (key, value) in properties.items(): if not 'valid-types' in value: continue if 'longhands' in value: continue valid_types = value['valid-types'] for type_string in valid_types: name, *suffix = type_string.split(None, 1) match name: case 'integer' | 'number': print(f'{key}: calc(2 * var(--n));') case 'angle': print(f'{key}: calc(2deg * var(--n));') case 'flex': print(f'{key}: calc(2fr * var(--n));') case 'frequency': print(f'{key}: calc(2hz * var(--n));') case 'length': print(f'{key}: calc(2px * var(--n));') case 'percentage': print(f'{key}: calc(2% * var(--n));') case 'resolution': print(f'{key}: calc(2x * var(--n));') case 'time': print(f'{key}: calc(2s * var(--n));') ``` (cherry picked from commit 301502a3a12b86e218f477f06d2d5271aee8e017; amended to include `Well, hello friends ` in expected/css/calc-coverage.txt because we don't have LadybirdBrowser/ladybird#1603 yet)
nico
pushed a commit
to SerenityOS/serenity
that referenced
this pull request
Oct 27, 2024
Ignoring the fact that we should serialize a simplified form of calc() expressions, the following are wrong: - grid-auto-columns - grid-auto-rows - grid-template-columns - grid-template-rows - transform-origin Generated in part with this python script (though I've since iterated on the output repeatedly so it's quite different): ```py import json properties_file = open("./Userland/Libraries/LibWeb/CSS/Properties.json") properties = json.load(properties_file) for (key, value) in properties.items(): if not 'valid-types' in value: continue if 'longhands' in value: continue valid_types = value['valid-types'] for type_string in valid_types: name, *suffix = type_string.split(None, 1) match name: case 'integer' | 'number': print(f'{key}: calc(2 * var(--n));') case 'angle': print(f'{key}: calc(2deg * var(--n));') case 'flex': print(f'{key}: calc(2fr * var(--n));') case 'frequency': print(f'{key}: calc(2hz * var(--n));') case 'length': print(f'{key}: calc(2px * var(--n));') case 'percentage': print(f'{key}: calc(2% * var(--n));') case 'resolution': print(f'{key}: calc(2x * var(--n));') case 'time': print(f'{key}: calc(2s * var(--n));') ``` (cherry picked from commit 301502a3a12b86e218f477f06d2d5271aee8e017; amended to include `Well, hello friends ` in expected/css/calc-coverage.txt because we don't have LadybirdBrowser/ladybird#1603 yet)
nico
pushed a commit
to nico/serenity
that referenced
this pull request
Nov 9, 2024
(cherry picked from commit 4408ea7c9be1b3faefb5d68871ddd60f912a431b; amended to add a trailing space to calc-missing-context.txt since we don't have LadybirdBrowser/ladybird#1603 yet)
nico
pushed a commit
to SerenityOS/serenity
that referenced
this pull request
Nov 9, 2024
(cherry picked from commit 4408ea7c9be1b3faefb5d68871ddd60f912a431b; amended to add a trailing space to calc-missing-context.txt since we don't have LadybirdBrowser/ladybird#1603 yet)
nico
pushed a commit
to nico/serenity
that referenced
this pull request
Nov 13, 2024
This reverts 6d25bf3 Invalidating the style here means that transitions can cause an element to leave style computation with its "needs style update" flag set to true. This then causes a VERIFY to fail in the TreeBuilder. This invalidation does not otherwise seem to have any effect. The original commit suggests this was to fix a bug, but it's not clear what bug that was. If it reappears, we can try to solve the issue in a different way. (cherry picked from commit 81596b41457d250bac28db37c1390fa46e6532de; amended test with leading whitespace since we don't have LadybirdBrowser/ladybird#1603 yet)
nico
pushed a commit
to SerenityOS/serenity
that referenced
this pull request
Nov 13, 2024
This reverts 6d25bf3 Invalidating the style here means that transitions can cause an element to leave style computation with its "needs style update" flag set to true. This then causes a VERIFY to fail in the TreeBuilder. This invalidation does not otherwise seem to have any effect. The original commit suggests this was to fix a bug, but it's not clear what bug that was. If it reappears, we can try to solve the issue in a different way. (cherry picked from commit 81596b41457d250bac28db37c1390fa46e6532de; amended test with leading whitespace since we don't have LadybirdBrowser/ladybird#1603 yet)
nico
pushed a commit
to nico/serenity
that referenced
this pull request
Nov 17, 2024
Before this change we were serializing them in a bogus 8-digit hex color format that isn't actually recognized by HTML. This code will need more work when we start supporting color spaces other than sRGB. (cherry picked from commit 4590c081c2eb257232463ed660498a02f9bbe7b8; amended expected output because serenity does not yet have LadybirdBrowser/ladybird#1603)
nico
pushed a commit
to nico/serenity
that referenced
this pull request
Nov 17, 2024
This matches the behavior of other browsers and fixes a WPT test. (cherry picked from commit 902586a21de3ef8335e447053d82057c4c927d72; amended expected output because serenity does not yet have LadybirdBrowser/ladybird#1603)
nico
pushed a commit
to SerenityOS/serenity
that referenced
this pull request
Nov 17, 2024
Before this change we were serializing them in a bogus 8-digit hex color format that isn't actually recognized by HTML. This code will need more work when we start supporting color spaces other than sRGB. (cherry picked from commit 4590c081c2eb257232463ed660498a02f9bbe7b8; amended expected output because serenity does not yet have LadybirdBrowser/ladybird#1603)
nico
pushed a commit
to SerenityOS/serenity
that referenced
this pull request
Nov 17, 2024
This matches the behavior of other browsers and fixes a WPT test. (cherry picked from commit 902586a21de3ef8335e447053d82057c4c927d72; amended expected output because serenity does not yet have LadybirdBrowser/ladybird#1603)
nico
pushed a commit
to nico/serenity
that referenced
this pull request
Nov 18, 2024
CSS Syntax 3 (https://drafts.csswg.org/css-syntax) has changed significantly since we implemented it a couple of years ago. Just about every parsing algorithm has been rewritten in terms of the new token stream concept, and to support nested styles. As all of those algorithms call into each other, this is an unfortunately chonky diff. As part of this, the transitory types (Declaration, Function, AtRule...) have been rewritten. That's both because we have new requirements of what they should be and contain, and also because the spec asks us to create and then gradually modify them in place, which is easier if they are plain structs. (cherry picked from commit e0be17e4fbf1870f35614d0cde8f63e72f78bd16; amended to tweak test expectation due to serenity not yet having LadybirdBrowser/ladybird#1603)
nico
pushed a commit
to SerenityOS/serenity
that referenced
this pull request
Nov 18, 2024
CSS Syntax 3 (https://drafts.csswg.org/css-syntax) has changed significantly since we implemented it a couple of years ago. Just about every parsing algorithm has been rewritten in terms of the new token stream concept, and to support nested styles. As all of those algorithms call into each other, this is an unfortunately chonky diff. As part of this, the transitory types (Declaration, Function, AtRule...) have been rewritten. That's both because we have new requirements of what they should be and contain, and also because the spec asks us to create and then gradually modify them in place, which is easier if they are plain structs. (cherry picked from commit e0be17e4fbf1870f35614d0cde8f63e72f78bd16; amended to tweak test expectation due to serenity not yet having LadybirdBrowser/ladybird#1603)
nico
pushed a commit
to nico/serenity
that referenced
this pull request
Nov 18, 2024
This is because toggling the checkbox is committing the value. (cherry picked from commit 3856dd946b94b61be2ddac80c8cf60278fcc56ab; amended to add two spaces to expected output due to serenity not yet having LadybirdBrowser/ladybird#1603)
nico
pushed a commit
to nico/serenity
that referenced
this pull request
Nov 18, 2024
This is because toggling the checkbox is committing the value. (cherry picked from commit 3856dd946b94b61be2ddac80c8cf60278fcc56ab; amended to add two spaces to expected output due to serenity not yet having LadybirdBrowser/ladybird#1603, and to add a trailing newline to the test input file)
nico
pushed a commit
to nico/serenity
that referenced
this pull request
Nov 18, 2024
This is because toggling the checkbox is committing the value. (cherry picked from commit 3856dd946b94b61be2ddac80c8cf60278fcc56ab; amended to add spaces to expected output due to serenity not yet having LadybirdBrowser/ladybird#1603, and to add a trailing newline to the test input file)
nico
pushed a commit
to SerenityOS/serenity
that referenced
this pull request
Nov 18, 2024
This is because toggling the checkbox is committing the value. (cherry picked from commit 3856dd946b94b61be2ddac80c8cf60278fcc56ab; amended to add spaces to expected output due to serenity not yet having LadybirdBrowser/ladybird#1603, and to add a trailing newline to the test input file)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For example, in the following abbreviated test HTML:
We would have to craft the expectation file to include the "some text"
segment, usually with some leading whitespace. This is a bit annoying,
and makes it difficult to manually craft expectation files.
So instead of comparing the expectation against the entire DOM inner
text, we now send the inner text of just the
<pre>
element containingthe test output when we invoke
internals.signalTextTestIsDone
.