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 @@
#ifndef 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/layout/layout_block_flow.h"
#include "third_party/blink/renderer/core/layout/layout_list_marker.h"
......@@ -43,12 +42,11 @@ class LayoutListItem final : public LayoutBlockFlow {
LayoutListMarker* Marker() const {
Element* list_item = To<Element>(GetNode());
if (PseudoElement* marker = list_item->GetPseudoElement(kPseudoIdMarker)) {
if (LayoutObject* layout_object = marker->GetLayoutObject()) {
if (layout_object->IsListMarker())
return ToLayoutListMarker(layout_object);
NOTREACHED();
}
if (LayoutObject* marker =
list_item->PseudoElementLayoutObject(kPseudoIdMarker)) {
if (marker->IsListMarker())
return ToLayoutListMarker(marker);
NOTREACHED();
}
return nullptr;
}
......
......@@ -6,7 +6,6 @@
#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/dom/pseudo_element.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"
......@@ -23,9 +22,7 @@ class CORE_EXPORT LayoutNGListItem final : public LayoutNGBlockFlow {
LayoutObject* Marker() const {
Element* list_item = To<Element>(GetNode());
if (PseudoElement* marker = list_item->GetPseudoElement(kPseudoIdMarker))
return marker->GetLayoutObject();
return nullptr;
return list_item->PseudoElementLayoutObject(kPseudoIdMarker);
}
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