mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 07:45:30 +00:00
Bug 1603534 - Merge ShadowRoot::StyleSheets and Document::StyleSheets(). r=nordzilla
They do the same so no reason to have it duplicated. EnsureDOMStyleSheets doesn't have any other caller so just inline it there. Differential Revision: https://phabricator.services.mozilla.com/D56986 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
2b5af87228
commit
f2ae3383f9
@ -1994,10 +1994,6 @@ class Document : public nsINode,
|
||||
* Style sheets are ordered, most significant last.
|
||||
*/
|
||||
|
||||
StyleSheetList* StyleSheets() {
|
||||
return &DocumentOrShadowRoot::EnsureDOMStyleSheets();
|
||||
}
|
||||
|
||||
void InsertSheetAt(size_t aIndex, StyleSheet&);
|
||||
|
||||
/**
|
||||
|
@ -64,11 +64,11 @@ DocumentOrShadowRoot::~DocumentOrShadowRoot() {
|
||||
}
|
||||
}
|
||||
|
||||
StyleSheetList& DocumentOrShadowRoot::EnsureDOMStyleSheets() {
|
||||
StyleSheetList* DocumentOrShadowRoot::StyleSheets() {
|
||||
if (!mDOMStyleSheets) {
|
||||
mDOMStyleSheets = new StyleSheetList(*this);
|
||||
}
|
||||
return *mDOMStyleSheets;
|
||||
return mDOMStyleSheets;
|
||||
}
|
||||
|
||||
void DocumentOrShadowRoot::InsertSheetAt(size_t aIndex, StyleSheet& aSheet) {
|
||||
|
@ -22,6 +22,7 @@ class nsWindowSizes;
|
||||
|
||||
namespace mozilla {
|
||||
class StyleSheet;
|
||||
class ErrorResult;
|
||||
|
||||
namespace dom {
|
||||
|
||||
@ -72,7 +73,7 @@ class DocumentOrShadowRoot {
|
||||
return mStyleSheets.IndexOf(&aSheet);
|
||||
}
|
||||
|
||||
StyleSheetList& EnsureDOMStyleSheets();
|
||||
StyleSheetList* StyleSheets();
|
||||
|
||||
Element* GetElementById(const nsAString& aElementId);
|
||||
|
||||
|
@ -80,10 +80,6 @@ class ShadowRoot final : public DocumentFragment,
|
||||
void SheetCloned(StyleSheet&);
|
||||
void StyleSheetApplicableStateChanged(StyleSheet&, bool aApplicable);
|
||||
|
||||
StyleSheetList* StyleSheets() {
|
||||
return &DocumentOrShadowRoot::EnsureDOMStyleSheets();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clones internal state, for example stylesheets, of aOther to 'this'.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user