mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibWeb: Make the ListItemMarkerBox index-aware.
In the ListItemBox we get the index of the current <li> element in the parent and pass it to the ListItemMarkerBox. This patch is work towards #2059
This commit is contained in:
parent
c09ac536c5
commit
bfcfe84240
3 changed files with 13 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2021, Tobias Christiansen <tobi@tobyase.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -49,7 +50,8 @@ void ListItemBox::layout_marker()
|
|||
return;
|
||||
|
||||
if (!m_marker) {
|
||||
m_marker = adopt(*new ListItemMarkerBox(document()));
|
||||
int child_index = parent()->index_of_child<ListItemBox>(*this).value();
|
||||
m_marker = adopt(*new ListItemMarkerBox(document(), computed_values().list_style_type(), child_index + 1));
|
||||
if (first_child())
|
||||
m_marker->set_inline(first_child()->is_inline());
|
||||
append_child(*m_marker);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue