summaryrefslogtreecommitdiffstats
path: root/dom/base/nsIDocumentInlines.h
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-17 07:42:07 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-17 07:42:07 -0400
commit9e5e58c0f6e1c65674cc688816f387532661d6f1 (patch)
treee211b95d505d1ecdf8f7b3513464dd329cbbcc54 /dom/base/nsIDocumentInlines.h
parent16dba9a30b849c9381fab5fe53b722c7901e5283 (diff)
downloadUXP-9e5e58c0f6e1c65674cc688816f387532661d6f1.tar
UXP-9e5e58c0f6e1c65674cc688816f387532661d6f1.tar.gz
UXP-9e5e58c0f6e1c65674cc688816f387532661d6f1.tar.lz
UXP-9e5e58c0f6e1c65674cc688816f387532661d6f1.tar.xz
UXP-9e5e58c0f6e1c65674cc688816f387532661d6f1.zip
Bug 1425769 - Base class for ShadowRoot and Document to manage style state
Tag #1375
Diffstat (limited to 'dom/base/nsIDocumentInlines.h')
-rw-r--r--dom/base/nsIDocumentInlines.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/dom/base/nsIDocumentInlines.h b/dom/base/nsIDocumentInlines.h
index 708a1ae91..5b95a1bd3 100644
--- a/dom/base/nsIDocumentInlines.h
+++ b/dom/base/nsIDocumentInlines.h
@@ -20,19 +20,19 @@ template<typename T>
size_t
nsIDocument::FindDocStyleSheetInsertionPoint(
const nsTArray<T>& aDocSheets,
- mozilla::StyleSheet* aSheet)
+ const mozilla::StyleSheet& aSheet)
{
nsStyleSheetService* sheetService = nsStyleSheetService::GetInstance();
// lowest index first
- int32_t newDocIndex = GetIndexOfStyleSheet(aSheet);
-
- int32_t count = aDocSheets.Length();
- int32_t index;
- for (index = 0; index < count; index++) {
- mozilla::StyleSheet* sheet = static_cast<mozilla::StyleSheet*>(
- aDocSheets[index]);
- int32_t sheetDocIndex = GetIndexOfStyleSheet(sheet);
+ int32_t newDocIndex = IndexOfSheet(aSheet);
+
+ size_t count = aDocSheets.Length();
+ size_t index = 0;
+ for (; index < count; index++) {
+ auto* sheet = static_cast<mozilla::StyleSheet*>(aDocSheets[index]);
+ MOZ_ASSERT(sheet);
+ int32_t sheetDocIndex = IndexOfSheet(*sheet);
if (sheetDocIndex > newDocIndex)
break;