Skip to content

Commit

Permalink
Remove Declarative Shadow DOM feature flags
Browse files Browse the repository at this point in the history
This feature shipped in M90, so clean up the flags.

Bug: 1042130
Change-Id: Ifb16476ca250bcd9ec3a8a6de9587af2b6c51e85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3187588
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Auto-Submit: Mason Freed <masonf@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#925800}
  • Loading branch information
mfreed7 authored and Chromium LUCI CQ committed Sep 28, 2021
1 parent 4a2ae1b commit aa9213b
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 36 deletions.
1 change: 0 additions & 1 deletion content/child/runtime_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
{"CompositeAfterPaint", blink::features::kCompositeAfterPaint},
{"ComputePressure", blink::features::kComputePressure,
kSetOnlyIfOverridden},
{"DeclarativeShadowDOM", blink::features::kDeclarativeShadowDOM},
{"DesktopPWAsSubApps", blink::features::kDesktopPWAsSubApps},
{"DocumentTransition", blink::features::kDocumentTransition},
// TODO(crbug.com/649162): Remove DialogFocusNewSpecBehavior after
Expand Down
4 changes: 0 additions & 4 deletions third_party/blink/common/features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -868,10 +868,6 @@ const base::Feature kSendCnameAliasesToSubresourceFilterFromRenderer{
"SendCnameAliasesToSubresourceFilterFromRenderer",
base::FEATURE_DISABLED_BY_DEFAULT};

// Enables the declarative Shadow DOM feature.
const base::Feature kDeclarativeShadowDOM{"DeclarativeShadowDOM",
base::FEATURE_ENABLED_BY_DEFAULT};

// Kill switch for the InterestCohort API origin trial, i.e. if disabled, the
// API exposure will be disabled regardless of the OT config.
// (See https://github.com/WICG/floc.)
Expand Down
2 changes: 0 additions & 2 deletions third_party/blink/public/common/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,6 @@ BLINK_COMMON_EXPORT extern const base::Feature kWebRtcDistinctWorkerThread;
BLINK_COMMON_EXPORT extern const base::Feature
kSendCnameAliasesToSubresourceFilterFromRenderer;

BLINK_COMMON_EXPORT extern const base::Feature kDeclarativeShadowDOM;

BLINK_COMMON_EXPORT extern const base::Feature kInterestCohortAPIOriginTrial;

BLINK_COMMON_EXPORT extern const base::Feature kInterestCohortFeaturePolicy;
Expand Down
4 changes: 0 additions & 4 deletions third_party/blink/renderer/core/dom/element.cc
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,6 @@ Node* Element::Clone(Document& factory, CloneChildrenFlag flag) const {
// 7. If node is a shadow host and the clone shadows flag is set, run these
// steps:
if (flag == CloneChildrenFlag::kCloneWithShadows) {
DCHECK(RuntimeEnabledFeatures::DeclarativeShadowDOMEnabled(
GetExecutionContext()));
auto* shadow_root = GetShadowRoot();
if (shadow_root && (shadow_root->GetType() == ShadowRootType::kOpen ||
shadow_root->GetType() == ShadowRootType::kClosed)) {
Expand Down Expand Up @@ -4771,8 +4769,6 @@ void Element::setInnerHTMLWithDeclarativeShadowDOMForTesting(
}

String Element::getInnerHTML(const GetInnerHTMLOptions* options) const {
DCHECK(RuntimeEnabledFeatures::DeclarativeShadowDOMEnabled(
GetExecutionContext()));
ClosedRootsSet include_closed_roots;
if (options->hasClosedRoots()) {
for (auto& shadow_root : options->closedRoots()) {
Expand Down
2 changes: 1 addition & 1 deletion third_party/blink/renderer/core/dom/element.idl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ callback ScrollStateCallback = void (ScrollState scrollState);
[CEReactions, RaisesException] void insertAdjacentHTML(DOMString position, HTMLString text);

// Declarative Shadow DOM getInnerHTML() function.
[Affects=Nothing, RuntimeEnabled=DeclarativeShadowDOM, MeasureAs=ElementGetInnerHTML] HTMLString getInnerHTML(optional GetInnerHTMLOptions options = {});
[Affects=Nothing, MeasureAs=ElementGetInnerHTML] HTMLString getInnerHTML(optional GetInnerHTMLOptions options = {});

// Pointer Lock
// https://w3c.github.io/pointerlock/#extensions-to-the-element-interface
Expand Down
4 changes: 1 addition & 3 deletions third_party/blink/renderer/core/dom/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1003,9 +1003,7 @@ Node* Node::cloneNode(bool deep, ExceptionState& exception_state) const {
// true, and the clone shadows flag set if this is a DocumentFragment whose
// host is an HTML template element.
auto* fragment = DynamicTo<DocumentFragment>(this);
bool clone_shadows_flag = fragment && fragment->IsTemplateContent() &&
RuntimeEnabledFeatures::DeclarativeShadowDOMEnabled(
GetExecutionContext());
bool clone_shadows_flag = fragment && fragment->IsTemplateContent();
return Clone(GetDocument(),
deep ? (clone_shadows_flag ? CloneChildrenFlag::kCloneWithShadows
: CloneChildrenFlag::kClone)
Expand Down
2 changes: 0 additions & 2 deletions third_party/blink/renderer/core/dom/shadow_root.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ String ShadowRoot::innerHTML() const {
}

String ShadowRoot::getInnerHTML(const GetInnerHTMLOptions* options) const {
DCHECK(RuntimeEnabledFeatures::DeclarativeShadowDOMEnabled(
GetExecutionContext()));
ClosedRootsSet include_closed_roots;
if (options->hasClosedRoots()) {
for (auto& shadow_root : options->closedRoots()) {
Expand Down
2 changes: 1 addition & 1 deletion third_party/blink/renderer/core/dom/shadow_root.idl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface ShadowRoot : DocumentFragment {
readonly attribute SlotAssignmentMode slotAssignment;

// Declarative Shadow DOM getInnerHTML() function.
[Affects=Nothing, RuntimeEnabled=DeclarativeShadowDOM, MeasureAs=ElementGetInnerHTML] HTMLString getInnerHTML(optional GetInnerHTMLOptions options = {});
[Affects=Nothing, MeasureAs=ElementGetInnerHTML] HTMLString getInnerHTML(optional GetInnerHTMLOptions options = {});
};

ShadowRoot includes DocumentOrShadowRoot;
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights
* reserved.
* Copyright (C) 2009, 2010 Google Inc. All rights reserved.
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All
* rights reserved. Copyright (C) 2009, 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand All @@ -24,7 +23,6 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "third_party/blink/renderer/core/editing/serializers/markup_accumulator.h"

#include "third_party/blink/renderer/core/dom/attr.h"
Expand Down Expand Up @@ -549,8 +547,6 @@ std::pair<Node*, Element*> MarkupAccumulator::GetAuxiliaryDOMTree(
ShadowRoot* shadow_root = element.GetShadowRoot();
if (!shadow_root || include_shadow_roots_ != kIncludeShadowRoots)
return std::pair<Node*, Element*>();
DCHECK(RuntimeEnabledFeatures::DeclarativeShadowDOMEnabled(
element.GetExecutionContext()));
AtomicString shadowroot_type;
switch (shadow_root->GetType()) {
case ShadowRootType::kUserAgent:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@
// }
// See https://github.com/mfreed7/declarative-shadow-dom/blob/master/README.md#feature-detection-and-polyfilling
// for more detail.
[RuntimeEnabled=DeclarativeShadowDOM, ImplementedAs=OpenShadowRoot] readonly attribute ShadowRoot? shadowRoot;
[ImplementedAs=OpenShadowRoot] readonly attribute ShadowRoot? shadowRoot;
};
Original file line number Diff line number Diff line change
Expand Up @@ -908,10 +908,6 @@ DeclarativeShadowRootType DeclarativeShadowRootTypeFromToken(
AtomicHTMLToken* token,
const Document& document,
bool include_shadow_roots) {
if (!RuntimeEnabledFeatures::DeclarativeShadowDOMEnabled(
document.GetExecutionContext())) {
return DeclarativeShadowRootType::kNone;
}
Attribute* type_attribute =
token->GetAttributeItem(html_names::kShadowrootAttr);
if (!type_attribute)
Expand Down Expand Up @@ -973,9 +969,7 @@ bool HTMLTreeBuilder::ProcessTemplateEndTag(AtomicHTMLToken* token) {
tree_.ActiveFormattingElements()->ClearToLastMarker();
template_insertion_modes_.pop_back();
ResetInsertionModeAppropriately();
if (RuntimeEnabledFeatures::DeclarativeShadowDOMEnabled(
shadow_host_stack_item->GetNode()->GetExecutionContext()) &&
template_stack_item) {
if (template_stack_item) {
DCHECK(template_stack_item->IsElementNode());
HTMLTemplateElement* template_element =
DynamicTo<HTMLTemplateElement>(template_stack_item->GetElement());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,10 +808,6 @@
name: "Database",
status: "stable",
},
{
name: "DeclarativeShadowDOM",
status: "stable",
},
{
name: "DecodeJpeg420ImagesToYUV",
status: "stable",
Expand Down

0 comments on commit aa9213b

Please sign in to comment.