Created
December 23, 2021 05:46
-
-
Save fujii/141f8b4f2fd0f0603e48a835e7a50222 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cl -std:c++20 /permissive- -c r20.cpp | |
// https://webkit.org/b/234546 | |
template<typename T> | |
struct RefPtr { | |
RefPtr(T* ptr) : m_ptr(ptr) { } | |
T* operator->() { return m_ptr; } | |
bool operator!() const { return !m_ptr; } | |
T* m_ptr; | |
}; | |
struct Element { | |
Element* parentElement(); | |
bool isSVGElement(); | |
}; | |
template<typename AnimationFunction> | |
class SVGPropertyAnimator { | |
public: | |
bool computeInheritedCSSPropertyValue(Element& targetElement) const | |
{ | |
RefPtr parent = targetElement.parentElement(); | |
return !(parent->isSVGElement()); | |
} | |
bool computeInheritedCSSPropertyValue2(Element& targetElement) const | |
{ | |
RefPtr parent = targetElement.parentElement(); | |
return !parent; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment