Bug 1968202 - Generalize GlobalStyleSheetCache to support author stylesheets. r=smaug

In bug 1967507 I changed the timing of AnonymousContent stylesheet
loading in a way that it perturbed a css cache test because of
accessiblecaret.css

  https://hg.mozilla.org/mozilla-central/rev/a6a294ae1d18

However that made me realize that accessiblecaret.css is loaded
virtually in all processes, and it should be using the same mechanism we
use for UA sheets, rather than using all the CSS loader machinery
in-content. Same goes for details.css.

Expand GlobalStyleSheetCache to allow UA and Author sheets, and allow
ShadowRoot to get built-in stylesheets appended.

This allows accessiblecaret.css and details.css not to be marked as
content-accessible.

We could do the same at the document level for plaintext.css and co, but
that seems a bit less common, so maybe fine.

Differential Revision: https://phabricator.services.mozilla.com/D250909
This commit is contained in:
Emilio Cobos Álvarez
2025-05-24 11:24:43 +00:00
committed by ealvarez@mozilla.com
parent ca0bd4918b
commit 7c0d4089c5
18 changed files with 178 additions and 147 deletions

View File

@@ -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")
) {

View File

@@ -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);

View File

@@ -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'.
*/

View File

@@ -101,20 +101,7 @@ void HTMLDetailsElement::SetupShadowTree() {
nsNodeInfoManager* nim = OwnerDoc()->NodeInfoManager();
RefPtr<NodeInfo> slotNodeInfo = nim->GetNodeInfo(
nsGkAtoms::slot, nullptr, kNameSpaceID_XHTML, nsINode::ELEMENT_NODE);
{
RefPtr<NodeInfo> linkNodeInfo = nim->GetNodeInfo(
nsGkAtoms::link, nullptr, kNameSpaceID_XHTML, nsINode::ELEMENT_NODE);
RefPtr<nsGenericHTMLElement> 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<nsGenericHTMLElement> slot =
NS_NewHTMLSlotElement(do_AddRef(slotNodeInfo));

View File

@@ -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
// <div class="moz-accessiblecaret"> <- CaretElement()
// <#shadow-root>
// <link rel="stylesheet" href="accessiblecaret.css">
// <div id="text-overlay"> <- TextOverlayElement()
// <div id="image"> <- CaretImageElement()
@@ -216,19 +218,12 @@ void AccessibleCaret::CreateCaretElement() const {
ShadowRoot* root = mCaretElementHolder->Root();
Document* doc = host.OwnerDoc();
{
RefPtr<NodeInfo> linkNodeInfo = doc->NodeInfoManager()->GetNodeInfo(
nsGkAtoms::link, nullptr, kNameSpaceID_XHTML, nsINode::ELEMENT_NODE);
RefPtr<nsGenericHTMLElement> 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<nsIPrefetchService> prefetchService(components::Prefetch::Service());
Unused << prefetchService;
}
root->AppendBuiltInStyleSheet(BuiltInStyleSheet::AccessibleCaret);
auto CreateAndAppendChildElement = [&](const nsLiteralString& aElementId) {
RefPtr<Element> child = doc->CreateHTMLElement(nsGkAtoms::div);

View File

@@ -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"
);
}

View File

@@ -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)

View File

@@ -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 <stdint.h>
#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

View File

@@ -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 <mozilla/ServoBindings.h>
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<StyleSheet*> 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<StyleSheet*> 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<const Header*>(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<StyleSheet>* aSheet, SheetParsingMode aParsingMode,
const Header* aHeader, UserAgentStyleSheetID aSheetID) {
const nsACString& aURL, RefPtr<StyleSheet>* 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<StyleSheet> GlobalStyleSheetCache::LoadSheetURL(
const char* aURL, SheetParsingMode aParsingMode,
const nsACString& aURL, SheetParsingMode aParsingMode,
FailureAction aFailureAction) {
nsCOMPtr<nsIURI> uri;
NS_NewURI(getter_AddRefs(uri), aURL);

View File

@@ -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<StyleSheet*> identifier_##Sheet();
#include "mozilla/UserAgentStyleSheetList.h"
#define STYLE_SHEET(identifier_, url_, flags_) \
NotNull<StyleSheet*> identifier_##Sheet() { \
return BuiltInSheet(BuiltInStyleSheet::identifier_); \
}
#include "mozilla/BuiltInStyleSheetList.h"
#undef STYLE_SHEET
NotNull<StyleSheet*> 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<StyleSheet> LoadSheetURL(const char* aURL,
RefPtr<StyleSheet> LoadSheetURL(const nsACString& aURL,
css::SheetParsingMode aParsingMode,
css::FailureAction aFailureAction);
RefPtr<StyleSheet> LoadSheetFile(nsIFile* aFile,
css::SheetParsingMode aParsingMode);
RefPtr<StyleSheet> LoadSheet(nsIURI* aURI, css::SheetParsingMode aParsingMode,
css::FailureAction aFailureAction);
void LoadSheetFromSharedMemory(const char* aURL, RefPtr<StyleSheet>* aSheet,
void LoadSheetFromSharedMemory(const nsACString& aURL,
RefPtr<StyleSheet>* aSheet,
css::SheetParsingMode, const Header*,
UserAgentStyleSheetID);
BuiltInStyleSheet);
static StaticRefPtr<GlobalStyleSheetCache> gStyleCache;
static StaticRefPtr<css::Loader> gCSSLoader;
static StaticRefPtr<nsIURI> gUserContentSheetURL;
#define STYLE_SHEET(identifier_, url_, shared_) \
RefPtr<StyleSheet> m##identifier_##Sheet;
#include "mozilla/UserAgentStyleSheetList.h"
#undef STYLE_SHEET
EnumeratedArray<BuiltInStyleSheet, RefPtr<StyleSheet>,
size_t(BuiltInStyleSheet::Count)>
mBuiltIns;
RefPtr<StyleSheet> mUserChromeSheet;
RefPtr<StyleSheet> mUserContentSheet;

View File

@@ -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;

View File

@@ -47,6 +47,6 @@ void URLExtraData::Shutdown() {
URLExtraData::~URLExtraData() = default;
StaticRefPtr<URLExtraData>
URLExtraData::sShared[size_t(UserAgentStyleSheetID::Count)];
URLExtraData::sShared[size_t(BuiltInStyleSheet::Count)];
} // namespace mozilla

View File

@@ -12,7 +12,7 @@
#include <utility>
#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<URLExtraData>
sShared[size_t(UserAgentStyleSheetID::Count)];
static StaticRefPtr<URLExtraData> sShared[size_t(BuiltInStyleSheet::Count)];
private:
~URLExtraData();

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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",

View File

@@ -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());