Bug 1687127 - Remove dom.expose-incomplete-stylesheets. r=boris

Shipped in 84 (bug 1673885).

Differential Revision: https://phabricator.services.mozilla.com/D102090
This commit is contained in:
Emilio Cobos Álvarez 2021-01-19 22:21:09 +00:00
parent 99540873a3
commit b3eef044a7
4 changed files with 7 additions and 26 deletions

View File

@ -70,11 +70,10 @@ LinkStyle::LinkStyle()
LinkStyle::~LinkStyle() { LinkStyle::SetStyleSheet(nullptr); }
StyleSheet* LinkStyle::GetSheetForBindings() const {
if (!StaticPrefs::dom_expose_incomplete_stylesheets() && mStyleSheet &&
!mStyleSheet->IsComplete()) {
return nullptr;
if (mStyleSheet && mStyleSheet->IsComplete()) {
return mStyleSheet;
}
return mStyleSheet;
return nullptr;
}
void LinkStyle::GetTitleAndMediaForElement(const Element& aSelf,
@ -215,8 +214,7 @@ Result<LinkStyle::Update, nsresult> LinkStyle::DoUpdateStyleSheet(
//
// We want to do this even if updates are disabled, since otherwise a sheet
// with a stale linking element pointer will be hanging around -- not good!
if (mStyleSheet->IsComplete() ||
StaticPrefs::dom_expose_incomplete_stylesheets()) {
if (mStyleSheet->IsComplete()) {
if (aOldShadowRoot) {
aOldShadowRoot->RemoveStyleSheet(*mStyleSheet);
} else {
@ -252,8 +250,7 @@ Result<LinkStyle::Update, nsresult> LinkStyle::DoUpdateStyleSheet(
}
if (mStyleSheet) {
if (mStyleSheet->IsComplete() ||
StaticPrefs::dom_expose_incomplete_stylesheets()) {
if (mStyleSheet->IsComplete()) {
if (thisContent.IsInShadowTree()) {
ShadowRoot* containingShadow = thisContent.GetContainingShadow();
// Could be null only during unlink.

View File

@ -1702,7 +1702,7 @@ Result<Loader::LoadSheetResult, nsresult> Loader::LoadInlineStyle(
if (auto* linkStyle = LinkStyle::FromNodeOrNull(aInfo.mContent)) {
linkStyle->SetStyleSheet(sheet);
}
if (StaticPrefs::dom_expose_incomplete_stylesheets() || sheet->IsComplete()) {
if (sheet->IsComplete()) {
InsertSheetInTree(*sheet, aInfo.mContent);
}
@ -1805,7 +1805,7 @@ Result<Loader::LoadSheetResult, nsresult> Loader::LoadStyleLink(
if (auto* linkStyle = LinkStyle::FromNodeOrNull(aInfo.mContent)) {
linkStyle->SetStyleSheet(sheet);
}
if (StaticPrefs::dom_expose_incomplete_stylesheets() || sheet->IsComplete()) {
if (sheet->IsComplete()) {
InsertSheetInTree(*sheet, aInfo.mContent);
}

View File

@ -342,12 +342,6 @@ void SharedStyleSheetCache::LoadCompletedInternal(
// Insert the sheet into the tree now the sheet has loaded, but only if
// the sheet is still relevant, and if this is a top-level sheet.
const bool needInsertIntoTree = [&] {
if (StaticPrefs::dom_expose_incomplete_stylesheets()) {
// No need to do that, it's already done. This is technically a bit
// racy, but having to reload if you hit an in-progress load while
// switching the pref from about:config is not a big deal.
return false;
}
if (!data->mLoader->GetDocument()) {
// Not a document load, nothing to do.
return false;

View File

@ -2214,16 +2214,6 @@
value: true
mirror: always
# Whether the LinkStyle.sheet and DocumentOrShadowRoot.styleSheets accessor
# exposes in-progress-loading stylesheets.
#
# Historical behavior is `true`, but other browsers (and also a bit of common
# sense) match `false`.
- name: dom.expose-incomplete-stylesheets
type: bool
value: false
mirror: always
# Whether the Large-Allocation header is enabled.
- name: dom.largeAllocationHeader.enabled
type: bool