Commit 2d18a660 authored by Oriol Brufau's avatar Oriol Brufau Committed by Commit Bot

[css-pseudo] Simplify Marker() using PseudoElementLayoutObject()

Instead of using GetPseudoElement to obtain the ::marker pseudo-element
and then call GetLayoutObject on it, PseudoElementLayoutObject can
directly be used.

This patch should have no effect in practice.

BUG=457718

Change-Id: Iff30a916834b2e57e67be9ce145c2e992b224fd6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078472Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/master@{#745420}
parent f2e024bd
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_LIST_ITEM_H_ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_LIST_ITEM_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_LIST_ITEM_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_LIST_ITEM_H_
#include "third_party/blink/renderer/core/dom/pseudo_element.h"
#include "third_party/blink/renderer/core/html/list_item_ordinal.h" #include "third_party/blink/renderer/core/html/list_item_ordinal.h"
#include "third_party/blink/renderer/core/layout/layout_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h"
#include "third_party/blink/renderer/core/layout/layout_list_marker.h" #include "third_party/blink/renderer/core/layout/layout_list_marker.h"
...@@ -43,13 +42,12 @@ class LayoutListItem final : public LayoutBlockFlow { ...@@ -43,13 +42,12 @@ class LayoutListItem final : public LayoutBlockFlow {
LayoutListMarker* Marker() const { LayoutListMarker* Marker() const {
Element* list_item = To<Element>(GetNode()); Element* list_item = To<Element>(GetNode());
if (PseudoElement* marker = list_item->GetPseudoElement(kPseudoIdMarker)) { if (LayoutObject* marker =
if (LayoutObject* layout_object = marker->GetLayoutObject()) { list_item->PseudoElementLayoutObject(kPseudoIdMarker)) {
if (layout_object->IsListMarker()) if (marker->IsListMarker())
return ToLayoutListMarker(layout_object); return ToLayoutListMarker(marker);
NOTREACHED(); NOTREACHED();
} }
}
return nullptr; return nullptr;
} }
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LIST_LAYOUT_NG_LIST_ITEM_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LIST_LAYOUT_NG_LIST_ITEM_H_
#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/dom/pseudo_element.h"
#include "third_party/blink/renderer/core/html/list_item_ordinal.h" #include "third_party/blink/renderer/core/html/list_item_ordinal.h"
#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h"
...@@ -23,9 +22,7 @@ class CORE_EXPORT LayoutNGListItem final : public LayoutNGBlockFlow { ...@@ -23,9 +22,7 @@ class CORE_EXPORT LayoutNGListItem final : public LayoutNGBlockFlow {
LayoutObject* Marker() const { LayoutObject* Marker() const {
Element* list_item = To<Element>(GetNode()); Element* list_item = To<Element>(GetNode());
if (PseudoElement* marker = list_item->GetPseudoElement(kPseudoIdMarker)) return list_item->PseudoElementLayoutObject(kPseudoIdMarker);
return marker->GetLayoutObject();
return nullptr;
} }
void UpdateMarkerTextIfNeeded(); void UpdateMarkerTextIfNeeded();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment