summaryrefslogtreecommitdiff
path: root/dom
diff options
context:
space:
mode:
authorFranklinDM <mrmineshafter17@gmail.com>2023-03-03 21:33:13 +0800
committerFranklinDM <mrmineshafter17@gmail.com>2023-03-04 21:32:10 +0800
commitfb9484caa34c14a91f3eca8c6465767c2ab00315 (patch)
tree963254f8e3e91f475c0d4d96080266c14ca4d1d1 /dom
parent4390724666af7d72d4334301acc410b2aa0f3b17 (diff)
downloaduxp-fb9484caa34c14a91f3eca8c6465767c2ab00315.tar.gz
Issue #2135 - Bug 1438129: Remove ShadowRoot.applyAuthorStyles.
Diffstat (limited to 'dom')
-rw-r--r--dom/base/ShadowRoot.cpp19
-rw-r--r--dom/base/ShadowRoot.h2
-rw-r--r--dom/tests/mochitest/webcomponents/test_shadowroot_style.html11
-rw-r--r--dom/webidl/ShadowRoot.webidl1
4 files changed, 2 insertions, 31 deletions
diff --git a/dom/base/ShadowRoot.cpp b/dom/base/ShadowRoot.cpp
index d4b63004ae..39859da4cf 100644
--- a/dom/base/ShadowRoot.cpp
+++ b/dom/base/ShadowRoot.cpp
@@ -488,25 +488,6 @@ ShadowRoot::Host()
return host->AsElement();
}
-bool
-ShadowRoot::ApplyAuthorStyles()
-{
- return mProtoBinding->InheritsStyle();
-}
-
-void
-ShadowRoot::SetApplyAuthorStyles(bool aApplyAuthorStyles)
-{
- mProtoBinding->SetInheritsStyle(aApplyAuthorStyles);
-
- nsIPresShell* shell = OwnerDoc()->GetShell();
- if (shell) {
- OwnerDoc()->BeginUpdate(UPDATE_STYLE);
- shell->RecordShadowStyleChange(this);
- OwnerDoc()->EndUpdate(UPDATE_STYLE);
- }
-}
-
void
ShadowRoot::AttributeChanged(nsIDocument* aDocument,
Element* aElement,
diff --git a/dom/base/ShadowRoot.h b/dom/base/ShadowRoot.h
index 63535c9a06..580099875d 100644
--- a/dom/base/ShadowRoot.h
+++ b/dom/base/ShadowRoot.h
@@ -59,8 +59,6 @@ public:
// [deprecated] Shadow DOM v0
void InsertSheet(StyleSheet* aSheet, nsIContent* aLinkingContent);
void RemoveSheet(StyleSheet* aSheet);
- bool ApplyAuthorStyles();
- void SetApplyAuthorStyles(bool aApplyAuthorStyles);
StyleSheetList* StyleSheets()
{
return &DocumentOrShadowRoot::EnsureDOMStyleSheets();
diff --git a/dom/tests/mochitest/webcomponents/test_shadowroot_style.html b/dom/tests/mochitest/webcomponents/test_shadowroot_style.html
index f310ff97c4..2f51b1ba9c 100644
--- a/dom/tests/mochitest/webcomponents/test_shadowroot_style.html
+++ b/dom/tests/mochitest/webcomponents/test_shadowroot_style.html
@@ -48,19 +48,12 @@ isnot(getComputedStyle(document.getElementById("bodydiv"), null).getPropertyValu
// Make sure that elements in the ShadowRoot are styled according to the ShadowRoot style.
is(getComputedStyle(divToStyle, null).getPropertyValue("height"), "100px", "ShadowRoot style sheets should apply to elements in ShadowRoot.");
-// Tests for applyAuthorStyles.
+// Tests for author styles not applying in a ShadowRoot.
var authorStyle = document.createElement("style");
authorStyle.innerHTML = ".fat { padding-right: 20px; padding-left: 30px; }";
document.body.appendChild(authorStyle);
-is(root.applyAuthorStyles, false, "applyAuthorStyles defaults to false.");
-isnot(getComputedStyle(divToStyle, null).getPropertyValue("padding-right"), "20px", "Author styles should not apply to ShadowRoot when ShadowRoot.applyAuthorStyles is false.");
-root.applyAuthorStyles = true;
-is(root.applyAuthorStyles, true, "applyAuthorStyles was set to true.");
-is(getComputedStyle(divToStyle, null).getPropertyValue("padding-right"), "20px", "Author styles should apply to ShadowRoot when ShadowRoot.applyAuthorStyles is true.");
-root.applyAuthorStyles = false;
-is(root.applyAuthorStyles, false, "applyAuthorStyles was set to false.");
-isnot(getComputedStyle(divToStyle, null).getPropertyValue("padding-right"), "20px", "Author styles should not apply to ShadowRoot when ShadowRoot.applyAuthorStyles is false.");
+isnot(iframeWin.getComputedStyle(divToStyle, null).getPropertyValue("padding-right"), "20px", "Author styles should not apply to ShadowRoot.");
// Test dynamic changes to style in ShadowRoot.
root.innerHTML = '<div id="divtostyle" class="dummy"></div>';
diff --git a/dom/webidl/ShadowRoot.webidl b/dom/webidl/ShadowRoot.webidl
index 83acd4161d..388f8e1501 100644
--- a/dom/webidl/ShadowRoot.webidl
+++ b/dom/webidl/ShadowRoot.webidl
@@ -31,6 +31,5 @@ interface ShadowRoot : DocumentFragment
HTMLCollection getElementsByClassName(DOMString classNames);
[CEReactions, SetterThrows, TreatNullAs=EmptyString]
attribute DOMString innerHTML;
- attribute boolean applyAuthorStyles;
};