Bug 218894 - Support more properties on ::marker
Summary: Support more properties on ::marker
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks: 218792
  Show dependency treegraph
 
Reported: 2020-11-13 02:28 PST by Antoine Quint
Modified: 2020-11-16 13:19 PST (History)
12 users (show)

See Also:


Attachments
Patch (7.78 KB, patch)
2020-11-13 02:30 PST, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (9.81 KB, patch)
2020-11-13 05:22 PST, Antoine Quint
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2020-11-13 02:28:43 PST
Support more properties on ::marker
Comment 1 Antoine Quint 2020-11-13 02:30:40 PST
Created attachment 414020 [details]
Patch
Comment 2 Antti Koivisto 2020-11-13 04:48:25 PST
Comment on attachment 414020 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=414020&action=review

> Source/WebCore/css/html.css:305
>  ::marker {

You could add a comment here saying that the ::before/::after are handled by computeMarkerStyle.

> Source/WebCore/rendering/RenderListItem.cpp:75
>      RenderStyle parentStyle = RenderStyle::clone(style());
>      auto fontDescription = style().fontDescription();
> -    fontDescription.setVariantNumericSpacing(FontVariantNumericSpacing::TabularNumbers);
> +    if (is<PseudoElement>(element()))
> +        fontDescription.setVariantNumericSpacing(FontVariantNumericSpacing::TabularNumbers);
>      parentStyle.setFontDescription(WTFMove(fontDescription));
>      parentStyle.fontCascade().update(&document().fontSelector());
>      if (auto markerStyle = getCachedPseudoStyle(PseudoId::Marker, &parentStyle))

This seems overly hackish. If I understand correctly this function should have two branches. 

1) The regular one that just does getCachedPseudoStyle(PseudoId::Marker, &style()) and nothing else a
2) A hack branch for is<PseudoElement> case where it initializes all of ::marker UA style (including unicode-bidi and white-space). It doesn't need to call getCachedPseudoStyle since it won't work.
Comment 3 Antoine Quint 2020-11-13 05:22:25 PST
Created attachment 414033 [details]
Patch
Comment 4 Radar WebKit Bug Importer 2020-11-13 05:26:46 PST
<rdar://problem/71368343>
Comment 5 Antoine Quint 2020-11-13 06:32:45 PST
Committed r269774: <https://trac.webkit.org/changeset/269774>