Aliaksandr Kalenik
32a6bf908a
LibWeb/CSS: Fix stack use after scope in matches_attribute()
...
If a short string is used for the attribute value, then the result of:
```cpp
auto const view = element.attribute(attribute_name).value_or({})
.bytes_as_string_view().split_view(' ');
```
is an array of string views pointing into a temporarily allocated
string.
With this change we keep string on stack until the end of scope.
Page that allows to reproduce the problem.
```html
<!DOCTYPE html><style>
div[data-info~="a"] {
background-color: yellow;
}
</style><div data-info="a">a</div>
```
2023-12-24 08:03:58 +00:00
..
2023-12-17 23:12:48 +01:00
2023-12-23 20:41:07 +01:00
2023-12-17 18:25:10 +03:30
2023-12-23 20:41:07 +01:00
2023-12-17 18:25:10 +03:30
2023-12-23 20:41:07 +01:00
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-23 20:41:07 +01:00
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-23 20:41:07 +01:00
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-23 20:41:07 +01:00
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-23 20:41:07 +01:00
2023-12-23 20:54:07 +01:00
2023-12-17 18:25:10 +03:30
2023-12-23 20:41:07 +01:00
2023-12-23 20:41:07 +01:00
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-23 20:41:07 +01:00
2023-12-17 18:25:10 +03:30
2023-12-23 20:22:42 -05:00
2023-12-17 18:25:10 +03:30
2023-12-23 20:41:07 +01:00
2023-12-23 20:41:07 +01:00
2023-12-23 20:41:07 +01:00
2023-12-17 18:25:10 +03:30
2023-12-23 20:41:07 +01:00
2023-12-17 18:25:10 +03:30
2023-12-23 20:41:07 +01:00
2023-12-23 20:41:07 +01:00
2023-12-23 20:41:07 +01:00
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-17 18:25:10 +03:30
2023-12-23 20:41:07 +01:00
2023-12-23 20:41:07 +01:00
2023-12-24 08:03:58 +00:00
2023-12-17 18:25:10 +03:30
2023-12-23 10:12:36 +01:00
2023-12-17 18:25:10 +03:30
2023-12-23 20:41:07 +01:00