Issue #2112 - Part 9: Remove handling for multiple style backends

This commit is contained in:
FranklinDM 2024-03-25 17:49:09 +08:00 committed by roytam1
commit b96b733bfa
20 changed files with 20 additions and 125 deletions

View file

@ -2108,21 +2108,16 @@ nsDocument::ResetStylesheetsToURI(nsIURI* aURI)
mozAutoDocUpdate upd(this, UPDATE_STYLE, true);
if (mStyleSetFilled) {
// Skip removing style sheets from the style set if we know we haven't
// filled the style set. (This allows us to avoid calling
// GetStyleBackendType() too early.)
// filled the style set.
RemoveDocStyleSheetsFromStyleSets();
RemoveStyleSheetsFromStyleSets(mOnDemandBuiltInUASheets, SheetType::Agent);
RemoveStyleSheetsFromStyleSets(mAdditionalSheets[eAgentSheet], SheetType::Agent);
RemoveStyleSheetsFromStyleSets(mAdditionalSheets[eUserSheet], SheetType::User);
RemoveStyleSheetsFromStyleSets(mAdditionalSheets[eAuthorSheet], SheetType::Doc);
if (GetStyleBackendType() == StyleBackendType::Gecko) {
nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance();
if (sheetService) {
RemoveStyleSheetsFromStyleSets(*sheetService->AuthorStyleSheets(), SheetType::Doc);
}
} else {
NS_ERROR("stylo: nsStyleSheetService doesn't handle ServoStyleSheets yet");
nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance();
if (sheetService) {
RemoveStyleSheetsFromStyleSets(*sheetService->AuthorStyleSheets(), SheetType::Doc);
}
mStyleSetFilled = false;
@ -12248,16 +12243,6 @@ nsIDocument::ReportHasScrollLinkedEffect()
"ScrollLinkedEffectFound2");
}
void
nsIDocument::UpdateStyleBackendType()
{
MOZ_ASSERT(mStyleBackendType == StyleBackendType(0),
"no need to call UpdateStyleBackendType now");
// Assume Gecko by default.
mStyleBackendType = StyleBackendType::Gecko;
}
Selection*
nsIDocument::GetSelection(ErrorResult& aRv)
{