Commit 50372cb5 authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

DCHECK on any Shadow DOM v0 or Custom Element v0 usage

With [1], all three Web Component v0 APIs have been disabled for any
external use through the WebIDL. This CL DCHECKs on two of the three,
to make sure no internal code is using these APIs. There are still
dependencies on HTML Imports (see crbug.com/1111843), so that API
will be left functional for now.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2195005

Bug: 937746, 1111843
Change-Id: Iba416e804828f8a0961dd4dbfbffc1159573c5e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2451299Reviewed-by: default avatarYu Han <yuzhehan@chromium.org>
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814280}
parent 40a16ab3
......@@ -1279,6 +1279,10 @@ ScriptValue Document::registerElement(ScriptState* script_state,
const AtomicString& name,
const ElementRegistrationOptions* options,
ExceptionState& exception_state) {
// TODO(crbug.com/937746): Anything caught by this DCHECK is using the
// now-removed Custom Elements v0 API.
DCHECK(false) << "Custom Elements v0 has been removed.";
if (!RegistrationContext()) {
exception_state.ThrowDOMException(
DOMExceptionCode::kNotSupportedError,
......
......@@ -3333,6 +3333,10 @@ const ElementInternals* Element::GetElementInternals() const {
}
ShadowRoot* Element::createShadowRoot(ExceptionState& exception_state) {
// TODO(crbug.com/937746): Anything caught by this DCHECK is using the
// now-removed Shadow DOM v0 API.
DCHECK(false) << "Shadow DOM v0 has been removed.";
DCHECK(RuntimeEnabledFeatures::ShadowDOMV0Enabled(GetExecutionContext()));
if (ShadowRoot* root = GetShadowRoot()) {
if (root->IsUserAgent()) {
......
......@@ -3115,6 +3115,11 @@ void Node::DecrementConnectedSubframeCount() {
}
StaticNodeList* Node::getDestinationInsertionPoints() {
// TODO(crbug.com/937746): Anything caught by this DCHECK is using the
// now-removed Shadow DOM v0 API.
DCHECK(false)
<< "Shadow DOM v0 has been removed (getDestinationInsertionPoints).";
UpdateDistributionForLegacyDistributedNodes();
HeapVector<Member<V0InsertionPoint>, 8> insertion_points;
CollectDestinationInsertionPoints(*this, insertion_points);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment