mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibWeb: Skip serialization of implicit grid lines created during layout
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
StyleValues created for grid-template-rows and grid-template-columns by GFC should not include `-start`/`-end` lines implicitly created by grid areas.
This commit is contained in:
parent
185be4011b
commit
594194eb60
Notes:
github-actions[bot]
2025-06-25 18:46:52 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 594194eb60
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5212
8 changed files with 60 additions and 27 deletions
|
@ -166,7 +166,11 @@ String GridLineNames::to_string() const
|
|||
{
|
||||
StringBuilder builder;
|
||||
builder.append("["sv);
|
||||
builder.join(' ', names);
|
||||
for (size_t i = 0; i < m_names.size(); ++i) {
|
||||
if (i > 0)
|
||||
builder.append(" "sv);
|
||||
builder.append(m_names[i].name);
|
||||
}
|
||||
builder.append("]"sv);
|
||||
return MUST(builder.to_string());
|
||||
}
|
||||
|
@ -211,7 +215,8 @@ void GridTrackSizeList::append(GridLineNames&& line_names)
|
|||
{
|
||||
if (!m_list.is_empty() && m_list.last().has<GridLineNames>()) {
|
||||
auto& last_line_names = m_list.last().get<GridLineNames>();
|
||||
last_line_names.names.extend(move(line_names.names));
|
||||
for (auto const& name : line_names.names())
|
||||
last_line_names.append(name.name);
|
||||
return;
|
||||
}
|
||||
m_list.append(move(line_names));
|
||||
|
|
|
@ -78,11 +78,25 @@ private:
|
|||
GridSize m_max_grid_size;
|
||||
};
|
||||
|
||||
struct GridLineNames {
|
||||
Vector<FlyString> names;
|
||||
struct GridLineName {
|
||||
FlyString name;
|
||||
bool implicit { false };
|
||||
|
||||
bool operator==(GridLineName const& other) const = default;
|
||||
};
|
||||
|
||||
class GridLineNames {
|
||||
public:
|
||||
void append(FlyString const& name) { m_names.append({ name }); }
|
||||
bool is_empty() const { return m_names.is_empty(); }
|
||||
auto const& names() const& { return m_names; }
|
||||
|
||||
String to_string() const;
|
||||
|
||||
bool operator==(GridLineNames const& other) const = default;
|
||||
|
||||
private:
|
||||
Vector<GridLineName> m_names;
|
||||
};
|
||||
|
||||
class GridTrackSizeList {
|
||||
|
|
|
@ -3291,7 +3291,7 @@ Optional<GridLineNames> Parser::parse_grid_line_names(TokenStream<ComponentValue
|
|||
auto maybe_ident = parse_custom_ident(block_tokens, { { "span"sv, "auto"sv } });
|
||||
if (!maybe_ident.has_value())
|
||||
return OptionalNone {};
|
||||
line_names.names.append(maybe_ident.release_value());
|
||||
line_names.append(maybe_ident.release_value());
|
||||
block_tokens.discard_whitespace();
|
||||
}
|
||||
|
||||
|
@ -3313,13 +3313,13 @@ size_t Parser::parse_track_list_impl(TokenStream<ComponentValue>& tokens, GridTr
|
|||
if (!explicit_grid_track.has_value())
|
||||
break;
|
||||
|
||||
if (line_names.has_value() && !line_names->names.is_empty())
|
||||
if (line_names.has_value() && !line_names->is_empty())
|
||||
output.append(line_names.release_value());
|
||||
|
||||
output.append(explicit_grid_track.release_value());
|
||||
if (allow_trailing_line_names_for_each_track == AllowTrailingLineNamesForEachTrack::Yes) {
|
||||
auto trailing_line_names = parse_grid_line_names(tokens);
|
||||
if (trailing_line_names.has_value() && !trailing_line_names->names.is_empty()) {
|
||||
if (trailing_line_names.has_value() && !trailing_line_names->is_empty()) {
|
||||
output.append(trailing_line_names.release_value());
|
||||
}
|
||||
}
|
||||
|
@ -3328,7 +3328,7 @@ size_t Parser::parse_track_list_impl(TokenStream<ComponentValue>& tokens, GridTr
|
|||
}
|
||||
|
||||
if (allow_trailing_line_names_for_each_track == AllowTrailingLineNamesForEachTrack::No) {
|
||||
if (auto trailing_line_names = parse_grid_line_names(tokens); trailing_line_names.has_value() && !trailing_line_names->names.is_empty()) {
|
||||
if (auto trailing_line_names = parse_grid_line_names(tokens); trailing_line_names.has_value() && !trailing_line_names->is_empty()) {
|
||||
output.append(trailing_line_names.release_value());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue