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-23 20:41:07 +01:00
2023-12-15 22:04:46 +01:00
2023-10-30 10:40:30 +00:00
2023-11-28 17:15:27 -05:00
2023-10-25 19:45:41 +02:00
2023-12-23 23:02:10 +01:00
2023-11-28 17:15:27 -05:00
2023-10-25 19:45:41 +02:00
2023-11-28 17:15:27 -05:00
2023-10-25 19:45:41 +02:00
2023-12-15 22:04:46 +01:00
2023-12-01 20:48:13 +01:00
2023-10-25 19:45:41 +02:00
2023-11-28 17:15:27 -05:00
2023-11-28 17:15:27 -05:00
2023-11-11 08:51:51 +01:00
2023-11-28 17:15:27 -05:00
2023-11-28 17:15:27 -05:00
2023-11-11 08:51:51 +01:00
2023-12-01 20:48:13 +01:00
2023-11-28 17:15:27 -05:00
2023-10-25 19:45:41 +02:00
2023-12-01 16:03:58 +01:00
2023-12-01 16:03:58 +01:00
2023-11-21 01:29:26 +01:00
2023-09-28 20:33:20 +01:00
2023-11-28 17:15:27 -05:00
2023-12-01 20:48:13 +01:00
2023-10-25 19:45:41 +02:00
2023-11-28 17:15:27 -05:00
2023-11-19 22:00:48 +01:00
2023-10-25 19:45:41 +02:00
2023-12-17 23:12:34 +01:00
2023-12-17 23:12:34 +01:00
2023-10-25 19:45:41 +02:00
2023-12-01 20:48:13 +01:00
2023-12-01 20:48:13 +01:00
2023-10-25 19:45:41 +02:00
2023-12-01 16:03:58 +01:00
2023-11-24 10:57:17 +01:00
2023-11-11 08:51:51 +01:00
2023-11-28 17:15:27 -05:00
2023-11-28 17:15:27 -05:00
2023-10-25 19:45:41 +02:00
2023-12-23 10:12:36 +01:00
2023-11-21 01:29:26 +01:00
2023-09-28 20:33:20 +01:00
2023-09-28 20:33:20 +01:00
2023-12-10 17:32:04 +01:00
2023-12-10 17:32:04 +01:00
2023-09-28 20:33:20 +01:00
2023-09-28 20:33:20 +01:00
2023-10-09 07:28:18 +02:00
2023-12-10 17:32:04 +01:00
2023-12-01 20:48:13 +01:00
2023-11-19 22:00:48 +01:00
2023-10-25 19:45:41 +02:00
2023-12-15 22:04:46 +01:00
2023-12-01 20:48:13 +01:00
2023-12-01 20:48:13 +01:00
2023-10-25 19:45:41 +02:00
2023-11-28 17:15:27 -05:00
2023-11-19 22:00:48 +01:00
2023-12-23 10:12:36 +01:00
2023-12-17 23:12:34 +01:00
2023-12-17 23:12:34 +01:00
2023-12-15 22:04:46 +01:00
2023-11-19 22:00:48 +01:00
2023-12-21 13:17:51 +01:00
2023-12-21 13:17:51 +01:00
2023-12-24 08:03:58 +00:00
2023-12-11 16:54:59 +01:00
2023-12-10 17:32:04 +01:00
2023-12-10 17:32:04 +01:00
2023-12-23 10:12:36 +01:00
2023-12-11 16:54:59 +01:00
2023-12-10 17:32:04 +01:00
2023-12-10 17:32:04 +01:00
2023-11-07 11:33:41 +01:00
2023-12-01 20:48:13 +01:00
2023-10-25 19:45:41 +02:00
2023-11-28 17:15:27 -05:00
2023-11-19 22:00:48 +01:00
2023-10-25 19:45:41 +02:00
2023-09-28 20:33:20 +01:00
2023-09-28 20:33:20 +01:00
2023-11-30 22:54:02 +01:00
2023-10-15 07:14:39 +02:00
2023-11-30 22:54:02 +01:00
2023-11-28 17:15:27 -05:00
2023-11-19 22:00:48 +01:00
2023-10-25 19:45:41 +02:00