Skip to content

Commit e1a20b2

Browse files
committed
Bug 1998438 - Don't call InitPrimaryFrame() twice for subdocuments. r=layout-reviewers,dholbert
nsSubDocumentFrame::Init calls SetPrimaryFrame relatively early, and we're calling InitPrimaryFrame() twice because of that. Differential Revision: https://phabricator.services.mozilla.com/D271923
1 parent 87050d5 commit e1a20b2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

layout/generic/nsIFrame.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2579,6 +2579,9 @@ class nsIFrame : public nsQueryFrame {
25792579
bool IsPrimaryFrame() const { return mIsPrimaryFrame; }
25802580

25812581
void SetIsPrimaryFrame(bool aIsPrimary) {
2582+
if (mIsPrimaryFrame == aIsPrimary) {
2583+
return;
2584+
}
25822585
mIsPrimaryFrame = aIsPrimary;
25832586
if (aIsPrimary) {
25842587
InitPrimaryFrame();
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1998438">
3+
<style>
4+
* {
5+
anchor-name: --anchor-name_0;
6+
}
7+
</style>
8+
<script>
9+
window.addEventListener("load", async () => {
10+
const iframe = document.createElementNS("http://www.w3.org/1999/xhtml", "iframe")
11+
document.documentElement.appendChild(iframe)
12+
})
13+
</script>

0 commit comments

Comments
 (0)