diff --git a/devtools/server/actors/utils/stylesheets-manager.js b/devtools/server/actors/utils/stylesheets-manager.js index 00b980d068bc..9bada7757728 100644 --- a/devtools/server/actors/utils/stylesheets-manager.js +++ b/devtools/server/actors/utils/stylesheets-manager.js @@ -997,8 +997,8 @@ class StyleSheetsManager extends EventEmitter { // FIXME(bug 1826538): Make accessiblecaret.css and similar UA-widget // sheets system sheets, then remove this special-case. if ( - href === "resource://content-accessible/accessiblecaret.css" || - href === "resource://content-accessible/details.css" || + href === "resource://gre-resources/accessiblecaret.css" || + href === "resource://gre-resources/details.css" || (href === "resource://devtools-highlighter-styles/highlighters.css" && this.#targetActor.sessionContext.type !== "all") ) { diff --git a/dom/base/ShadowRoot.cpp b/dom/base/ShadowRoot.cpp index ad6eb3d328f7..c13a2b492acf 100644 --- a/dom/base/ShadowRoot.cpp +++ b/dom/base/ShadowRoot.cpp @@ -23,6 +23,7 @@ #include "mozilla/dom/TrustedTypeUtils.h" #include "mozilla/dom/TrustedTypesConstants.h" #include "mozilla/dom/UnbindContext.h" +#include "mozilla/GlobalStyleSheetCache.h" #include "mozilla/EventDispatcher.h" #include "mozilla/IdentifierMapEntry.h" #include "mozilla/PresShell.h" @@ -548,6 +549,15 @@ void ShadowRoot::StyleSheetApplicableStateChanged(StyleSheet& aSheet) { } } +void ShadowRoot::AppendBuiltInStyleSheet(BuiltInStyleSheet aSheet) { + auto* cache = GlobalStyleSheetCache::Singleton(); + // NOTE(emilio): It's important to Clone() the stylesheet to avoid leaking, + // since the built-in sheet is kept alive forever, and AppendStyleSheet will + // set the associated global of the stylesheet. + RefPtr sheet = cache->BuiltInSheet(aSheet)->Clone(nullptr, nullptr); + AppendStyleSheet(*sheet); +} + void ShadowRoot::RemoveSheetFromStyles(StyleSheet& aSheet) { MOZ_ASSERT(aSheet.IsApplicable()); MOZ_ASSERT(mServoStyles); diff --git a/dom/base/ShadowRoot.h b/dom/base/ShadowRoot.h index d3545852f2f4..3464da9ab3c4 100644 --- a/dom/base/ShadowRoot.h +++ b/dom/base/ShadowRoot.h @@ -29,6 +29,7 @@ class EventChainPreVisitor; class ServoStyleRuleMap; enum class StyleRuleChangeKind : uint32_t; +enum class BuiltInStyleSheet : uint8_t; namespace css { class Rule; @@ -98,6 +99,9 @@ class ShadowRoot final : public DocumentFragment, public DocumentOrShadowRoot { void SheetCloned(StyleSheet&); void StyleSheetApplicableStateChanged(StyleSheet&); + // Adds a built-in author style-sheet to the shadow tree. + void AppendBuiltInStyleSheet(BuiltInStyleSheet); + /** * Clones internal state, for example stylesheets, of aOther to 'this'. */ diff --git a/dom/html/HTMLDetailsElement.cpp b/dom/html/HTMLDetailsElement.cpp index fe1c8382f7cf..3af0423e303b 100644 --- a/dom/html/HTMLDetailsElement.cpp +++ b/dom/html/HTMLDetailsElement.cpp @@ -101,20 +101,7 @@ void HTMLDetailsElement::SetupShadowTree() { nsNodeInfoManager* nim = OwnerDoc()->NodeInfoManager(); RefPtr slotNodeInfo = nim->GetNodeInfo( nsGkAtoms::slot, nullptr, kNameSpaceID_XHTML, nsINode::ELEMENT_NODE); - { - RefPtr linkNodeInfo = nim->GetNodeInfo( - nsGkAtoms::link, nullptr, kNameSpaceID_XHTML, nsINode::ELEMENT_NODE); - RefPtr link = - NS_NewHTMLLinkElement(linkNodeInfo.forget()); - if (NS_WARN_IF(!link)) { - return; - } - link->SetAttr(nsGkAtoms::rel, u"stylesheet"_ns, IgnoreErrors()); - link->SetAttr(nsGkAtoms::href, - u"resource://content-accessible/details.css"_ns, - IgnoreErrors()); - sr->AppendChildTo(link, kNotify, IgnoreErrors()); - } + sr->AppendBuiltInStyleSheet(BuiltInStyleSheet::Details); { RefPtr slot = NS_NewHTMLSlotElement(do_AddRef(slotNodeInfo)); diff --git a/layout/base/AccessibleCaret.cpp b/layout/base/AccessibleCaret.cpp index 6812774f23f6..4dbe49ae2e3f 100644 --- a/layout/base/AccessibleCaret.cpp +++ b/layout/base/AccessibleCaret.cpp @@ -8,6 +8,8 @@ #include "AccessibleCaretLogger.h" #include "mozilla/Assertions.h" +#include "mozilla/BuiltInStyleSheets.h" +#include "mozilla/Components.h" #include "mozilla/ErrorResult.h" #include "mozilla/FloatingPoint.h" #include "mozilla/PresShell.h" @@ -23,6 +25,7 @@ #include "nsIFrame.h" #include "nsLayoutUtils.h" #include "nsPlaceholderFrame.h" +#include "nsIPrefetchService.h" namespace mozilla { using namespace dom; @@ -203,7 +206,6 @@ void AccessibleCaret::CreateCaretElement() const { // Content structure of AccessibleCaret //
<- CaretElement() // <#shadow-root> - // //
<- TextOverlayElement() //
<- CaretImageElement() @@ -216,19 +218,12 @@ void AccessibleCaret::CreateCaretElement() const { ShadowRoot* root = mCaretElementHolder->Root(); Document* doc = host.OwnerDoc(); { - RefPtr linkNodeInfo = doc->NodeInfoManager()->GetNodeInfo( - nsGkAtoms::link, nullptr, kNameSpaceID_XHTML, nsINode::ELEMENT_NODE); - RefPtr link = - NS_NewHTMLLinkElement(linkNodeInfo.forget()); - if (NS_WARN_IF(!link)) { - return; - } - link->SetAttr(nsGkAtoms::rel, u"stylesheet"_ns, IgnoreErrors()); - link->SetAttr(nsGkAtoms::href, - u"resource://content-accessible/accessiblecaret.css"_ns, - IgnoreErrors()); - root->AppendChildTo(link, kNotify, IgnoreErrors()); + // FIXME(emilio): This papers over prefetch service initialization order + // issues, see bug 1968390. + nsCOMPtr prefetchService(components::Prefetch::Service()); + Unused << prefetchService; } + root->AppendBuiltInStyleSheet(BuiltInStyleSheet::AccessibleCaret); auto CreateAndAppendChildElement = [&](const nsLiteralString& aElementId) { RefPtr child = doc->CreateHTMLElement(nsGkAtoms::div); diff --git a/layout/base/tests/browser_stylesheet_change_events.js b/layout/base/tests/browser_stylesheet_change_events.js index c86719705070..092b2d83f289 100644 --- a/layout/base/tests/browser_stylesheet_change_events.js +++ b/layout/base/tests/browser_stylesheet_change_events.js @@ -41,7 +41,7 @@ async function testApplicableStateChangeEvent(testRoot) { // accessiblecaret.css might be reported, interfering with the test // assertions, so let's ignore it return ( - e.stylesheet?.href === "resource://content-accessible/accessiblecaret.css" + e.stylesheet?.href === "resource://gre-resources/accessiblecaret.css" ); } diff --git a/layout/style/BuiltInStyleSheetList.h b/layout/style/BuiltInStyleSheetList.h new file mode 100644 index 000000000000..3b30631585ec --- /dev/null +++ b/layout/style/BuiltInStyleSheetList.h @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* list of user agent style sheets that GlobalStyleSheetCache manages */ + +/* + * STYLE_SHEET(identifier_, url_, flags_) + * + * identifier_ + * An identifier for the style sheet, suitable for use as an enum class value. + * + * url_ + * The URL of the style sheet. + * + * flags_ + * UserStyleSheetType indicating whether the sheet can be safely placed in + * shared memory, and the kind of sheet it is. + */ + +STYLE_SHEET(ContentEditable, "resource://gre/res/contenteditable.css", UA) +STYLE_SHEET(CounterStyles, "resource://gre-resources/counterstyles.css", UA) +STYLE_SHEET(Forms, "resource://gre-resources/forms.css", UA) +STYLE_SHEET(HTML, "resource://gre-resources/html.css", UA) +STYLE_SHEET(MathML, "resource://gre-resources/mathml.css", UA) +STYLE_SHEET(NoFrames, "resource://gre-resources/noframes.css", UA) +STYLE_SHEET(Quirk, "resource://gre-resources/quirk.css", UA) +STYLE_SHEET(Scrollbars, "resource://gre-resources/scrollbars.css", UA) +STYLE_SHEET(SVG, "resource://gre/res/svg.css", UA) +STYLE_SHEET(UA, "resource://gre-resources/ua.css", UA) +STYLE_SHEET(XUL, "chrome://global/content/xul.css", UAUnshared) +STYLE_SHEET(AccessibleCaret, "resource://gre-resources/accessiblecaret.css", Author) +STYLE_SHEET(Details, "resource://gre-resources/details.css", Author) diff --git a/layout/style/BuiltInStyleSheets.h b/layout/style/BuiltInStyleSheets.h new file mode 100644 index 000000000000..078f10b65ffa --- /dev/null +++ b/layout/style/BuiltInStyleSheets.h @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* an identifier for User Agent style sheets */ + +#ifndef mozilla_BuiltInStyleSheets_h +#define mozilla_BuiltInStyleSheets_h + +#include +#include "mozilla/TypedEnumBits.h" + +namespace mozilla { + +enum class BuiltInStyleSheetFlags : uint8_t { + UA = 1, + Author = 1 << 1, + // By default sheets are shared, except xul.css which we only need in the + // parent process. + NotShared = 1 << 2, + + UAUnshared = (UA | NotShared), +}; + +MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(BuiltInStyleSheetFlags); + +enum class BuiltInStyleSheet : uint8_t { +#define STYLE_SHEET(identifier_, url_, flags_) identifier_, +#include "mozilla/BuiltInStyleSheetList.h" +#undef STYLE_SHEET + Count +}; + +} // namespace mozilla + +#endif // mozilla_BuiltInStyleSheets_h diff --git a/layout/style/GlobalStyleSheetCache.cpp b/layout/style/GlobalStyleSheetCache.cpp index 24e0e5352a3e..68162af0e83c 100644 --- a/layout/style/GlobalStyleSheetCache.cpp +++ b/layout/style/GlobalStyleSheetCache.cpp @@ -19,6 +19,7 @@ #include "mozilla/dom/SRIMetadata.h" #include "mozilla/ipc/SharedMemoryHandle.h" #include "mozilla/ipc/SharedMemoryMapping.h" +#include "mozilla/ServoBindings.h" #include "MainThreadUtils.h" #include "nsContentUtils.h" #include "nsIConsoleService.h" @@ -30,8 +31,6 @@ #include "nsServiceManagerUtils.h" #include "nsXULAppAPI.h" -#include - namespace mozilla { // The GlobalStyleSheetCache is responsible for sharing user agent style sheet @@ -130,15 +129,30 @@ nsresult GlobalStyleSheetCache::Observe(nsISupports* aSubject, return NS_OK; } -#define STYLE_SHEET(identifier_, url_, shared_) \ - NotNull GlobalStyleSheetCache::identifier_##Sheet() { \ - if (!m##identifier_##Sheet) { \ - m##identifier_##Sheet = LoadSheetURL(url_, eAgentSheetFeatures, eCrash); \ - } \ - return WrapNotNull(m##identifier_##Sheet); \ - } -#include "mozilla/UserAgentStyleSheetList.h" +static constexpr struct { + nsLiteralCString mURL; + BuiltInStyleSheetFlags mFlags; +} kBuiltInSheetInfo[] = { +#define STYLE_SHEET(identifier_, url_, flags_) \ + {nsLiteralCString(url_), BuiltInStyleSheetFlags::flags_}, +#include "mozilla/BuiltInStyleSheetList.h" #undef STYLE_SHEET +}; + +NotNull GlobalStyleSheetCache::BuiltInSheet( + BuiltInStyleSheet aSheet) { + auto& slot = mBuiltIns[aSheet]; + if (!slot) { + const auto& info = kBuiltInSheetInfo[size_t(aSheet)]; + const auto parsingMode = (info.mFlags & BuiltInStyleSheetFlags::UA) + ? eAgentSheetFeatures + : eAuthorSheetFeatures; + MOZ_ASSERT(info.mFlags & BuiltInStyleSheetFlags::UA || + info.mFlags & BuiltInStyleSheetFlags::Author); + slot = LoadSheetURL(info.mURL, parsingMode, eCrash); + } + return WrapNotNull(slot); +} StyleSheet* GlobalStyleSheetCache::GetUserContentSheet() { return mUserContentSheet; @@ -194,9 +208,9 @@ size_t GlobalStyleSheetCache::SizeOfIncludingThis( #define MEASURE(s) n += s ? s->SizeOfIncludingThis(aMallocSizeOf) : 0; -#define STYLE_SHEET(identifier_, url_, shared_) MEASURE(m##identifier_##Sheet); -#include "mozilla/UserAgentStyleSheetList.h" -#undef STYLE_SHEET + for (const auto& sheet : mBuiltIns) { + MEASURE(sheet); + } MEASURE(mUserChromeSheet); MEASURE(mUserContentSheet); @@ -270,21 +284,25 @@ GlobalStyleSheetCache::GlobalStyleSheetCache() { reinterpret_cast(sSharedMemory.data())) { MOZ_RELEASE_ASSERT(header->mMagic == Header::kMagic); -#define STYLE_SHEET(identifier_, url_, shared_) \ - if (shared_) { \ - LoadSheetFromSharedMemory(url_, &m##identifier_##Sheet, \ - eAgentSheetFeatures, header, \ - UserAgentStyleSheetID::identifier_); \ - } -#include "mozilla/UserAgentStyleSheetList.h" -#undef STYLE_SHEET + for (auto kind : MakeEnumeratedRange(BuiltInStyleSheet::Count)) { + const auto& info = kBuiltInSheetInfo[size_t(kind)]; + if (info.mFlags & BuiltInStyleSheetFlags::NotShared) { + continue; + } + const auto parsingMode = (info.mFlags & BuiltInStyleSheetFlags::UA) + ? eAgentSheetFeatures + : eAuthorSheetFeatures; + LoadSheetFromSharedMemory(info.mURL, &mBuiltIns[kind], parsingMode, + header, kind); + } } } } void GlobalStyleSheetCache::LoadSheetFromSharedMemory( - const char* aURL, RefPtr* aSheet, SheetParsingMode aParsingMode, - const Header* aHeader, UserAgentStyleSheetID aSheetID) { + const nsACString& aURL, RefPtr* aSheet, + SheetParsingMode aParsingMode, const Header* aHeader, + BuiltInStyleSheet aSheetID) { auto i = size_t(aSheetID); auto sheet = @@ -377,19 +395,20 @@ void GlobalStyleSheetCache::InitSharedSheetsInParent() { // Normally calling ToShared on UA sheets should not fail. It happens // in practice in odd cases that seem like corrupted installations; see bug // 1621773. On failure, return early and fall back to non-shared sheets. -#define STYLE_SHEET(identifier_, url_, shared_) \ - if (shared_) { \ - StyleSheet* sheet = identifier_##Sheet(); \ - size_t i = size_t(UserAgentStyleSheetID::identifier_); \ - URLExtraData::sShared[i] = sheet->URLData(); \ - header->mSheets[i] = sheet->ToShared(builder.get(), message); \ - if (!header->mSheets[i]) { \ - CrashReporter::AppendAppNotesToCrashReport("\n"_ns + message); \ - return; \ - } \ + for (auto kind : MakeEnumeratedRange(BuiltInStyleSheet::Count)) { + auto i = size_t(kind); + const auto& info = kBuiltInSheetInfo[i]; + if (info.mFlags & BuiltInStyleSheetFlags::NotShared) { + continue; + } + StyleSheet* sheet = BuiltInSheet(kind); + URLExtraData::sShared[i] = sheet->URLData(); + header->mSheets[i] = sheet->ToShared(builder.get(), message); + if (!header->mSheets[i]) { + CrashReporter::AppendAppNotesToCrashReport("\n"_ns + message); + return; + } } -#include "mozilla/UserAgentStyleSheetList.h" -#undef STYLE_SHEET // Finished writing into the shared memory. Freeze it, so that a process // can't confuse other processes by changing the UA style sheet contents. @@ -479,7 +498,7 @@ void GlobalStyleSheetCache::InitFromProfile() { } RefPtr GlobalStyleSheetCache::LoadSheetURL( - const char* aURL, SheetParsingMode aParsingMode, + const nsACString& aURL, SheetParsingMode aParsingMode, FailureAction aFailureAction) { nsCOMPtr uri; NS_NewURI(getter_AddRefs(uri), aURL); diff --git a/layout/style/GlobalStyleSheetCache.h b/layout/style/GlobalStyleSheetCache.h index aff88d480f35..1bdc58909e36 100644 --- a/layout/style/GlobalStyleSheetCache.h +++ b/layout/style/GlobalStyleSheetCache.h @@ -10,11 +10,11 @@ #include "nsIMemoryReporter.h" #include "nsIObserver.h" #include "mozilla/Attributes.h" +#include "mozilla/BuiltInStyleSheets.h" #include "mozilla/MemoryReporting.h" #include "mozilla/PreferenceSheet.h" #include "mozilla/NotNull.h" #include "mozilla/StaticPtr.h" -#include "mozilla/UserAgentStyleSheetID.h" #include "mozilla/css/Loader.h" #include "mozilla/ipc/SharedMemoryHandle.h" #include "mozilla/ipc/SharedMemoryMapping.h" @@ -43,11 +43,15 @@ class GlobalStyleSheetCache final : public nsIObserver, static GlobalStyleSheetCache* Singleton(); -#define STYLE_SHEET(identifier_, url_, shared_) \ - NotNull identifier_##Sheet(); -#include "mozilla/UserAgentStyleSheetList.h" +#define STYLE_SHEET(identifier_, url_, flags_) \ + NotNull identifier_##Sheet() { \ + return BuiltInSheet(BuiltInStyleSheet::identifier_); \ + } +#include "mozilla/BuiltInStyleSheetList.h" #undef STYLE_SHEET + NotNull BuiltInSheet(BuiltInStyleSheet); + StyleSheet* GetUserContentSheet(); StyleSheet* GetUserChromeSheet(); @@ -87,7 +91,7 @@ class GlobalStyleSheetCache final : public nsIObserver, struct Header { static constexpr uint32_t kMagic = 0x55415353; uint32_t mMagic; // Must be set to kMagic. - const StyleLockedCssRules* mSheets[size_t(UserAgentStyleSheetID::Count)]; + const StyleLockedCssRules* mSheets[size_t(BuiltInStyleSheet::Count)]; uint8_t mBuffer[1]; }; @@ -97,25 +101,25 @@ class GlobalStyleSheetCache final : public nsIObserver, void InitFromProfile(); void InitSharedSheetsInParent(); void InitMemoryReporter(); - RefPtr LoadSheetURL(const char* aURL, + RefPtr LoadSheetURL(const nsACString& aURL, css::SheetParsingMode aParsingMode, css::FailureAction aFailureAction); RefPtr LoadSheetFile(nsIFile* aFile, css::SheetParsingMode aParsingMode); RefPtr LoadSheet(nsIURI* aURI, css::SheetParsingMode aParsingMode, css::FailureAction aFailureAction); - void LoadSheetFromSharedMemory(const char* aURL, RefPtr* aSheet, + void LoadSheetFromSharedMemory(const nsACString& aURL, + RefPtr* aSheet, css::SheetParsingMode, const Header*, - UserAgentStyleSheetID); + BuiltInStyleSheet); static StaticRefPtr gStyleCache; static StaticRefPtr gCSSLoader; static StaticRefPtr gUserContentSheetURL; -#define STYLE_SHEET(identifier_, url_, shared_) \ - RefPtr m##identifier_##Sheet; -#include "mozilla/UserAgentStyleSheetList.h" -#undef STYLE_SHEET + EnumeratedArray, + size_t(BuiltInStyleSheet::Count)> + mBuiltIns; RefPtr mUserChromeSheet; RefPtr mUserContentSheet; diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index 041cfaeee6fc..f12fb0a7e3c3 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -1510,10 +1510,7 @@ Loader::Completed Loader::ParseSheet( } AUTO_PROFILER_LABEL_CATEGORY_PAIR_RELEVANT_FOR_JS(LAYOUT_CSSParsing); - // TODO(emilio): fix browser_css_cache.js to deal with accessiblecaret.css. - if (!loadData->mURI || !IsPrivilegedURI(loadData->mURI)) { - ++mParsedSheetCount; - } + ++mParsedSheetCount; loadData->mIsBeingParsed = true; diff --git a/layout/style/URLExtraData.cpp b/layout/style/URLExtraData.cpp index 730576cad39d..f0100521688b 100644 --- a/layout/style/URLExtraData.cpp +++ b/layout/style/URLExtraData.cpp @@ -47,6 +47,6 @@ void URLExtraData::Shutdown() { URLExtraData::~URLExtraData() = default; StaticRefPtr - URLExtraData::sShared[size_t(UserAgentStyleSheetID::Count)]; + URLExtraData::sShared[size_t(BuiltInStyleSheet::Count)]; } // namespace mozilla diff --git a/layout/style/URLExtraData.h b/layout/style/URLExtraData.h index c63cbc4ca14c..0f79566abd41 100644 --- a/layout/style/URLExtraData.h +++ b/layout/style/URLExtraData.h @@ -12,7 +12,7 @@ #include #include "mozilla/StaticPtr.h" -#include "mozilla/UserAgentStyleSheetID.h" +#include "mozilla/BuiltInStyleSheets.h" #include "nsCOMPtr.h" #include "nsIPrincipal.h" #include "nsIReferrerInfo.h" @@ -66,8 +66,7 @@ struct URLExtraData { // URLExtraData objects that shared style sheets use a sheet ID index to // refer to. - static StaticRefPtr - sShared[size_t(UserAgentStyleSheetID::Count)]; + static StaticRefPtr sShared[size_t(BuiltInStyleSheet::Count)]; private: ~URLExtraData(); diff --git a/layout/style/UserAgentStyleSheetID.h b/layout/style/UserAgentStyleSheetID.h deleted file mode 100644 index 58de5cc60742..000000000000 --- a/layout/style/UserAgentStyleSheetID.h +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* an identifier for User Agent style sheets */ - -#ifndef mozilla_UserAgentStyleSheetID_h -#define mozilla_UserAgentStyleSheetID_h - -namespace mozilla { - -enum class UserAgentStyleSheetID : uint8_t { -#define STYLE_SHEET(identifier_, url_, shared_) identifier_, -#include "mozilla/UserAgentStyleSheetList.h" -#undef STYLE_SHEET - Count -}; - -} // namespace mozilla - -#endif // mozilla_UserAgentStyleSheetID_h diff --git a/layout/style/UserAgentStyleSheetList.h b/layout/style/UserAgentStyleSheetList.h deleted file mode 100644 index 1cf4cf283cf6..000000000000 --- a/layout/style/UserAgentStyleSheetList.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* list of user agent style sheets that GlobalStyleSheetCache manages */ - -/* - * STYLE_SHEET(identifier_, url_, shared_) - * - * identifier_ - * An identifier for the style sheet, suitable for use as an enum class value. - * - * url_ - * The URL of the style sheet. - * - * shared_ - * A boolean indicating whether the sheet can be safely placed in shared - * memory. - */ - -STYLE_SHEET(ContentEditable, "resource://gre/res/contenteditable.css", true) -STYLE_SHEET(CounterStyles, "resource://gre-resources/counterstyles.css", true) -STYLE_SHEET(Forms, "resource://gre-resources/forms.css", true) -STYLE_SHEET(HTML, "resource://gre-resources/html.css", true) -STYLE_SHEET(MathML, "resource://gre-resources/mathml.css", true) -STYLE_SHEET(NoFrames, "resource://gre-resources/noframes.css", true) -STYLE_SHEET(Quirk, "resource://gre-resources/quirk.css", true) -STYLE_SHEET(Scrollbars, "resource://gre-resources/scrollbars.css", true) -STYLE_SHEET(SVG, "resource://gre/res/svg.css", true) -STYLE_SHEET(UA, "resource://gre-resources/ua.css", true) -STYLE_SHEET(XUL, "chrome://global/content/xul.css", false) diff --git a/layout/style/jar.mn b/layout/style/jar.mn index 632746a6588c..ae320ab4a21d 100644 --- a/layout/style/jar.mn +++ b/layout/style/jar.mn @@ -10,6 +10,8 @@ toolkit.jar: res/noframes.css (res/noframes.css) res/scrollbars.css (res/scrollbars.css) res/forms.css (res/forms.css) + res/accessiblecaret.css (res/accessiblecaret.css) + res/details.css (res/details.css) #ifdef ANDROID res/accessiblecaret-normal.svg (res/accessiblecaret-normal.svg) res/accessiblecaret-tilt-left.svg (res/accessiblecaret-tilt-left.svg) diff --git a/layout/style/moz.build b/layout/style/moz.build index be46bc0685c7..4d01bfbda3d9 100644 --- a/layout/style/moz.build +++ b/layout/style/moz.build @@ -75,6 +75,8 @@ EXPORTS.mozilla += [ "AnimatedPropertyIDSet.h", "AnimationCollection.h", "AttributeStyles.h", + "BuiltInStyleSheetList.h", + "BuiltInStyleSheets.h", "CachedInheritingStyles.h", "ComputedStyle.h", "ComputedStyleInlines.h", @@ -122,8 +124,6 @@ EXPORTS.mozilla += [ "TimelineCollection.h", "TimelineManager.h", "URLExtraData.h", - "UserAgentStyleSheetID.h", - "UserAgentStyleSheetList.h", ] EXPORTS.mozilla.dom += [ @@ -296,9 +296,7 @@ RESOURCE_FILES += [ CONTENT_ACCESSIBLE_FILES += [ "ImageDocument.css", - "res/accessiblecaret.css", "res/close-12.svg", - "res/details.css", "res/plaintext.css", "res/viewsource.css", "TopLevelImageDocument.css", diff --git a/servo/ports/geckolib/glue.rs b/servo/ports/geckolib/glue.rs index 45e069d75b61..875434aa90f8 100644 --- a/servo/ports/geckolib/glue.rs +++ b/servo/ports/geckolib/glue.rs @@ -8911,7 +8911,6 @@ pub unsafe extern "C" fn Servo_SharedMemoryBuilder_AddStylesheet( ) -> *const LockedCssRules { // Assert some things we assume when we create a style sheet from shared // memory. - debug_assert_eq!(contents.origin, Origin::UserAgent); debug_assert_eq!(contents.quirks_mode, QuirksMode::NoQuirks); debug_assert!(contents.source_map_url.read().is_none()); debug_assert!(contents.source_url.read().is_none());