Changeset 269623 in webkit
- Timestamp:
- Nov 10, 2020 3:35:51 AM (21 months ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/animation/DeclarativeAnimation.cpp (modified) (1 diff)
-
Source/WebCore/animation/KeyframeEffect.cpp (modified) (1 diff)
-
Source/WebCore/animation/WebAnimationUtilities.cpp (modified) (1 diff)
-
Source/WebCore/animation/WebAnimationUtilities.h (modified) (1 diff)
-
Source/WebCore/dom/PseudoElement.cpp (modified) (1 diff)
-
Source/WebCore/dom/PseudoElement.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r269612 r269623 1 2020-11-10 Antoine Quint <graouts@webkit.org> 2 3 [Web Animations] KeyframeEffect.pseudoElement does not return a valid string when targeting ::marker or ::first-letter 4 https://bugs.webkit.org/show_bug.cgi?id=218741 5 <rdar://problem/71229846> 6 7 Reviewed by Dean Jackson. 8 9 Mark two new PASS results showing that KeyframeEffect.pseudoElement shows the correct value 10 when targeting ::marker or ::first-letter. 11 12 * web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt: 13 1 14 2020-11-09 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt
r267649 r269623 144 144 PASS animate() with pseudoElement an Animation object targeting the correct pseudo-element 145 145 PASS animate() with pseudoElement without content creates an Animation object targeting the correct pseudo-element 146 FAIL animate() with pseudoElement an Animation object targeting the correct pseudo-element for ::marker assert_equals: The returned Animation targets the correct selector expected "::marker" but got "" 147 FAIL animate() with pseudoElement an Animation object targeting the correct pseudo-element for ::first-line assert_equals: The returned Animation targets the correct selector expected "::first-line" but got "" 146 PASS animate() with pseudoElement an Animation object targeting the correct pseudo-element for ::marker 147 PASS animate() with pseudoElement an Animation object targeting the correct pseudo-element for ::first-line 148 148 PASS animate() with a non-null invalid pseudoElement '' throws a SyntaxError 149 149 PASS animate() with a non-null invalid pseudoElement 'before' throws a SyntaxError -
trunk/Source/WebCore/ChangeLog
r269622 r269623 1 2020-11-10 Antoine Quint <graouts@webkit.org> 2 3 [Web Animations] KeyframeEffect.pseudoElement does not return a valid string when targeting ::marker or ::first-letter 4 https://bugs.webkit.org/show_bug.cgi?id=218741 5 <rdar://problem/71229846> 6 7 Reviewed by Dean Jackson. 8 9 We used to use PseudoElement::pseudoElementNameForEvents() to go from PseudoId to a String, but PseudoElement 10 only knows about ::before and ::after and not about valid pseudo-elements. We remove that method and create an 11 equivalent in WebAnimationUtilities that knows about all public pseudo-elements. 12 13 * animation/DeclarativeAnimation.cpp: 14 (WebCore::DeclarativeAnimation::enqueueDOMEvent): 15 * animation/KeyframeEffect.cpp: 16 (WebCore::KeyframeEffect::pseudoElement const): 17 * animation/WebAnimationUtilities.cpp: 18 (WebCore::pseudoIdAsString): 19 * animation/WebAnimationUtilities.h: 20 * dom/PseudoElement.cpp: 21 (WebCore::PseudoElement::pseudoElementNameForEvents): Deleted. 22 * dom/PseudoElement.h: 23 1 24 2020-11-10 Martin Robinson <mrobinson@igalia.com> 2 25 -
trunk/Source/WebCore/animation/DeclarativeAnimation.cpp
r267571 r269623 351 351 352 352 auto time = secondsToWebAnimationsAPITime(elapsedTime) / 1000; 353 const auto& pseudoId = PseudoElement::pseudoElementNameForEvents(m_owningPseudoId);353 auto pseudoId = pseudoIdAsString(m_owningPseudoId); 354 354 auto timelineTime = timeline() ? timeline()->currentTime() : WTF::nullopt; 355 355 auto event = createEvent(eventType, time, pseudoId, timelineTime); -
trunk/Source/WebCore/animation/KeyframeEffect.cpp
r268932 r269623 1178 1178 // When the effect target is a pseudo-element, this specifies the pseudo-element selector (e.g. ::before). 1179 1179 if (targetsPseudoElement()) 1180 return PseudoElement::pseudoElementNameForEvents(m_pseudoId);1180 return pseudoIdAsString(m_pseudoId); 1181 1181 return { }; 1182 1182 } -
trunk/Source/WebCore/animation/WebAnimationUtilities.cpp
r267571 r269623 179 179 } 180 180 181 String pseudoIdAsString(PseudoId pseudoId) 182 { 183 static NeverDestroyed<const String> after(MAKE_STATIC_STRING_IMPL("::after")); 184 static NeverDestroyed<const String> before(MAKE_STATIC_STRING_IMPL("::before")); 185 static NeverDestroyed<const String> firstLetter(MAKE_STATIC_STRING_IMPL("::first-letter")); 186 static NeverDestroyed<const String> firstLine(MAKE_STATIC_STRING_IMPL("::first-line")); 187 static NeverDestroyed<const String> highlight(MAKE_STATIC_STRING_IMPL("::highlight")); 188 static NeverDestroyed<const String> marker(MAKE_STATIC_STRING_IMPL("::marker")); 189 static NeverDestroyed<const String> selection(MAKE_STATIC_STRING_IMPL("::selection")); 190 static NeverDestroyed<const String> scrollbar(MAKE_STATIC_STRING_IMPL("::scrollbar")); 191 switch (pseudoId) { 192 case PseudoId::After: 193 return after; 194 case PseudoId::Before: 195 return before; 196 case PseudoId::FirstLetter: 197 return firstLetter; 198 case PseudoId::FirstLine: 199 return firstLine; 200 case PseudoId::Highlight: 201 return highlight; 202 case PseudoId::Marker: 203 return marker; 204 case PseudoId::Selection: 205 return selection; 206 case PseudoId::Scrollbar: 207 return scrollbar; 208 default: 209 return emptyString(); 210 } 211 } 212 181 213 } // namespace WebCore -
trunk/Source/WebCore/animation/WebAnimationUtilities.h
r261470 r269623 52 52 53 53 bool compareAnimationsByCompositeOrder(const WebAnimation&, const WebAnimation&); 54 String pseudoIdAsString(PseudoId); 54 55 55 56 } // namespace WebCore -
trunk/Source/WebCore/dom/PseudoElement.cpp
r267571 r269623 49 49 } 50 50 51 String PseudoElement::pseudoElementNameForEvents(PseudoId pseudoId)52 {53 static NeverDestroyed<const String> after(MAKE_STATIC_STRING_IMPL("::after"));54 static NeverDestroyed<const String> before(MAKE_STATIC_STRING_IMPL("::before"));55 switch (pseudoId) {56 case PseudoId::After:57 return after;58 case PseudoId::Before:59 return before;60 default:61 return emptyString();62 }63 }64 65 51 PseudoElement::PseudoElement(Element& host, PseudoId pseudoId) 66 52 : Element(pseudoElementTagName(), host.document(), CreatePseudoElement) -
trunk/Source/WebCore/dom/PseudoElement.h
r260139 r269623 47 47 bool canContainRangeEndPoint() const override { return false; } 48 48 49 static String pseudoElementNameForEvents(PseudoId);50 51 49 private: 52 50 PseudoElement(Element&, PseudoId);
Note: See TracChangeset
for help on using the changeset viewer.