Source/WebCore/ChangeLog

 12020-11-13 Antoine Quint <graouts@webkit.org>
 2
 3 Support more properties on ::marker
 4 https://bugs.webkit.org/show_bug.cgi?id=218894
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 In preparation for the support of animations on ::marker and other pseudo-elements, we add support for animation and transition
 9 properties and add more rules to the user-agent stylesheet as defined by https://drafts.csswg.org/css-lists-3/#marker-properties.
 10
 11 * css/html.css:
 12 (::marker):
 13 * rendering/RenderListItem.cpp:
 14 (WebCore::RenderListItem::computeMarkerStyle const):
 15 * style/PropertyCascade.cpp:
 16 (WebCore::Style::isValidMarkerStyleProperty):
 17
1182020-11-11 Ziran Sun <zsun@igalia.com>
219
320 [css-grid] Percentage height on replaced item with scrollbar

Source/WebCore/css/html.css

@@li {
302302 text-align: -webkit-match-parent;
303303}
304304
 305/* FIXME: this should also match ::before::marker and ::after::marker but we don't support
 306 this yet. When we do, we can remove the code specific to ::before and ::after in
 307 RenderListItem::computeMarkerStyle(), see bugs.webkit.org/b/218897. */
305308::marker {
 309 unicode-bidi: isolate;
 310 font-variant-numeric: tabular-nums;
 311 white-space: pre;
306312 text-transform: none;
307313}
308314

Source/WebCore/rendering/RenderListItem.cpp

3131#include "HTMLUListElement.h"
3232#include "InlineElementBox.h"
3333#include "PseudoElement.h"
 34#include "RenderStyleConstants.h"
3435#include "RenderTreeBuilder.h"
3536#include "RenderView.h"
3637#include "StyleInheritedData.h"
 38#include "UnicodeBidi.h"
3739#include <wtf/IsoMallocInlines.h>
3840#include <wtf/StackStats.h>
3941#include <wtf/StdLibExtras.h>

@@RenderListItem::~RenderListItem()
5860
5961RenderStyle RenderListItem::computeMarkerStyle() const
6062{
 63 if (!is<PseudoElement>(element())) {
 64 auto markerStyle = getCachedPseudoStyle(PseudoId::Marker, &style());
 65 ASSERT(markerStyle);
 66 return RenderStyle::clone(*markerStyle);
 67 }
 68
6169 // The marker always inherits from the list item, regardless of where it might end
6270 // up (e.g., in some deeply nested line box). See CSS3 spec.
63  // FIXME: The marker should only inherit all font properties and the color property
64  // according to the CSS Pseudo-Elements Module Level 4 spec.
65  //
66  // Although the CSS Pseudo-Elements Module Level 4 spec. saids to add ::marker to the UA sheet
67  // we apply it here as an optimization because it only applies to markers. That is, it does not
68  // apply to all elements.
69  RenderStyle parentStyle = RenderStyle::clone(style());
 71 auto markerStyle = RenderStyle::create();
 72 markerStyle.inheritFrom(style());
 73
 74 // In the case of a ::before or ::after pseudo-element, we manually apply the properties
 75 // otherwise set in the user-agent stylesheet since we don't support ::before::marker or
 76 // ::after::marker. See bugs.webkit.org/b/218897.
7077 auto fontDescription = style().fontDescription();
7178 fontDescription.setVariantNumericSpacing(FontVariantNumericSpacing::TabularNumbers);
72  parentStyle.setFontDescription(WTFMove(fontDescription));
73  parentStyle.fontCascade().update(&document().fontSelector());
74  if (auto markerStyle = getCachedPseudoStyle(PseudoId::Marker, &parentStyle))
75  return RenderStyle::clone(*markerStyle);
76  auto markerStyle = RenderStyle::create();
77  markerStyle.inheritFrom(parentStyle);
 79 markerStyle.setFontDescription(WTFMove(fontDescription));
 80 markerStyle.fontCascade().update(&document().fontSelector());
 81 markerStyle.setUnicodeBidi(EUnicodeBidi::Isolate);
 82 markerStyle.setWhiteSpace(WhiteSpace::Pre);
 83 markerStyle.setTextTransform(TextTransform::None);
7884 return markerStyle;
7985}
8086

Source/WebCore/style/PropertyCascade.cpp

@@static inline bool shouldApplyPropertyInParseOrder(CSSPropertyID propertyID)
7070}
7171
7272// https://www.w3.org/TR/css-pseudo-4/#marker-pseudo (Editor's Draft, 25 July 2017)
 73// FIXME: this is outdated, see https://bugs.webkit.org/show_bug.cgi?id=218791.
