| Index: third_party/WebKit/Source/core/dom/Node.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
|
| index b6a7a56d31ed645f6b99c6b0f2a1318f155af947..3454897bbc798c792c8c4960ef9d20cc233b2b15 100644
|
| --- a/third_party/WebKit/Source/core/dom/Node.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Node.cpp
|
| @@ -2341,15 +2341,21 @@ void Node::setCustomElementState(CustomElementState newState)
|
|
|
| DCHECK(isHTMLElement());
|
| DCHECK_NE(V0Upgraded, getV0CustomElementState());
|
| +#if DCHECK_IS_ON()
|
| + bool wasDefined = toElement(this)->isDefined();
|
| +#endif
|
|
|
| setFlag(CustomElementFlag);
|
| if (newState == CustomElementState::Custom)
|
| setFlag(CustomElementCustomFlag);
|
| DCHECK(newState == getCustomElementState());
|
|
|
| - // TODO(kojii): Should fire pseudoStateChanged() when :defined selector is
|
| - // ready.
|
| - // toElement(this)->pseudoStateChanged(CSSSelector::PseudoDefined);
|
| + // When the state goes from Uncustomized to Undefined, and then to Custom,
|
| + // isDefined is always flipped.
|
| +#if DCHECK_IS_ON()
|
| + DCHECK_NE(wasDefined, toElement(this)->isDefined());
|
| +#endif
|
| + toElement(this)->pseudoStateChanged(CSSSelector::PseudoDefined);
|
| }
|
|
|
| void Node::setV0CustomElementState(V0CustomElementState newState)
|
|
|