|
15 | 15 | #include <LibWeb/Bindings/Intrinsics.h> |
16 | 16 | #include <LibWeb/Bindings/ShadowRootPrototype.h> |
17 | 17 | #include <LibWeb/CSS/CascadedProperties.h> |
18 | | -#include <LibWeb/CSS/ComputedProperties.h> |
19 | 18 | #include <LibWeb/CSS/Selector.h> |
20 | 19 | #include <LibWeb/CSS/StyleInvalidation.h> |
21 | 20 | #include <LibWeb/CSS/StyleProperty.h> |
@@ -495,41 +494,6 @@ class WEB_API Element |
495 | 494 | void maybe_invalidate_ordinals_for_list_owner(Optional<Element*> skip_node = {}); |
496 | 495 | i32 ordinal_value(); |
497 | 496 |
|
498 | | - template<typename Callback> |
499 | | - void for_each_numbered_item_owned_by_list_owner(Callback callback) const |
500 | | - { |
501 | | - const_cast<Element*>(this)->for_each_numbered_item_owned_by_list_owner(move(callback)); |
502 | | - } |
503 | | - |
504 | | - template<typename Callback> |
505 | | - void for_each_numbered_item_owned_by_list_owner(Callback callback) |
506 | | - { |
507 | | - for (auto* node = this->first_child(); node != nullptr; node = node->next_in_pre_order(this)) { |
508 | | - auto* element = as_if<Element>(node); |
509 | | - if (!element) |
510 | | - continue; |
511 | | - |
512 | | - element->m_is_contained_in_list_subtree = true; |
513 | | - |
514 | | - if (node->is_html_ol_ul_menu_element()) { |
515 | | - // Skip list nodes and their descendents. They have their own, unrelated ordinals. |
516 | | - while (node->last_child() != nullptr) // Find the last node (preorder) in the subtree headed by node. O(1). |
517 | | - node = node->last_child(); |
518 | | - |
519 | | - continue; |
520 | | - } |
521 | | - |
522 | | - if (!node->layout_node()) |
523 | | - continue; // Skip nodes that do not participate in the layout. |
524 | | - |
525 | | - if (!element->computed_properties()->display().is_list_item()) |
526 | | - continue; // Skip nodes that are not list items. |
527 | | - |
528 | | - if (callback(element) == IterationDecision::Break) |
529 | | - return; |
530 | | - } |
531 | | - } |
532 | | - |
533 | 497 | bool captured_in_a_view_transition() const { return m_captured_in_a_view_transition; } |
534 | 498 | void set_captured_in_a_view_transition(bool value) { m_captured_in_a_view_transition = value; } |
535 | 499 |
|
@@ -590,6 +554,15 @@ class WEB_API Element |
590 | 554 | Optional<Directionality> contained_text_auto_directionality(bool can_exclude_root) const; |
591 | 555 | Directionality parent_directionality() const; |
592 | 556 |
|
| 557 | + template<typename Callback> |
| 558 | + void for_each_numbered_item_owned_by_list_owner(Callback callback) const |
| 559 | + { |
| 560 | + const_cast<Element*>(this)->for_each_numbered_item_owned_by_list_owner(move(callback)); |
| 561 | + } |
| 562 | + |
| 563 | + template<typename Callback> |
| 564 | + void for_each_numbered_item_owned_by_list_owner(Callback callback); |
| 565 | + |
593 | 566 | QualifiedName m_qualified_name; |
594 | 567 | mutable Optional<FlyString> m_html_uppercased_qualified_name; |
595 | 568 |
|
|
0 commit comments