7374static inline bool isValidMarkerStyleProperty(CSSPropertyID id)
7475{
7576 switch (id) {

@@static inline bool isValidMarkerStyleProperty(CSSPropertyID id)
9192 case CSSPropertyFontOpticalSizing:
9293 case CSSPropertyFontVariationSettings:
9394#endif
 95 case CSSPropertyAnimationDuration:
 96 case CSSPropertyAnimationTimingFunction:
 97 case CSSPropertyAnimationDelay:
 98 case CSSPropertyAnimationIterationCount:
 99 case CSSPropertyAnimationDirection:
 100 case CSSPropertyAnimationFillMode:
 101 case CSSPropertyAnimationPlayState:
 102 case CSSPropertyAnimationName:
 103 case CSSPropertyTransitionDuration:
 104 case CSSPropertyTransitionTimingFunction:
 105 case CSSPropertyTransitionDelay:
 106 case CSSPropertyTransitionProperty:
94107 return true;
95108 default:
96109 break;

LayoutTests/imported/w3c/ChangeLog

 12020-11-13 Antoine Quint <graouts@webkit.org>
 2
 3 Support more properties on ::marker
 4 https://bugs.webkit.org/show_bug.cgi?id=218894
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Mark some WPT progressions.
 9
 10 * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt:
 11
1122020-11-11 Rob Buis <rbuis@igalia.com>
213
314 Resync web-platform-tests/css/css-sizing/aspect-ratio from upstream

LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt

@@FAIL Property unicode-bidi value 'plaintext' in ::marker assert_equals: expected
2222FAIL Property direction value 'rtl' in ::marker assert_equals: expected "rtl" but got "ltr"
2323FAIL Property content value '"foo"' in ::marker assert_equals: expected "\"foo\"" but got ""
2424FAIL Property animation value '1s linear 2s infinite alternate forwards paused anim' in ::marker assert_equals: expected "1s linear 2s infinite alternate forwards paused anim" but got ""
25 FAIL Property animation-delay value '1s' in ::marker assert_equals: expected "1s" but got "0s"
26 FAIL Property animation-direction value 'alternate' in ::marker assert_equals: expected "alternate" but got "normal"
27 FAIL Property animation-duration value '2s' in ::marker assert_equals: expected "2s" but got "0s"
28 FAIL Property animation-fill-mode value 'forwards' in ::marker assert_equals: expected "forwards" but got "none"
29 FAIL Property animation-iteration-count value 'infinite' in ::marker assert_equals: expected "infinite" but got "1"
30 FAIL Property animation-name value 'anim' in ::marker assert_equals: expected "anim" but got "none"
31 FAIL Property animation-play-state value 'paused' in ::marker assert_equals: expected "paused" but got "running"
32 FAIL Property animation-timing-function value 'linear' in ::marker assert_equals: expected "linear" but got "ease"
33 FAIL Property transition value 'display 1s linear 2s' in ::marker assert_equals: expected "display 1s linear 2s" but got "all 0s ease 0s"
34 FAIL Property transition-delay value '1s' in ::marker assert_equals: expected "1s" but got "0s"
35 FAIL Property transition-duration value '2s' in ::marker assert_equals: expected "2s" but got "0s"
36 FAIL Property transition-property value 'display' in ::marker assert_equals: expected "display" but got "all"
37 FAIL Property transition-timing-function value 'linear' in ::marker assert_equals: expected "linear" but got "ease"
 25PASS Property animation-delay value '1s' in ::marker
 26PASS Property animation-direction value 'alternate' in ::marker
 27PASS Property animation-duration value '2s' in ::marker
 28PASS Property animation-fill-mode value 'forwards' in ::marker
 29PASS Property animation-iteration-count value 'infinite' in ::marker
 30PASS Property animation-name value 'anim' in ::marker
 31PASS Property animation-play-state value 'paused' in ::marker
 32PASS Property animation-timing-function value 'linear' in ::marker
 33PASS Property transition value 'display 1s linear 2s' in ::marker
 34PASS Property transition-delay value '1s' in ::marker
 35PASS Property transition-duration value '2s' in ::marker
 36PASS Property transition-property value 'display' in ::marker
 37PASS Property transition-timing-function value 'linear' in ::marker
3838PASS Property display value 'none' in ::marker
3939PASS Property position value 'absolute' in ::marker
4040PASS Property float value 'right' in ::marker