diff --git a/accessible/base/nsAccessibilityService.cpp b/accessible/base/nsAccessibilityService.cpp
index 151732be41f4..19111c3a5765 100644
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -697,7 +697,7 @@ nsAccessibilityService::UpdateListBullet(nsIPresShell* aPresShell,
void
nsAccessibilityService::UpdateImageMap(nsImageFrame* aImageFrame)
{
- nsIPresShell* presShell = aImageFrame->PresContext()->PresShell();
+ nsIPresShell* presShell = aImageFrame->PresShell();
DocAccessible* document = GetDocAccessible(presShell);
if (document) {
Accessible* accessible =
diff --git a/accessible/tests/crashtests/890760.html b/accessible/tests/crashtests/890760.html
new file mode 100644
index 000000000000..ecc76160b919
--- /dev/null
+++ b/accessible/tests/crashtests/890760.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
diff --git a/accessible/tests/crashtests/crashtests.list b/accessible/tests/crashtests/crashtests.list
index 36168a376ee9..d339f02d40d4 100644
--- a/accessible/tests/crashtests/crashtests.list
+++ b/accessible/tests/crashtests/crashtests.list
@@ -1,6 +1,7 @@
load 448064.xhtml # This test instantiates a11y, so be careful about adding tests before it
load 471493.xul
asserts-if(!browserIsRemote,2) load 884202.html
+load 890760.html
load 893515.html
load 1072792.xhtml
diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js
index f2ca994e9e96..399b40afdeb0 100644
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -951,7 +951,8 @@ nsContextMenu.prototype = {
this.browser.contentPrincipal,
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
openUILink(this.mediaURL, e, { disallowInheritPrincipal: true,
- referrerURI });
+ referrerURI,
+ forceAllowDataURI: true });
}
},
diff --git a/browser/base/content/utilityOverlay.js b/browser/base/content/utilityOverlay.js
index ecfd00708a32..2cc27580f2fa 100644
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -207,6 +207,7 @@ function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI
openLinkIn(url, where, params);
}
+/* eslint-disable complexity */
function openLinkIn(url, where, params) {
if (!where || !url)
return;
@@ -222,6 +223,7 @@ function openLinkIn(url, where, params) {
params.referrerPolicy : Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
var aRelatedToCurrent = params.relatedToCurrent;
var aAllowMixedContent = params.allowMixedContent;
+ var aForceAllowDataURI = params.forceAllowDataURI;
var aInBackground = params.inBackground;
var aDisallowInheritPrincipal = params.disallowInheritPrincipal;
var aInitiatingDoc = params.initiatingDoc;
@@ -433,6 +435,9 @@ function openLinkIn(url, where, params) {
if (aIndicateErrorPageLoad) {
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ERROR_LOAD_CHANGES_RV;
}
+ if (aForceAllowDataURI) {
+ flags |= Ci.nsIWebNavigation.LOAD_FLAGS_FORCE_ALLOW_DATA_URI;
+ }
let {URI_INHERITS_SECURITY_CONTEXT} = Ci.nsIProtocolHandler;
if (aForceAboutBlankViewerInCurrent &&
diff --git a/browser/installer/windows/nsis/installer.nsi b/browser/installer/windows/nsis/installer.nsi
index e79e8c6dc115..116daf01e38b 100755
--- a/browser/installer/windows/nsis/installer.nsi
+++ b/browser/installer/windows/nsis/installer.nsi
@@ -495,17 +495,35 @@ Section "-Application" APP_IDX
; since this will either add it for the user if unelevated or All Users if
; elevated.
${If} $AddStartMenuSC == 1
- CreateShortCut "$SMPROGRAMS\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}"
- ${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk"
- ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandShortName}.lnk" \
- "$INSTDIR"
- ${If} ${AtLeastWin7}
- ${AndIf} "$AppUserModelID" != ""
- ApplicationID::Set "$SMPROGRAMS\${BrandShortName}.lnk" "$AppUserModelID" "true"
+ ; See if there's an existing shortcut for this installation using the old
+ ; name that we should just rename, instead of creating a new shortcut.
+ ; We could do this renaming even when $AddStartMenuSC is false; the idea
+ ; behind not doing that is to interpret "false" as "don't do anything
+ ; involving start menu shortcuts at all." We could also try to do this for
+ ; both shell contexts, but that won't typically accomplish anything.
+ ${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk"
+ ShellLink::GetShortCutTarget "$SMPROGRAMS\${BrandFullName}.lnk"
+ Pop $0
+ ${GetLongPath} "$0" $0
+ ${If} $0 == "$INSTDIR\${FileMainEXE}"
+ ${AndIfNot} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk"
+ Rename "$SMPROGRAMS\${BrandFullName}.lnk" \
+ "$SMPROGRAMS\${BrandShortName}.lnk"
+ ${LogMsg} "Renamed existing shortcut to $SMPROGRAMS\${BrandShortName}.lnk"
${EndIf}
- ${LogMsg} "Added Shortcut: $SMPROGRAMS\${BrandShortName}.lnk"
${Else}
- ${LogMsg} "** ERROR Adding Shortcut: $SMPROGRAMS\${BrandShortName}.lnk"
+ CreateShortCut "$SMPROGRAMS\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}"
+ ${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk"
+ ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandShortName}.lnk" \
+ "$INSTDIR"
+ ${If} "$AppUserModelID" != ""
+ ApplicationID::Set "$SMPROGRAMS\${BrandShortName}.lnk" \
+ "$AppUserModelID" "true"
+ ${EndIf}
+ ${LogMsg} "Added Shortcut: $SMPROGRAMS\${BrandShortName}.lnk"
+ ${Else}
+ ${LogMsg} "** ERROR Adding Shortcut: $SMPROGRAMS\${BrandShortName}.lnk"
+ ${EndIf}
${EndIf}
${EndIf}
@@ -525,17 +543,28 @@ Section "-Application" APP_IDX
${EndIf}
${If} $AddDesktopSC == 1
- CreateShortCut "$DESKTOP\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}"
- ${If} ${FileExists} "$DESKTOP\${BrandShortName}.lnk"
- ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandShortName}.lnk" \
- "$INSTDIR"
- ${If} ${AtLeastWin7}
- ${AndIf} "$AppUserModelID" != ""
- ApplicationID::Set "$DESKTOP\${BrandShortName}.lnk" "$AppUserModelID" "true"
+ ${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
+ ShellLink::GetShortCutTarget "$DESKTOP\${BrandFullName}.lnk"
+ Pop $0
+ ${GetLongPath} "$0" $0
+ ${If} $0 == "$INSTDIR\${FileMainEXE}"
+ ${AndIfNot} ${FileExists} "$DESKTOP\${BrandShortName}.lnk"
+ Rename "$DESKTOP\${BrandFullName}.lnk" "$DESKTOP\${BrandShortName}.lnk"
+ ${LogMsg} "Renamed existing shortcut to $DESKTOP\${BrandShortName}.lnk"
${EndIf}
- ${LogMsg} "Added Shortcut: $DESKTOP\${BrandShortName}.lnk"
${Else}
- ${LogMsg} "** ERROR Adding Shortcut: $DESKTOP\${BrandShortName}.lnk"
+ CreateShortCut "$DESKTOP\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}"
+ ${If} ${FileExists} "$DESKTOP\${BrandShortName}.lnk"
+ ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandShortName}.lnk" \
+ "$INSTDIR"
+ ${If} "$AppUserModelID" != ""
+ ApplicationID::Set "$DESKTOP\${BrandShortName}.lnk" \
+ "$AppUserModelID" "true"
+ ${EndIf}
+ ${LogMsg} "Added Shortcut: $DESKTOP\${BrandShortName}.lnk"
+ ${Else}
+ ${LogMsg} "** ERROR Adding Shortcut: $DESKTOP\${BrandShortName}.lnk"
+ ${EndIf}
${EndIf}
${EndIf}
diff --git a/browser/installer/windows/nsis/shared.nsh b/browser/installer/windows/nsis/shared.nsh
index a6742b98e2e6..4263f379db64 100755
--- a/browser/installer/windows/nsis/shared.nsh
+++ b/browser/installer/windows/nsis/shared.nsh
@@ -72,13 +72,13 @@
; Do this for both shell contexts in case the user has shortcuts in multiple
; locations, then restore the previous context at the end.
SetShellVarContext all
- ${UpdateShortcutBranding}
+ ${UpdateShortcutsBranding}
${If} ${AtLeastWin8}
${TouchStartMenuShortcut}
${EndIf}
Call FixShortcutAppModelIDs
SetShellVarContext current
- ${UpdateShortcutBranding}
+ ${UpdateShortcutsBranding}
${If} ${AtLeastWin8}
${TouchStartMenuShortcut}
${EndIf}
@@ -339,130 +339,51 @@
!macroend
!define ShowShortcuts "!insertmacro ShowShortcuts"
-; Update the branding information on all shortcuts our installer created,
+; Update the branding name on all shortcuts our installer created
; to convert from BrandFullName (which is what we used to name shortcuts)
-; to BrandShortName (which is what we now name shortcuts). Also update the
-; icon if it's been changed.
-; This should only be called sometime after both MigrateStartMenuShortcut
-; and MigrateTaskBarShurtcut, and it assumes SHCTX is set correctly.
-!macro UpdateShortcutBranding
+; to BrandShortName (which is what we now name shortcuts). We only rename
+; desktop and start menu shortcuts, because touching taskbar pins often
+; (but inconsistently) triggers various broken behaviors in the shell.
+; This should only be called sometime after MigrateStartMenuShortcut,
+; and it assumes SHCTX is set correctly.
+!macro UpdateShortcutsBranding
+ ${UpdateOneShortcutBranding} "STARTMENU" "$SMPROGRAMS"
+ ${UpdateOneShortcutBranding} "DESKTOP" "$DESKTOP"
+!macroend
+!define UpdateShortcutsBranding "!insertmacro UpdateShortcutsBranding"
+
+!macro UpdateOneShortcutBranding LOG_SECTION SHORTCUT_DIR
+ ; Only try to rename the shortcuts found in the shortcuts log, to avoid
+ ; blowing away a name that the user created.
${GetLongPath} "$INSTDIR\uninstall\${SHORTCUTS_LOG}" $R9
${If} ${FileExists} "$R9"
ClearErrors
- ; The entries in the shortcut log are numbered, but we never actually
- ; create more than one shortcut (or log entry) in each location.
- ReadINIStr $R8 "$R9" "STARTMENU" "Shortcut0"
+ ; The shortcuts log contains a numbered list of entries for each section,
+ ; but we never actually create more than one.
+ ReadINIStr $R8 "$R9" "${LOG_SECTION}" "Shortcut0"
${IfNot} ${Errors}
- ${If} ${FileExists} "$SMPROGRAMS\$R8"
- ShellLink::GetShortCutTarget "$SMPROGRAMS\$R8"
+ ${If} ${FileExists} "${SHORTCUT_DIR}\$R8"
+ ShellLink::GetShortCutTarget "${SHORTCUT_DIR}\$R8"
Pop $R7
${GetLongPath} "$R7" $R7
${If} $R7 == "$INSTDIR\${FileMainEXE}"
- ShellLink::GetShortCutIconLocation "$SMPROGRAMS\$R8"
- Pop $R6
- ${GetLongPath} "$R6" $R6
- ${If} $R6 != "$INSTDIR\firefox.ico"
- ${AndIf} ${FileExists} "$INSTDIR\firefox.ico"
- StrCpy $R5 "1"
- ${ElseIf} $R6 == "$INSTDIR\firefox.ico"
- ${AndIfNot} ${FileExists} "$INSTDIR\firefox.ico"
- StrCpy $R5 "1"
- ${Else}
- StrCpy $R5 "0"
- ${EndIf}
-
- ${If} $R5 == "1"
- ${OrIf} $R8 != "${BrandShortName}.lnk"
- Delete "$SMPROGRAMS\$R8"
- ${If} ${FileExists} "$INSTDIR\firefox.ico"
- CreateShortcut "$SMPROGRAMS\${BrandShortName}.lnk" \
- "$INSTDIR\${FileMainEXE}" "" "$INSTDIR\firefox.ico"
- ${Else}
- CreateShortcut "$SMPROGRAMS\${BrandShortName}.lnk" \
- "$INSTDIR\${FileMainEXE}"
- ${EndIf}
- WriteINIStr "$R9" "STARTMENU" "Shortcut0" "${BrandShortName}.lnk"
- ${EndIf}
- ${EndIf}
- ${EndIf}
- ${EndIf}
-
- ClearErrors
- ReadINIStr $R8 "$R9" "DESKTOP" "Shortcut0"
- ${IfNot} ${Errors}
- ${If} ${FileExists} "$DESKTOP\$R8"
- ShellLink::GetShortCutTarget "$DESKTOP\$R8"
- Pop $R7
- ${GetLongPath} "$R7" $R7
- ${If} $R7 == "$INSTDIR\${FileMainEXE}"
- ShellLink::GetShortCutIconLocation "$DESKTOP\$R8"
- Pop $R6
- ${GetLongPath} "$R6" $R6
- ${If} $R6 != "$INSTDIR\firefox.ico"
- ${AndIf} ${FileExists} "$INSTDIR\firefox.ico"
- StrCpy $R5 "1"
- ${ElseIf} $R6 == "$INSTDIR\firefox.ico"
- ${AndIfNot} ${FileExists} "$INSTDIR\firefox.ico"
- StrCpy $R5 "1"
- ${Else}
- StrCpy $R5 "0"
- ${EndIf}
-
- ${If} $R5 == "1"
- ${OrIf} $R8 != "${BrandShortName}.lnk"
- Delete "$DESKTOP\$R8"
- ${If} ${FileExists} "$INSTDIR\firefox.ico"
- CreateShortcut "$DESKTOP\${BrandShortName}.lnk" \
- "$INSTDIR\${FileMainEXE}" "" "$INSTDIR\firefox.ico"
- ${Else}
- CreateShortcut "$DESKTOP\${BrandShortName}.lnk" \
- "$INSTDIR\${FileMainEXE}"
- ${EndIf}
- WriteINIStr "$R9" "DESKTOP" "Shortcut0" "${BrandShortName}.lnk"
- ${EndIf}
- ${EndIf}
- ${EndIf}
- ${EndIf}
-
- ClearErrors
- ReadINIStr $R8 "$R9" "QUICKLAUNCH" "Shortcut0"
- ${IfNot} ${Errors}
- ; "QUICKLAUNCH" actually means a taskbar pin.
- ; We can't simultaneously rename and change the icon for a taskbar pin
- ; without the icon breaking, and the icon is more important than the name,
- ; so we'll forget about changing the name and just overwrite the icon.
- ${If} ${FileExists} "$QUICKLAUNCH\User Pinned\TaskBar\$R8"
- ShellLink::GetShortCutTarget "$QUICKLAUNCH\User Pinned\TaskBar\$R8"
- Pop $R7
- ${GetLongPath} "$R7" $R7
- ${If} "$INSTDIR\${FileMainEXE}" == "$R7"
- ShellLink::GetShortCutIconLocation "$QUICKLAUNCH\User Pinned\TaskBar\$R8"
- Pop $R6
- ${GetLongPath} "$R6" $R6
- ${If} $R6 != "$INSTDIR\firefox.ico"
- ${AndIf} ${FileExists} "$INSTDIR\firefox.ico"
- StrCpy $R5 "1"
- ${ElseIf} $R6 == "$INSTDIR\firefox.ico"
- ${AndIfNot} ${FileExists} "$INSTDIR\firefox.ico"
- StrCpy $R5 "1"
- ${Else}
- StrCpy $R5 "0"
- ${EndIf}
-
- ${If} $R5 == "1"
- ${If} ${FileExists} "$INSTDIR\firefox.ico"
- CreateShortcut "$QUICKLAUNCH\User Pinned\TaskBar\$R8" "$R7" "" \
- "$INSTDIR\firefox.ico"
- ${Else}
- CreateShortcut "$QUICKLAUNCH\User Pinned\TaskBar\$R8" "$R7"
- ${EndIf}
+ ${AndIf} $R8 != "${BrandShortName}.lnk"
+ ${AndIfNot} ${FileExists} "${SHORTCUT_DIR}\${BrandShortName}.lnk"
+ ClearErrors
+ Rename "${SHORTCUT_DIR}\$R8" "${SHORTCUT_DIR}\${BrandShortName}.lnk"
+ ${IfNot} ${Errors}
+ ; Update the shortcut log manually instead of calling LogShortcut
+ ; because it would add a Shortcut1 entry, and we really do want to
+ ; overwrite the existing entry 0, since we just renamed the file.
+ WriteINIStr "$R9" "${LOG_SECTION}" "Shortcut0" \
+ "${BrandShortName}.lnk"
${EndIf}
${EndIf}
${EndIf}
${EndIf}
${EndIf}
!macroend
-!define UpdateShortcutBranding "!insertmacro UpdateShortcutBranding"
+!define UpdateOneShortcutBranding "!insertmacro UpdateOneShortcutBranding"
!macro AddAssociationIfNoneExist FILE_TYPE KEY
ClearErrors
diff --git a/build/build-clang/build-clang.py b/build/build-clang/build-clang.py
index 2fc2bfb2f4a1..d4bcf920a418 100755
--- a/build/build-clang/build-clang.py
+++ b/build/build-clang/build-clang.py
@@ -456,15 +456,15 @@ if __name__ == "__main__":
for p in config.get("patches", []):
patch(p, source_dir)
- symlinks = [(source_dir + "/clang",
+ symlinks = [(clang_source_dir,
llvm_source_dir + "/tools/clang"),
- (source_dir + "/extra",
+ (extra_source_dir,
llvm_source_dir + "/tools/clang/tools/extra"),
- (source_dir + "/compiler-rt",
+ (compiler_rt_source_dir,
llvm_source_dir + "/projects/compiler-rt"),
- (source_dir + "/libcxx",
+ (libcxx_source_dir,
llvm_source_dir + "/projects/libcxx"),
- (source_dir + "/libcxxabi",
+ (libcxxabi_source_dir,
llvm_source_dir + "/projects/libcxxabi")]
for l in symlinks:
# On Windows, we have to re-copy the whole directory every time.
diff --git a/build/build-clang/clang-win32.json b/build/build-clang/clang-win32.json
index 645610d2ec64..80d931a5553c 100644
--- a/build/build-clang/clang-win32.json
+++ b/build/build-clang/clang-win32.json
@@ -12,7 +12,7 @@
"cc": "cl.exe",
"cxx": "cl.exe",
"patches": [
- "build/src/build/build-clang/msvc-host-x64.patch",
- "build/src/build/build-clang/loosen-msvc-detection.patch"
+ "msvc-host-x64.patch",
+ "loosen-msvc-detection.patch"
]
}
diff --git a/build/build-clang/clang-win64.json b/build/build-clang/clang-win64.json
index d28475e22eba..79ad4042d3d8 100644
--- a/build/build-clang/clang-win64.json
+++ b/build/build-clang/clang-win64.json
@@ -13,6 +13,6 @@
"cxx": "cl.exe",
"ml": "ml64.exe",
"patches": [
- "build/src/build/build-clang/loosen-msvc-detection.patch"
+ "loosen-msvc-detection.patch"
]
}
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index 0e24e7462804..155fcd03cf81 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -1310,6 +1310,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
nsCOMPtr shEntry;
nsString target;
nsAutoString srcdoc;
+ bool forceAllowDataURI = false;
nsCOMPtr sourceDocShell;
nsCOMPtr baseURI;
@@ -1346,6 +1347,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
aLoadInfo->GetSrcdocData(srcdoc);
aLoadInfo->GetSourceDocShell(getter_AddRefs(sourceDocShell));
aLoadInfo->GetBaseURI(getter_AddRefs(baseURI));
+ aLoadInfo->GetForceAllowDataURI(&forceAllowDataURI);
}
MOZ_LOG(gDocShellLeakLog, LogLevel::Debug,
@@ -1609,6 +1611,10 @@ nsDocShell::LoadURI(nsIURI* aURI,
flags |= INTERNAL_LOAD_FLAGS_IS_SRCDOC;
}
+ if (forceAllowDataURI) {
+ flags |= INTERNAL_LOAD_FLAGS_FORCE_ALLOW_DATA_URI;
+ }
+
return InternalLoad(aURI,
originalURI,
resultPrincipalURI,
@@ -4917,6 +4923,9 @@ nsDocShell::LoadURIWithOptions(const char16_t* aURI,
}
nsAutoPopupStatePusher statePusher(popupState);
+ bool forceAllowDataURI =
+ aLoadFlags & LOAD_FLAGS_FORCE_ALLOW_DATA_URI;
+
// Don't pass certain flags that aren't needed and end up confusing
// ConvertLoadTypeToDocShellLoadInfo. We do need to ensure that they are
// passed to LoadURI though, since it uses them.
@@ -4947,6 +4956,7 @@ nsDocShell::LoadURIWithOptions(const char16_t* aURI,
loadInfo->SetHeadersStream(aHeaderStream);
loadInfo->SetBaseURI(aBaseURI);
loadInfo->SetTriggeringPrincipal(aTriggeringPrincipal);
+ loadInfo->SetForceAllowDataURI(forceAllowDataURI);
if (fixupInfo) {
nsAutoString searchProvider, keyword;
@@ -8850,7 +8860,7 @@ nsDocShell::RestoreFromHistory()
if (rootViewSibling) {
nsIFrame* frame = rootViewSibling->GetFrame();
sibling =
- frame ? frame->PresContext()->PresShell()->GetDocument() : nullptr;
+ frame ? frame->PresShell()->GetDocument() : nullptr;
}
// Transfer ownership to mContentViewer. By ensuring that either the
@@ -10189,6 +10199,7 @@ nsDocShell::InternalLoad(nsIURI* aURI,
// principal to inherit is: it should be aTriggeringPrincipal.
loadInfo->SetPrincipalIsExplicit(true);
loadInfo->SetLoadType(ConvertLoadTypeToDocShellLoadInfo(LOAD_LINK));
+ loadInfo->SetForceAllowDataURI(aFlags & INTERNAL_LOAD_FLAGS_FORCE_ALLOW_DATA_URI);
rv = win->Open(NS_ConvertUTF8toUTF16(spec),
aWindowTarget, // window name
@@ -10866,7 +10877,9 @@ nsDocShell::InternalLoad(nsIURI* aURI,
nsCOMPtr req;
rv = DoURILoad(aURI, aOriginalURI, aResultPrincipalURI, aLoadReplace,
- loadFromExternal, aReferrer,
+ loadFromExternal,
+ (aFlags & INTERNAL_LOAD_FLAGS_FORCE_ALLOW_DATA_URI),
+ aReferrer,
!(aFlags & INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER),
aReferrerPolicy,
aTriggeringPrincipal, principalToInherit, aTypeHint,
@@ -11004,6 +11017,7 @@ nsDocShell::DoURILoad(nsIURI* aURI,
Maybe> const& aResultPrincipalURI,
bool aLoadReplace,
bool aLoadFromExternal,
+ bool aForceAllowDataURI,
nsIURI* aReferrerURI,
bool aSendReferrer,
uint32_t aReferrerPolicy,
@@ -11184,6 +11198,7 @@ nsDocShell::DoURILoad(nsIURI* aURI,
loadInfo->SetPrincipalToInherit(aPrincipalToInherit);
}
loadInfo->SetLoadTriggeredFromExternal(aLoadFromExternal);
+ loadInfo->SetForceAllowDataURI(aForceAllowDataURI);
// We have to do this in case our OriginAttributes are different from the
// OriginAttributes of the parent document. Or in case there isn't a
diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h
index ca93a3c7a5bf..c097fcb1f49b 100644
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -452,6 +452,7 @@ protected:
mozilla::Maybe> const& aResultPrincipalURI,
bool aLoadReplace,
bool aLoadFromExternal,
+ bool aForceAllowDataURI,
nsIURI* aReferrer,
bool aSendReferrer,
uint32_t aReferrerPolicy,
diff --git a/docshell/base/nsDocShellLoadInfo.cpp b/docshell/base/nsDocShellLoadInfo.cpp
index 40a4b7edd31a..836b629a5db3 100644
--- a/docshell/base/nsDocShellLoadInfo.cpp
+++ b/docshell/base/nsDocShellLoadInfo.cpp
@@ -67,6 +67,7 @@ nsDocShellLoadInfo::nsDocShellLoadInfo()
, mLoadReplace(false)
, mInheritPrincipal(false)
, mPrincipalIsExplicit(false)
+ , mForceAllowDataURI(false)
, mSendReferrer(true)
, mReferrerPolicy(mozilla::net::RP_Unset)
, mLoadType(nsIDocShellLoadInfo::loadNormal)
@@ -209,6 +210,20 @@ nsDocShellLoadInfo::SetPrincipalIsExplicit(bool aPrincipalIsExplicit)
return NS_OK;
}
+NS_IMETHODIMP
+nsDocShellLoadInfo::GetForceAllowDataURI(bool* aForceAllowDataURI)
+{
+ *aForceAllowDataURI = mForceAllowDataURI;
+ return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDocShellLoadInfo::SetForceAllowDataURI(bool aForceAllowDataURI)
+{
+ mForceAllowDataURI = aForceAllowDataURI;
+ return NS_OK;
+}
+
NS_IMETHODIMP
nsDocShellLoadInfo::GetLoadType(nsDocShellInfoLoadType* aLoadType)
{
diff --git a/docshell/base/nsDocShellLoadInfo.h b/docshell/base/nsDocShellLoadInfo.h
index 58e6fcd734c2..9a080326dbf4 100644
--- a/docshell/base/nsDocShellLoadInfo.h
+++ b/docshell/base/nsDocShellLoadInfo.h
@@ -39,6 +39,7 @@ protected:
bool mLoadReplace;
bool mInheritPrincipal;
bool mPrincipalIsExplicit;
+ bool mForceAllowDataURI;
bool mSendReferrer;
nsDocShellInfoReferrerPolicy mReferrerPolicy;
nsDocShellInfoLoadType mLoadType;
diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl
index 4beac80ff594..2f3572890907 100644
--- a/docshell/base/nsIDocShell.idl
+++ b/docshell/base/nsIDocShell.idl
@@ -127,6 +127,9 @@ interface nsIDocShell : nsIDocShellTreeItem
const long INTERNAL_LOAD_FLAGS_NO_OPENER = 0x100;
+ // Whether a top-level data URI navigation is allowed for that load
+ const long INTERNAL_LOAD_FLAGS_FORCE_ALLOW_DATA_URI = 0x200;
+
// NB: 0x80 is available.
/**
diff --git a/docshell/base/nsIDocShellLoadInfo.idl b/docshell/base/nsIDocShellLoadInfo.idl
index e66a3a4a6c1c..c8d52c7c5539 100644
--- a/docshell/base/nsIDocShellLoadInfo.idl
+++ b/docshell/base/nsIDocShellLoadInfo.idl
@@ -65,6 +65,12 @@ interface nsIDocShellLoadInfo : nsISupports
*/
attribute boolean principalIsExplicit;
+ /**
+ * If this attribute is true, then a top-level navigation
+ * to a data URI will be allowed.
+ */
+ attribute boolean forceAllowDataURI;
+
/* these are load type enums... */
const long loadNormal = 0; // Normal Load
const long loadNormalReplace = 1; // Normal Load but replaces current history slot
diff --git a/docshell/base/nsIWebNavigation.idl b/docshell/base/nsIWebNavigation.idl
index 78e89a41359f..8fcb21f4a62f 100644
--- a/docshell/base/nsIWebNavigation.idl
+++ b/docshell/base/nsIWebNavigation.idl
@@ -206,6 +206,12 @@ interface nsIWebNavigation : nsISupports
*/
const unsigned long LOAD_FLAGS_FIXUP_SCHEME_TYPOS = 0x200000;
+ /**
+ * Allows a top-level data: navigation to occur. E.g. view-image
+ * is an explicit user action which should be allowed.
+ */
+ const unsigned long LOAD_FLAGS_FORCE_ALLOW_DATA_URI = 0x400000;
+
/**
* Loads a given URI. This will give priority to loading the requested URI
* in the object implementing this interface. If it can't be loaded here
diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp
index 5716c86ab13f..098db6e57084 100644
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -783,7 +783,6 @@ CustomElementRegistry::Define(const nsAString& aName,
* observedAttributesIterable to a sequence. Rethrow
* any exceptions from the conversion.
*/
- // TODO: Bug 1293921 - Implement connected/disconnected/adopted/attributeChanged lifecycle callbacks for custom elements
if (callbacksHolder->mAttributeChangedCallback.WasPassed()) {
// Enter constructor's compartment.
JSAutoCompartment ac(cx, constructor);
@@ -796,12 +795,22 @@ CustomElementRegistry::Define(const nsAString& aName,
}
if (!observedAttributesIterable.isUndefined()) {
+ if (!observedAttributesIterable.isObject()) {
+ aRv.ThrowTypeError(NS_LITERAL_STRING("observedAttributes"));
+ return;
+ }
+
JS::ForOfIterator iter(cx);
- if (!iter.init(observedAttributesIterable)) {
+ if (!iter.init(observedAttributesIterable, JS::ForOfIterator::AllowNonIterable)) {
aRv.StealExceptionFromJSContext(cx);
return;
}
+ if (!iter.valueIsIterable()) {
+ aRv.ThrowTypeError(NS_LITERAL_STRING("observedAttributes"));
+ return;
+ }
+
JS::Rooted attribute(cx);
while (true) {
bool done;
@@ -813,13 +822,16 @@ CustomElementRegistry::Define(const nsAString& aName,
break;
}
- JSString *attrJSStr = attribute.toString();
- nsAutoJSString attrStr;
- if (!attrStr.init(cx, attrJSStr)) {
+ nsAutoString attrStr;
+ if (!ConvertJSValueToString(cx, attribute, eStringify, eStringify, attrStr)) {
aRv.StealExceptionFromJSContext(cx);
return;
}
- observedAttributes.AppendElement(NS_Atomize(attrStr));
+
+ if (!observedAttributes.AppendElement(NS_Atomize(attrStr))) {
+ aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
+ return;
+ }
}
}
} // Leave constructor's compartment.
diff --git a/dom/base/crashtests/1413815.html b/dom/base/crashtests/1413815.html
new file mode 100644
index 000000000000..309e54d082ae
--- /dev/null
+++ b/dom/base/crashtests/1413815.html
@@ -0,0 +1,20 @@
+
+
+
+
+
diff --git a/dom/base/crashtests/crashtests.list b/dom/base/crashtests/crashtests.list
index b9832550febe..f7ab9ecedf5c 100644
--- a/dom/base/crashtests/crashtests.list
+++ b/dom/base/crashtests/crashtests.list
@@ -234,3 +234,4 @@ load 1403377.html
load 1405771.html
load 1406109-1.html
pref(dom.webcomponents.enabled,true) load 1324463.html
+pref(dom.webcomponents.customelements.enabled,true) load 1413815.html
diff --git a/dom/base/nsFrameLoader.cpp b/dom/base/nsFrameLoader.cpp
index 709609f45158..fcf693864397 100644
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -3030,16 +3030,16 @@ nsFrameLoader::SetClipSubdocument(bool aClip)
nsIFrame* frame = GetPrimaryFrameOfOwningContent();
if (frame) {
frame->InvalidateFrame();
- frame->PresContext()->PresShell()->
+ frame->PresShell()->
FrameNeedsReflow(frame, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
nsSubDocumentFrame* subdocFrame = do_QueryFrame(frame);
if (subdocFrame) {
nsIFrame* subdocRootFrame = subdocFrame->GetSubdocumentRootFrame();
if (subdocRootFrame) {
- nsIFrame* subdocRootScrollFrame = subdocRootFrame->PresContext()->PresShell()->
+ nsIFrame* subdocRootScrollFrame = subdocRootFrame->PresShell()->
GetRootScrollFrame();
if (subdocRootScrollFrame) {
- frame->PresContext()->PresShell()->
+ frame->PresShell()->
FrameNeedsReflow(frame, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
}
}
@@ -3067,7 +3067,7 @@ nsFrameLoader::SetClampScrollPosition(bool aClamp)
if (subdocFrame) {
nsIFrame* subdocRootFrame = subdocFrame->GetSubdocumentRootFrame();
if (subdocRootFrame) {
- nsIScrollableFrame* subdocRootScrollFrame = subdocRootFrame->PresContext()->PresShell()->
+ nsIScrollableFrame* subdocRootScrollFrame = subdocRootFrame->PresShell()->
GetRootScrollFrameAsScrollable();
if (subdocRootScrollFrame) {
subdocRootScrollFrame->ScrollTo(subdocRootScrollFrame->GetScrollPosition(), nsIScrollableFrame::INSTANT);
diff --git a/dom/events/ContentEventHandler.cpp b/dom/events/ContentEventHandler.cpp
index 5f09becf263d..463a1614b1ed 100644
--- a/dom/events/ContentEventHandler.cpp
+++ b/dom/events/ContentEventHandler.cpp
@@ -3250,7 +3250,7 @@ ContentEventHandler::FrameRelativeRect::RectRelativeTo(
return mRect;
}
- nsIFrame* rootFrame = mBaseFrame->PresContext()->PresShell()->GetRootFrame();
+ nsIFrame* rootFrame = mBaseFrame->PresShell()->GetRootFrame();
nsRect baseFrameRectInRootFrame =
nsLayoutUtils::TransformFrameRectToAncestor(mBaseFrame, nsRect(),
rootFrame);
diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp
index 44f059d4f82b..a631183e8b42 100644
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -3310,7 +3310,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
ScrollbarsForWheel::SetActiveScrollTarget(scrollTarget);
nsIFrame* rootScrollFrame = !mCurrentTarget ? nullptr :
- mCurrentTarget->PresContext()->PresShell()->GetRootScrollFrame();
+ mCurrentTarget->PresShell()->GetRootScrollFrame();
nsIScrollableFrame* rootScrollableFrame = nullptr;
if (rootScrollFrame) {
rootScrollableFrame = do_QueryFrame(rootScrollFrame);
diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp
index b770085b6c8f..774cdc120579 100644
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -4132,9 +4132,8 @@ void HTMLMediaElement::SetPlayedOrSeeked(bool aValue)
if (!frame) {
return;
}
- frame->PresContext()->PresShell()->FrameNeedsReflow(frame,
- nsIPresShell::eTreeChange,
- NS_FRAME_IS_DIRTY);
+ frame->PresShell()->FrameNeedsReflow(frame, nsIPresShell::eTreeChange,
+ NS_FRAME_IS_DIRTY);
}
void
diff --git a/dom/indexedDB/IDBFactory.cpp b/dom/indexedDB/IDBFactory.cpp
index e5f1a050c8f3..c4b47aeef87f 100644
--- a/dom/indexedDB/IDBFactory.cpp
+++ b/dom/indexedDB/IDBFactory.cpp
@@ -275,8 +275,7 @@ IDBFactory::CreateForJSInternal(JSContext* aCx,
factory->mPrincipalInfo = aPrincipalInfo.forget();
factory->mOwningObject = aOwningObject;
mozilla::HoldJSObjects(factory.get());
- factory->mEventTarget = NS_IsMainThread() ?
- SystemGroup::EventTargetFor(TaskCategory::Other) : GetCurrentThreadEventTarget();
+ factory->mEventTarget = GetCurrentThreadEventTarget();
factory->mInnerWindowID = aInnerWindowID;
factory.forget(aFactory);
diff --git a/dom/indexedDB/IDBFactory.h b/dom/indexedDB/IDBFactory.h
index fcde42b8d486..e1460798e0f2 100644
--- a/dom/indexedDB/IDBFactory.h
+++ b/dom/indexedDB/IDBFactory.h
@@ -71,9 +71,8 @@ class IDBFactory final
indexedDB::BackgroundFactoryChild* mBackgroundActor;
- // A DocGroup-specific EventTarget if created by CreateForWindow().
- // Otherwise, it must either be set to SystemGroup on main thread or
- // NS_GetCurrentThread() off main thread.
+ // It is either set to a DocGroup-specific EventTarget if created by
+ // CreateForWindow() or set to GetCurrentThreadEventTarget() otherwise.
nsCOMPtr mEventTarget;
uint64_t mInnerWindowID;
diff --git a/dom/media/mediasource/AutoTaskQueue.h b/dom/media/mediasource/AutoTaskQueue.h
index c3aa08291a70..38432a01e4ce 100644
--- a/dom/media/mediasource/AutoTaskQueue.h
+++ b/dom/media/mediasource/AutoTaskQueue.h
@@ -36,11 +36,11 @@ public:
return mTaskQueue->TailDispatcher();
}
- void Dispatch(already_AddRefed aRunnable,
- DispatchFailureHandling aFailureHandling = AssertDispatchSuccess,
- DispatchReason aReason = NormalDispatch) override
+ nsresult Dispatch(already_AddRefed aRunnable,
+ DispatchFailureHandling aFailureHandling = AssertDispatchSuccess,
+ DispatchReason aReason = NormalDispatch) override
{
- mTaskQueue->Dispatch(Move(aRunnable), aFailureHandling, aReason);
+ return mTaskQueue->Dispatch(Move(aRunnable), aFailureHandling, aReason);
}
// Prevent a GCC warning about the other overload of Dispatch being hidden.
diff --git a/dom/security/nsContentSecurityManager.cpp b/dom/security/nsContentSecurityManager.cpp
index 5876db2aeaef..d8db2e063426 100644
--- a/dom/security/nsContentSecurityManager.cpp
+++ b/dom/security/nsContentSecurityManager.cpp
@@ -48,6 +48,10 @@ nsContentSecurityManager::AllowTopLevelNavigationToDataURI(nsIChannel* aChannel)
if (loadInfo->GetExternalContentPolicyType() != nsIContentPolicy::TYPE_DOCUMENT) {
return true;
}
+ if (loadInfo->GetForceAllowDataURI()) {
+ // if the loadinfo explicitly allows the data URI navigation, let's allow it now
+ return true;
+ }
nsCOMPtr uri;
nsresult rv = NS_GetFinalChannelURI(aChannel, getter_AddRefs(uri));
NS_ENSURE_SUCCESS(rv, true);
diff --git a/dom/security/test/general/browser.ini b/dom/security/test/general/browser.ini
index 73ae72dddd9b..b00baa95dc6e 100644
--- a/dom/security/test/general/browser.ini
+++ b/dom/security/test/general/browser.ini
@@ -9,3 +9,6 @@ support-files =
[browser_test_data_text_csv.js]
support-files =
file_data_text_csv.html
+[browser_test_view_image_data_navigation.js]
+support-files =
+ file_view_image_data_navigation.html
diff --git a/dom/security/test/general/browser_test_view_image_data_navigation.js b/dom/security/test/general/browser_test_view_image_data_navigation.js
new file mode 100644
index 000000000000..22de3589407b
--- /dev/null
+++ b/dom/security/test/general/browser_test_view_image_data_navigation.js
@@ -0,0 +1,30 @@
+"use strict";
+
+const TEST_PAGE = getRootDirectory(gTestPath) + "file_view_image_data_navigation.html";
+
+add_task(async function test_principal_right_click_open_link_in_new_tab() {
+ await SpecialPowers.pushPrefEnv({
+ "set": [["security.data_uri.block_toplevel_data_uri_navigations", true]],
+ });
+
+ await BrowserTestUtils.withNewTab(TEST_PAGE, async function(browser) {
+ let loadPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, true);
+
+ // simulate right-click->view-image
+ BrowserTestUtils.waitForEvent(document, "popupshown", false, event => {
+ // These are operations that must be executed synchronously with the event.
+ document.getElementById("context-viewimage").doCommand();
+ event.target.hidePopup();
+ return true;
+ });
+ BrowserTestUtils.synthesizeMouseAtCenter("#testimage",
+ { type: "contextmenu", button: 2 },
+ gBrowser.selectedBrowser);
+ await loadPromise;
+
+ await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function() {
+ ok(content.document.location.toString().startsWith("data:image/svg+xml;"),
+ "data:image/svg navigation allowed through right-click view-image")
+ });
+ });
+});
diff --git a/dom/security/test/general/file_view_image_data_navigation.html b/dom/security/test/general/file_view_image_data_navigation.html
new file mode 100644
index 000000000000..a3f9acfb4dae
--- /dev/null
+++ b/dom/security/test/general/file_view_image_data_navigation.html
@@ -0,0 +1,12 @@
+
+
+
+
+ Bug 1407891: Test navigation for right-click view-image on data:image/svg
+
+
+
+
+
+
+
diff --git a/gfx/2d/DrawTargetSkia.cpp b/gfx/2d/DrawTargetSkia.cpp
index 63941d9315f7..261fb4fd0b71 100644
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -50,6 +50,8 @@
#include "ScaledFontDWrite.h"
#endif
+using namespace std;
+
namespace mozilla {
namespace gfx {
@@ -276,6 +278,7 @@ GetSkImageForSurface(SourceSurface* aSurface, const Rect* aBounds = nullptr, con
DrawTargetSkia::DrawTargetSkia()
: mSnapshot(nullptr)
+ , mSnapshotLock{make_shared("DrawTargetSkia::mSnapshotLock")}
#ifdef MOZ_WIDGET_COCOA
, mCG(nullptr)
, mColorSpace(nullptr)
@@ -316,7 +319,7 @@ DrawTargetSkia::Snapshot()
} else {
image = mSurface->makeImageSnapshot();
}
- if (!snapshot->InitFromImage(image, mFormat, this)) {
+ if (!snapshot->InitFromImage(image, mFormat, this, mSnapshotLock)) {
return nullptr;
}
mSnapshot = snapshot;
@@ -2214,6 +2217,7 @@ DrawTargetSkia::CreateFilter(FilterType aType)
void
DrawTargetSkia::MarkChanged()
{
+ MutexAutoLock lock(*mSnapshotLock);
if (mSnapshot) {
mSnapshot->DrawTargetWillChange();
mSnapshot = nullptr;
diff --git a/gfx/2d/DrawTargetSkia.h b/gfx/2d/DrawTargetSkia.h
index 6fef4e9afb4c..812120cb427b 100644
--- a/gfx/2d/DrawTargetSkia.h
+++ b/gfx/2d/DrawTargetSkia.h
@@ -206,6 +206,7 @@ private:
sk_sp mSurface;
SkCanvas* mCanvas;
SourceSurfaceSkia* mSnapshot;
+ std::shared_ptr mSnapshotLock;
#ifdef MOZ_WIDGET_COCOA
friend class BorrowedCGContext;
diff --git a/gfx/2d/Filters.h b/gfx/2d/Filters.h
index fc610b85496f..d40910a4610b 100644
--- a/gfx/2d/Filters.h
+++ b/gfx/2d/Filters.h
@@ -475,7 +475,7 @@ enum UnpremultiplyInputs
IN_UNPREMULTIPLY_IN = 0
};
-class FilterNode : public RefCounted
+class FilterNode : public external::AtomicRefCounted
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNode)
diff --git a/gfx/2d/SourceSurfaceSkia.cpp b/gfx/2d/SourceSurfaceSkia.cpp
index 9bc49715a161..737f1992b247 100644
--- a/gfx/2d/SourceSurfaceSkia.cpp
+++ b/gfx/2d/SourceSurfaceSkia.cpp
@@ -13,6 +13,8 @@
#include "skia/include/core/SkData.h"
#include "mozilla/CheckedInt.h"
+using namespace std;
+
namespace mozilla {
namespace gfx {
@@ -24,9 +26,12 @@ SourceSurfaceSkia::SourceSurfaceSkia()
SourceSurfaceSkia::~SourceSurfaceSkia()
{
- if (mDrawTarget) {
- mDrawTarget->SnapshotDestroyed();
- mDrawTarget = nullptr;
+ if (mSnapshotLock) {
+ MutexAutoLock lock{*mSnapshotLock};
+ if (mDrawTarget) {
+ mDrawTarget->SnapshotDestroyed();
+ mDrawTarget = nullptr;
+ }
}
}
@@ -104,7 +109,8 @@ SourceSurfaceSkia::InitFromData(unsigned char* aData,
bool
SourceSurfaceSkia::InitFromImage(const sk_sp& aImage,
SurfaceFormat aFormat,
- DrawTargetSkia* aOwner)
+ DrawTargetSkia* aOwner,
+ shared_ptr aSnapshotLock)
{
if (!aImage) {
return false;
@@ -137,6 +143,8 @@ SourceSurfaceSkia::InitFromImage(const sk_sp& aImage,
mImage = aImage;
if (aOwner) {
+ MOZ_ASSERT(aSnapshotLock);
+ mSnapshotLock = move(aSnapshotLock);
mDrawTarget = aOwner;
}
@@ -186,6 +194,10 @@ SourceSurfaceSkia::Unmap()
void
SourceSurfaceSkia::DrawTargetWillChange()
{
+ // In this case synchronisation on destroy should be guaranteed!
+ MOZ_ASSERT(mSnapshotLock);
+ mSnapshotLock->AssertCurrentThreadOwns();
+
MutexAutoLock lock(mChangeMutex);
if (mDrawTarget) {
// Raster snapshots do not use Skia's internal copy-on-write mechanism,
diff --git a/gfx/2d/SourceSurfaceSkia.h b/gfx/2d/SourceSurfaceSkia.h
index ed3942a081af..f6b04ce47c3c 100644
--- a/gfx/2d/SourceSurfaceSkia.h
+++ b/gfx/2d/SourceSurfaceSkia.h
@@ -18,6 +18,7 @@ namespace mozilla {
namespace gfx {
class DrawTargetSkia;
+class SnapshotLock;
class SourceSurfaceSkia : public DataSourceSurface
{
@@ -39,7 +40,8 @@ public:
bool InitFromImage(const sk_sp& aImage,
SurfaceFormat aFormat = SurfaceFormat::UNKNOWN,
- DrawTargetSkia* aOwner = nullptr);
+ DrawTargetSkia* aOwner = nullptr,
+ std::shared_ptr aSnapshotLock = std::shared_ptr{});
virtual uint8_t* GetData();
@@ -62,6 +64,7 @@ private:
IntSize mSize;
int32_t mStride;
RefPtr mDrawTarget;
+ std::shared_ptr mSnapshotLock;
Mutex mChangeMutex;
};
diff --git a/gfx/ipc/GPUParent.cpp b/gfx/ipc/GPUParent.cpp
index 0eea2147effe..ba12e7933560 100644
--- a/gfx/ipc/GPUParent.cpp
+++ b/gfx/ipc/GPUParent.cpp
@@ -213,6 +213,15 @@ GPUParent::RecvInit(nsTArray&& prefs,
} else {
gtk_init(nullptr, nullptr);
}
+
+ // Ensure we have an FT library for font instantiation.
+ // This would normally be set by gfxPlatform::Init().
+ // Since we bypass that, we must do it here instead.
+ if (gfxVars::UseWebRender()) {
+ FT_Library library = Factory::NewFTLibrary();
+ MOZ_ASSERT(library);
+ Factory::SetFTLibrary(library);
+ }
#endif
// Make sure to do this *after* we update gfxVars above.
diff --git a/gfx/layers/apz/util/APZCCallbackHelper.cpp b/gfx/layers/apz/util/APZCCallbackHelper.cpp
index bbb5bd3a340e..80b5e113c2b9 100644
--- a/gfx/layers/apz/util/APZCCallbackHelper.cpp
+++ b/gfx/layers/apz/util/APZCCallbackHelper.cpp
@@ -613,7 +613,7 @@ UpdateRootFrameForTouchTargetDocument(nsIFrame* aRootFrame)
// Re-target so that the hit test is performed relative to the frame for the
// Root Content Document instead of the Root Document which are different in
// Android. See bug 1229752 comment 16 for an explanation of why this is necessary.
- if (nsIDocument* doc = aRootFrame->PresContext()->PresShell()->GetPrimaryContentDocument()) {
+ if (nsIDocument* doc = aRootFrame->PresShell()->GetPrimaryContentDocument()) {
if (nsIPresShell* shell = doc->GetShell()) {
if (nsIFrame* frame = shell->GetRootFrame()) {
return frame;
@@ -648,7 +648,7 @@ PrepareForSetTargetAPZCNotification(nsIWidget* aWidget,
nsLayoutUtils::GetFrameForPoint(aRootFrame, point, flags);
nsIScrollableFrame* scrollAncestor = target
? nsLayoutUtils::GetAsyncScrollableAncestorFrame(target)
- : aRootFrame->PresContext()->PresShell()->GetRootScrollFrameAsScrollable();
+ : aRootFrame->PresShell()->GetRootScrollFrameAsScrollable();
// Assuming that if there's no scrollAncestor, there's already a displayPort.
nsCOMPtr dpElement = scrollAncestor
@@ -685,7 +685,7 @@ PrepareForSetTargetAPZCNotification(nsIWidget* aWidget,
// element again and bail out on this operation.
APZCCH_LOG("Widget %p's document element %p didn't have a displayport\n",
aWidget, dpElement.get());
- APZCCallbackHelper::InitializeRootDisplayport(aRootFrame->PresContext()->PresShell());
+ APZCCallbackHelper::InitializeRootDisplayport(aRootFrame->PresShell());
return false;
}
diff --git a/gfx/layers/client/CanvasClient.cpp b/gfx/layers/client/CanvasClient.cpp
index ad8d740ba32e..056e773dfcde 100644
--- a/gfx/layers/client/CanvasClient.cpp
+++ b/gfx/layers/client/CanvasClient.cpp
@@ -268,7 +268,7 @@ static already_AddRefed
TexClientFromReadback(SharedSurface* src, CompositableForwarder* allocator,
TextureFlags baseFlags, LayersBackend layersBackend)
{
- auto backendType = gfx::BackendType::CAIRO;
+ auto backendType = gfx::BackendType::SKIA;
TexClientFactory factory(allocator, src->mHasAlpha, src->mSize, backendType,
baseFlags, layersBackend);
diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp
index 8c26de230d38..a7131127586d 100644
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -1141,11 +1141,6 @@ TextureClient::CreateForDrawing(TextureForwarder* aAllocator,
return MakeAndAddRef(data, aTextureFlags, aAllocator);
}
- if (moz2DBackend == BackendType::SKIA && aFormat == SurfaceFormat::B8G8R8X8) {
- // Skia doesn't support RGBX, so ensure we clear the buffer for the proper alpha values.
- aAllocFlags = TextureAllocationFlags(aAllocFlags | ALLOC_CLEAR_BUFFER);
- }
-
// Can't do any better than a buffer texture client.
return TextureClient::CreateForRawBufferAccess(aAllocator, aFormat, aSize,
moz2DBackend, aLayersBackend,
@@ -1250,13 +1245,20 @@ TextureClient::CreateForRawBufferAccess(LayersIPCChannel* aAllocator,
return nullptr;
}
- // D2D backend does not support CreateDrawTargetForData(). Use CAIRO instead.
- if (aMoz2DBackend == gfx::BackendType::DIRECT2D ||
- aMoz2DBackend == gfx::BackendType::DIRECT2D1_1) {
- aMoz2DBackend = gfx::BackendType::CAIRO;
+ if (aFormat == SurfaceFormat::B8G8R8X8) {
+ // Skia doesn't support RGBX, so ensure we clear the buffer for the proper alpha values.
+ aAllocFlags = TextureAllocationFlags(aAllocFlags | ALLOC_CLEAR_BUFFER);
}
- TextureData* texData = BufferTextureData::Create(aSize, aFormat, aMoz2DBackend,
+ // Note that we ignore the backend type if we get here. It should only be D2D
+ // or Skia, and D2D does not support data surfaces. Therefore it is safe to
+ // force the buffer to be Skia.
+ NS_WARNING_ASSERTION(aMoz2DBackend != gfx::BackendType::SKIA &&
+ aMoz2DBackend != gfx::BackendType::DIRECT2D &&
+ aMoz2DBackend != gfx::BackendType::DIRECT2D1_1,
+ "Unsupported TextureClient backend type");
+
+ TextureData* texData = BufferTextureData::Create(aSize, aFormat, gfx::BackendType::SKIA,
aLayersBackend, aTextureFlags,
aAllocFlags, aAllocator);
if (!texData) {
diff --git a/gfx/layers/wr/WebRenderCommandBuilder.cpp b/gfx/layers/wr/WebRenderCommandBuilder.cpp
index aed64c29dd2d..a2f19e9172a1 100644
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -81,7 +81,7 @@ WebRenderCommandBuilder::BuildWebRenderCommands(wr::DisplayListBuilder& aBuilder
mLayerScrollData.emplace_back();
mLayerScrollData.back().InitializeRoot(mLayerScrollData.size() - 1);
if (aDisplayListBuilder->IsBuildingLayerEventRegions()) {
- nsIPresShell* shell = aDisplayListBuilder->RootReferenceFrame()->PresContext()->PresShell();
+ nsIPresShell* shell = aDisplayListBuilder->RootReferenceFrame()->PresShell();
if (nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(shell)) {
mLayerScrollData.back().SetEventRegionsOverride(EventRegionsOverride::ForceDispatchToContent);
}
diff --git a/image/VectorImage.cpp b/image/VectorImage.cpp
index a3f45c4bbe0a..d4d903c549dd 100644
--- a/image/VectorImage.cpp
+++ b/image/VectorImage.cpp
@@ -94,7 +94,7 @@ protected:
if (mHonoringInvalidations && !mDocWrapper->ShouldIgnoreInvalidation()) {
nsIFrame* frame = elem->GetPrimaryFrame();
- if (!frame || frame->PresContext()->PresShell()->IsDestroying()) {
+ if (!frame || frame->PresShell()->IsDestroying()) {
// We're being destroyed. Bail out.
return;
}
diff --git a/ipc/glue/BackgroundUtils.cpp b/ipc/glue/BackgroundUtils.cpp
index a0982bfa6f68..6fe9eb3851eb 100644
--- a/ipc/glue/BackgroundUtils.cpp
+++ b/ipc/glue/BackgroundUtils.cpp
@@ -387,6 +387,7 @@ LoadInfoToLoadInfoArgs(nsILoadInfo *aLoadInfo,
aLoadInfo->GetUpgradeInsecureRequests(),
aLoadInfo->GetVerifySignedContent(),
aLoadInfo->GetEnforceSRI(),
+ aLoadInfo->GetForceAllowDataURI(),
aLoadInfo->GetForceInheritPrincipalDropped(),
aLoadInfo->GetInnerWindowID(),
aLoadInfo->GetOuterWindowID(),
@@ -495,6 +496,7 @@ LoadInfoArgsToLoadInfo(const OptionalLoadInfoArgs& aOptionalLoadInfoArgs,
loadInfoArgs.upgradeInsecureRequests(),
loadInfoArgs.verifySignedContent(),
loadInfoArgs.enforceSRI(),
+ loadInfoArgs.forceAllowDataURI(),
loadInfoArgs.forceInheritPrincipalDropped(),
loadInfoArgs.innerWindowID(),
loadInfoArgs.outerWindowID(),
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
index 98e7bd46b0ff..f5d578eb67e8 100644
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -3130,8 +3130,17 @@ Parser::functionArguments(YieldHandling yieldHandling,
return false;
}
+ // The next step is to detect arguments with default expressions,
+ // e.g. |function parseInt(str, radix = 10) {}|. But if we have a
+ // parentheses-free arrow function, |a => ...|, the '=' necessary
+ // for a default expression would really be an assignment operator:
+ // that is, |a = b => 42;| would parse as |a = (b => 42);|. So we
+ // should stop parsing arguments here.
+ if (parenFreeArrow)
+ break;
+
bool matched;
- if (!tokenStream.matchToken(&matched, TOK_ASSIGN))
+ if (!tokenStream.matchToken(&matched, TOK_ASSIGN, TokenStream::Operand))
return false;
if (matched) {
// A default argument without parentheses would look like:
@@ -3166,10 +3175,11 @@ Parser::functionArguments(YieldHandling yieldHandling,
return false;
}
- if (parenFreeArrow || IsSetterKind(kind))
+ // Setter syntax uniquely requires exactly one argument.
+ if (IsSetterKind(kind))
break;
- if (!tokenStream.matchToken(&matched, TOK_COMMA))
+ if (!tokenStream.matchToken(&matched, TOK_COMMA, TokenStream::Operand))
return false;
if (!matched)
break;
@@ -3177,16 +3187,14 @@ Parser::functionArguments(YieldHandling yieldHandling,
if (!hasRest) {
if (!tokenStream.peekToken(&tt, TokenStream::Operand))
return null();
- if (tt == TOK_RP) {
- tokenStream.addModifierException(TokenStream::NoneIsOperand);
+ if (tt == TOK_RP)
break;
- }
}
}
if (!parenFreeArrow) {
TokenKind tt;
- if (!tokenStream.getToken(&tt))
+ if (!tokenStream.getToken(&tt, TokenStream::Operand))
return false;
if (tt != TOK_RP) {
if (IsSetterKind(kind)) {
@@ -4443,8 +4451,10 @@ Parser::objectBindingPattern(DeclarationKind kind,
TokenKind tt;
if (!tokenStream.peekToken(&tt))
return null();
- if (tt == TOK_RC)
+ if (tt == TOK_RC) {
+ tokenStream.addModifierException(TokenStream::OperandIsNone);
break;
+ }
if (tt == TOK_TRIPLEDOT) {
tokenStream.consumeKnownToken(TOK_TRIPLEDOT);
@@ -4484,7 +4494,7 @@ Parser::objectBindingPattern(DeclarationKind kind,
return null();
bool hasInitializer;
- if (!tokenStream.matchToken(&hasInitializer, TOK_ASSIGN))
+ if (!tokenStream.matchToken(&hasInitializer, TOK_ASSIGN, TokenStream::Operand))
return null();
Node bindingExpr = hasInitializer
@@ -4530,7 +4540,7 @@ Parser::objectBindingPattern(DeclarationKind kind,
}
bool matched;
- if (!tokenStream.matchToken(&matched, TOK_COMMA))
+ if (!tokenStream.matchToken(&matched, TOK_COMMA, TokenStream::Operand))
return null();
if (!matched)
break;
@@ -4540,7 +4550,7 @@ Parser::objectBindingPattern(DeclarationKind kind,
}
}
- MUST_MATCH_TOKEN_MOD_WITH_REPORT(TOK_RC, TokenStream::None,
+ MUST_MATCH_TOKEN_MOD_WITH_REPORT(TOK_RC, TokenStream::Operand,
reportMissingClosing(JSMSG_CURLY_AFTER_LIST,
JSMSG_CURLY_OPENED, begin));
@@ -4575,6 +4585,7 @@ Parser::arrayBindingPattern(DeclarationKind kind, YieldHand
if (tt == TOK_RB) {
tokenStream.ungetToken();
+ tokenStream.addModifierException(TokenStream::OperandIsNone);
break;
}
@@ -4600,7 +4611,7 @@ Parser::arrayBindingPattern(DeclarationKind kind, YieldHand
return null();
bool hasInitializer;
- if (!tokenStream.matchToken(&hasInitializer, TOK_ASSIGN))
+ if (!tokenStream.matchToken(&hasInitializer, TOK_ASSIGN, TokenStream::Operand))
return null();
Node element = hasInitializer
@@ -4615,7 +4626,7 @@ Parser::arrayBindingPattern(DeclarationKind kind, YieldHand
if (tt != TOK_COMMA) {
// If we didn't already match TOK_COMMA in above case.
bool matched;
- if (!tokenStream.matchToken(&matched, TOK_COMMA))
+ if (!tokenStream.matchToken(&matched, TOK_COMMA, TokenStream::Operand))
return null();
if (!matched)
break;
@@ -4627,7 +4638,7 @@ Parser::arrayBindingPattern(DeclarationKind kind, YieldHand
}
}
- MUST_MATCH_TOKEN_MOD_WITH_REPORT(TOK_RB, TokenStream::None,
+ MUST_MATCH_TOKEN_MOD_WITH_REPORT(TOK_RB, TokenStream::Operand,
reportMissingClosing(JSMSG_BRACKET_AFTER_LIST,
JSMSG_BRACKET_OPENED, begin));
@@ -7931,7 +7942,7 @@ Parser::condExpr(InHandling inHandling, YieldHandling yield
if (!thenExpr)
return null();
- MUST_MATCH_TOKEN(TOK_COLON, JSMSG_COLON_IN_COND);
+ MUST_MATCH_TOKEN_MOD(TOK_COLON, TokenStream::Operand, JSMSG_COLON_IN_COND);
Node elseExpr = assignExpr(inHandling, yieldHandling, TripledotProhibited);
if (!elseExpr)
@@ -8021,6 +8032,7 @@ Parser::assignExpr(InHandling inHandling, YieldHandling yie
PossibleError possibleErrorInner(*this);
Node lhs;
TokenKind tokenAfterLHS;
+ bool isArrow;
if (maybeAsyncArrow) {
tokenStream.consumeKnownToken(TOK_ASYNC, TokenStream::Operand);
@@ -8034,54 +8046,33 @@ Parser::assignExpr(InHandling inHandling, YieldHandling yie
if (!name)
return null();
- if (!tokenStream.getToken(&tokenAfterLHS))
+ if (!tokenStream.peekTokenSameLine(&tokenAfterLHS))
return null();
if (tokenAfterLHS != TOK_ARROW) {
error(JSMSG_UNEXPECTED_TOKEN,
- "'=>' after argument list", TokenKindToDesc(tokenAfterLHS));
+ "'=>' on the same line after an argument list", TokenKindToDesc(tokenAfterLHS));
return null();
}
+
+ isArrow = true;
} else {
lhs = condExpr(inHandling, yieldHandling, tripledotHandling, &possibleErrorInner, invoked);
if (!lhs)
return null();
- if (!tokenStream.getToken(&tokenAfterLHS))
+ // Use Operand here because the ConditionalExpression parsed above
+ // could be the entirety of this AssignmentExpression, and then ASI
+ // permits this token to be a regular expression.
+ if (!tokenStream.peekTokenSameLine(&tokenAfterLHS, TokenStream::Operand))
return null();
+
+ isArrow = tokenAfterLHS == TOK_ARROW;
}
- ParseNodeKind kind;
- switch (tokenAfterLHS) {
- case TOK_ASSIGN: kind = PNK_ASSIGN; break;
- case TOK_ADDASSIGN: kind = PNK_ADDASSIGN; break;
- case TOK_SUBASSIGN: kind = PNK_SUBASSIGN; break;
- case TOK_BITORASSIGN: kind = PNK_BITORASSIGN; break;
- case TOK_BITXORASSIGN: kind = PNK_BITXORASSIGN; break;
- case TOK_BITANDASSIGN: kind = PNK_BITANDASSIGN; break;
- case TOK_LSHASSIGN: kind = PNK_LSHASSIGN; break;
- case TOK_RSHASSIGN: kind = PNK_RSHASSIGN; break;
- case TOK_URSHASSIGN: kind = PNK_URSHASSIGN; break;
- case TOK_MULASSIGN: kind = PNK_MULASSIGN; break;
- case TOK_DIVASSIGN: kind = PNK_DIVASSIGN; break;
- case TOK_MODASSIGN: kind = PNK_MODASSIGN; break;
- case TOK_POWASSIGN: kind = PNK_POWASSIGN; break;
-
- case TOK_ARROW: {
-
- // A line terminator between ArrowParameters and the => should trigger a SyntaxError.
- tokenStream.ungetToken();
- TokenKind next;
- if (!tokenStream.peekTokenSameLine(&next))
- return null();
- MOZ_ASSERT(next == TOK_ARROW || next == TOK_EOL);
-
- if (next != TOK_ARROW) {
- error(JSMSG_LINE_BREAK_BEFORE_ARROW);
- return null();
- }
-
+ if (isArrow) {
tokenStream.seek(start);
+ TokenKind next;
if (!tokenStream.getToken(&next, TokenStream::Operand))
return null();
uint32_t toStringStart = pos().begin;
@@ -8111,7 +8102,25 @@ Parser::assignExpr(InHandling inHandling, YieldHandling yie
return functionDefinition(pn, toStringStart, inHandling, yieldHandling, nullptr,
Arrow, GeneratorKind::NotGenerator, asyncKind);
- }
+ }
+
+ MOZ_ALWAYS_TRUE(tokenStream.getToken(&tokenAfterLHS, TokenStream::Operand));
+
+ ParseNodeKind kind;
+ switch (tokenAfterLHS) {
+ case TOK_ASSIGN: kind = PNK_ASSIGN; break;
+ case TOK_ADDASSIGN: kind = PNK_ADDASSIGN; break;
+ case TOK_SUBASSIGN: kind = PNK_SUBASSIGN; break;
+ case TOK_BITORASSIGN: kind = PNK_BITORASSIGN; break;
+ case TOK_BITXORASSIGN: kind = PNK_BITXORASSIGN; break;
+ case TOK_BITANDASSIGN: kind = PNK_BITANDASSIGN; break;
+ case TOK_LSHASSIGN: kind = PNK_LSHASSIGN; break;
+ case TOK_RSHASSIGN: kind = PNK_RSHASSIGN; break;
+ case TOK_URSHASSIGN: kind = PNK_URSHASSIGN; break;
+ case TOK_MULASSIGN: kind = PNK_MULASSIGN; break;
+ case TOK_DIVASSIGN: kind = PNK_DIVASSIGN; break;
+ case TOK_MODASSIGN: kind = PNK_MODASSIGN; break;
+ case TOK_POWASSIGN: kind = PNK_POWASSIGN; break;
default:
MOZ_ASSERT(!tokenStream.isCurrentTokenAssignment());
@@ -8123,7 +8132,6 @@ Parser::assignExpr(InHandling inHandling, YieldHandling yie
}
tokenStream.ungetToken();
- tokenStream.addModifierException(TokenStream::OperandIsNone);
return lhs;
}
@@ -8711,7 +8719,7 @@ Parser::argumentList(YieldHandling yieldHandling, Node list
handler.addList(listNode, argNode);
bool matched;
- if (!tokenStream.matchToken(&matched, TOK_COMMA))
+ if (!tokenStream.matchToken(&matched, TOK_COMMA, TokenStream::Operand))
return false;
if (!matched)
break;
@@ -8719,13 +8727,11 @@ Parser::argumentList(YieldHandling yieldHandling, Node list
TokenKind tt;
if (!tokenStream.peekToken(&tt, TokenStream::Operand))
return null();
- if (tt == TOK_RP) {
- tokenStream.addModifierException(TokenStream::NoneIsOperand);
+ if (tt == TOK_RP)
break;
- }
}
- MUST_MATCH_TOKEN(TOK_RP, JSMSG_PAREN_AFTER_ARGS);
+ MUST_MATCH_TOKEN_MOD(TOK_RP, TokenStream::Operand, JSMSG_PAREN_AFTER_ARGS);
handler.setEndPosition(listNode, pos().end);
return true;
@@ -9593,15 +9599,18 @@ Parser::propertyName(YieldHandling yieldHandling,
error(JSMSG_BAD_PROP_ID);
return null();
}
+
tokenStream.ungetToken();
- *propType = tt == TOK_ASSIGN ?
- PropertyType::CoverInitializedName :
- PropertyType::Shorthand;
+ tokenStream.addModifierException(TokenStream::OperandIsNone);
+ *propType = tt == TOK_ASSIGN
+ ? PropertyType::CoverInitializedName
+ : PropertyType::Shorthand;
return propName;
}
if (tt == TOK_LP) {
tokenStream.ungetToken();
+
if (isGenerator && isAsync)
*propType = PropertyType::AsyncGeneratorMethod;
else if (isGenerator)
@@ -9638,7 +9647,7 @@ Parser::computedPropertyName(YieldHandling yieldHandling,
if (!assignNode)
return null();
- MUST_MATCH_TOKEN(TOK_RB, JSMSG_COMP_PROP_UNTERM_EXPR);
+ MUST_MATCH_TOKEN_MOD(TOK_RB, TokenStream::Operand, JSMSG_COMP_PROP_UNTERM_EXPR);
return handler.newComputedName(assignNode, begin, pos().end);
}
@@ -9663,8 +9672,10 @@ Parser::objectLiteral(YieldHandling yieldHandling,
TokenKind tt;
if (!tokenStream.peekToken(&tt))
return null();
- if (tt == TOK_RC)
+ if (tt == TOK_RC) {
+ tokenStream.addModifierException(TokenStream::OperandIsNone);
break;
+ }
if (tt == TOK_TRIPLEDOT) {
tokenStream.consumeKnownToken(TOK_TRIPLEDOT);
@@ -9850,7 +9861,7 @@ Parser::objectLiteral(YieldHandling yieldHandling,
}
bool matched;
- if (!tokenStream.matchToken(&matched, TOK_COMMA))
+ if (!tokenStream.matchToken(&matched, TOK_COMMA, TokenStream::Operand))
return null();
if (!matched)
break;
@@ -9858,7 +9869,7 @@ Parser::objectLiteral(YieldHandling yieldHandling,
possibleError->setPendingDestructuringErrorAt(pos(), JSMSG_REST_WITH_COMMA);
}
- MUST_MATCH_TOKEN_MOD_WITH_REPORT(TOK_RC, TokenStream::None,
+ MUST_MATCH_TOKEN_MOD_WITH_REPORT(TOK_RC, TokenStream::Operand,
reportMissingClosing(JSMSG_CURLY_AFTER_LIST,
JSMSG_CURLY_OPENED, openedPos));
diff --git a/js/src/jit-test/README b/js/src/jit-test/README
index c3281c8d163c..966cafb40bb1 100644
--- a/js/src/jit-test/README
+++ b/js/src/jit-test/README
@@ -2,12 +2,12 @@ JS Trace Test Suite
* PURPOSE
-This is a test suite for testing TraceMonkey. All tests are run in the JS shell
+This is a test suite for testing the SpiderMonkey JIT. All tests are run in the JS shell
with tracing enabled (-j).
* REQUIREMENTS
-Python 2.5. This is already a standard requirement for building our tree.
+Python 2.7. This is already a standard requirement for building our tree.
* RUNNING THE TESTS
diff --git a/js/src/tests/README.txt b/js/src/tests/README.txt
index 53f546975df2..147c669b9b33 100644
--- a/js/src/tests/README.txt
+++ b/js/src/tests/README.txt
@@ -4,14 +4,14 @@ JS Test Suite Readme
The JS test suite is a fairly extensive collection of correctness and regression
tests for the Spidermonkey engine. Two harnesses run these tests: the shell test
harness in this directory and the "reftest" harness built into the browser, used
-by Tinderbox. The browser reftests require additional manifest files; these are
+in continuous integration. The browser reftests require additional manifest files; these are
generated automatically by the build phase 'package-tests' using the
'--make-manifests' option to jstests.py.
Creating a test
---------------
For general information, see
-https://developer.mozilla.org/en-US/docs/SpiderMonkey/Creating_JavaScript_tests
+https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Creating_JavaScript_tests
Adding a test
-------------
diff --git a/js/src/tests/ecma_6/ArrowFunctions/arrow-not-as-end-of-statement.js b/js/src/tests/ecma_6/ArrowFunctions/arrow-not-as-end-of-statement.js
index 202c13876a32..9c9921656580 100644
--- a/js/src/tests/ecma_6/ArrowFunctions/arrow-not-as-end-of-statement.js
+++ b/js/src/tests/ecma_6/ArrowFunctions/arrow-not-as-end-of-statement.js
@@ -8,12 +8,64 @@
assertEq(`x ${a => {}} z`, "x a => {} z");
+for (a => {}; ; )
+ break;
+
for (; a => {}; )
break;
for (; ; a => {})
break;
+Function.prototype[Symbol.iterator] = function() { return { next() { return { done: true }; } }; };
+for (let m of 0 ? 1 : a => {})
+ assertEq(true, false);
+for (let [m] of 0 ? 1 : a => {})
+ assertEq(true, false);
+delete Function.prototype[Symbol.iterator];
+
+for (let w in 0 ? 1 : a => {})
+ break;
+for (let [w] in 0 ? 1 : a => {})
+ break;
+
+function* stargen()
+{
+ yield a => {}
+ /Q/g;
+
+ var first = true;
+ Function.prototype[Symbol.iterator] = function() {
+ return {
+ next() {
+ var res = { done: true, value: 8675309 };
+ if (first)
+ {
+ res = { value: "fnord", done: false };
+ first = false;
+ }
+
+ return res;
+ }
+ };
+ };
+
+
+ yield* a => {}
+ /Q/g;
+
+ delete Function.prototype[Symbol.iterator];
+
+ yield 99;
+}
+var gen = stargen();
+assertEq(typeof gen.next().value, "function");
+var result = gen.next();
+assertEq(result.value, "fnord");
+assertEq(result.done, false);
+assertEq(gen.next().value, 99);
+assertEq(gen.next().done, true);
+
switch (1)
{
case a => {}:
@@ -53,15 +105,106 @@ switch (a => {})
with (a => {});
assertEq(typeof (a => {}), "function");
+assertEq(typeof (a => b => {}), "function");
for (var x in y => {})
continue;
+assertEq(eval("a => {}, 17, 42;"), 42);
+assertEq(eval("42, a => {}, 17;"), 17);
+assertEq(typeof eval("17, 42, a => {};"), "function");
+
+assertEq(eval("1 ? 0 : a => {}, 17, 42;"), 42);
+assertEq(eval("42, 1 ? 0 : a => {}, 17;"), 17);
+assertEq(eval("17, 42, 1 ? 0 : a => {};"), 0);
+
var z = { x: 0 ? 1 : async a => {} };
assertEq(typeof z.x, "function");
var q = 0 ? 1 : async () => {};
assertEq(typeof q, "function");
+var m = 0 ? 42 : m = foo => {} // ASI
+/Q/g;
+assertEq(typeof m, "function");
+
+var { q: w = 0 ? 1 : a => {} } = {};
+assertEq(typeof w, "function");
+
+Function.prototype.c = 42;
+var { c } = 0 ? 1 : a => {} // ASI
+/Q/g;
+assertEq(c, 42);
+
+var c = 0 ? 1 : a => {}
+/Q/g;
+assertEq(typeof c, "function");
+delete Function.prototype.c;
+
+assertEq(typeof eval(0 ? 1 : a => {}), "function");
+
+var zoom = 1 ? a => {} : 357;
+assertEq(typeof zoom, "function");
+
+var { b = 0 ? 1 : a => {} } = {};
+assertEq(typeof b, "function");
+
+var [k = 0 ? 1 : a => {}] = [];
+assertEq(typeof k, "function");
+
+assertEq(typeof [0 ? 1 : a => {}][0], "function");
+
+Function.prototype[Symbol.iterator] = function() { return { next() { return { done: true }; } }; };
+assertEq([...0 ? 1 : a => {}].length, 0);
+delete Function.prototype[Symbol.iterator];
+
+var props = Object.getOwnPropertyNames({ ...0 ? 1 : a => {} }).sort();
+assertEq(props.length, 0);
+
+function f1(x = 0 ? 1 : a => {}) { return x; }
+assertEq(typeof f1(), "function");
+assertEq(f1(5), 5);
+
+var g1 = (x = 0 ? 1 : a => {}) => { return x; };
+assertEq(typeof g1(), "function");
+assertEq(g1(5), 5);
+
+var h1 = async (x = 0 ? 1 : a => {}) => { return x; };
+assertEq(typeof h1, "function");
+
+function f2(m, x = 0 ? 1 : a => {}) { return x; }
+assertEq(typeof f2(1), "function");
+assertEq(f2(1, 5), 5);
+
+var g2 = (m, x = 0 ? 1 : a => {}) => { return x; };
+assertEq(typeof g2(1), "function");
+assertEq(g2(1, 5), 5);
+
+var h2 = async (m, x = 0 ? 1 : a => {}) => { return x; };
+assertEq(typeof h2, "function");
+
+function f3(x = 0 ? 1 : a => {}, q) { return x; }
+assertEq(typeof f3(), "function");
+assertEq(f3(5), 5);
+
+var g3 = (x = 0 ? 1 : a => {}, q) => { return x; };
+assertEq(typeof g3(), "function");
+assertEq(g3(5), 5);
+
+var h3 = async (x = 0 ? 1 : a => {}, q) => { return x; };
+assertEq(typeof h3, "function");
+
+var asyncf = async () => {};
+assertEq(typeof asyncf, "function");
+
+var { [0 ? 1 : a => {}]: h } = { "a => {}": "boo-urns!" };
+assertEq(h, "boo-urns!");
+
+var gencomp = (for (prop of [0]) 0 ? 1 : a => {});
+assertEq(typeof gencomp.next().value, "function");
+
+var arrcomp = [for (prop of [0]) 0 ? 1 : a => {}];
+assertEq(typeof arrcomp[0], "function");
+
if (typeof reportCompare === "function")
reportCompare(true, true);
diff --git a/js/src/tests/ecma_6/Comprehensions/inside-derived-class.js b/js/src/tests/ecma_6/Comprehensions/inside-derived-class.js
new file mode 100644
index 000000000000..4ebdb090416a
--- /dev/null
+++ b/js/src/tests/ecma_6/Comprehensions/inside-derived-class.js
@@ -0,0 +1,32 @@
+/*
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/licenses/publicdomain/
+ */
+
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 1299519;
+var summary =
+ "Generator comprehension lambdas in derived constructors shouldn't assert";
+
+print(BUGNUMBER + ": " + summary);
+
+/**************
+ * BEGIN TEST *
+ **************/
+
+class Base {};
+
+class Derived extends Base
+{
+ constructor() {
+ var a = (for (_ of []) _);
+ var b = [for (_ of []) _];
+ }
+};
+
+/******************************************************************************/
+
+if (typeof reportCompare === "function")
+ reportCompare(true, true);
+
+print("Tests complete");
diff --git a/layout/base/AccessibleCaret.cpp b/layout/base/AccessibleCaret.cpp
index 965caa834d5c..3fffa37ac7cd 100644
--- a/layout/base/AccessibleCaret.cpp
+++ b/layout/base/AccessibleCaret.cpp
@@ -269,7 +269,7 @@ AccessibleCaret::RemoveCaretElement(nsIDocument* aDocument)
frame = frame->GetPlaceholderFrame();
}
nsAutoScriptBlocker scriptBlocker;
- nsCSSFrameConstructor* fc = frame->PresContext()->PresShell()->FrameConstructor();
+ nsCSSFrameConstructor* fc = frame->PresShell()->FrameConstructor();
fc->BeginUpdate();
frame->GetParent()->RemoveFrame(nsIFrame::kPrincipalList, frame);
fc->EndUpdate();
diff --git a/layout/base/PositionedEventTargeting.cpp b/layout/base/PositionedEventTargeting.cpp
index fa6bfc3f3502..0ab51152ac72 100644
--- a/layout/base/PositionedEventTargeting.cpp
+++ b/layout/base/PositionedEventTargeting.cpp
@@ -584,7 +584,7 @@ FindFrameTargetedByInputEvent(WidgetGUIEvent* aEvent,
// never be targeted --- something nsSubDocumentFrame in an ancestor document
// would be targeted instead.
nsIFrame* restrictToDescendants = target ?
- target->PresContext()->PresShell()->GetRootFrame() : aRootFrame;
+ target->PresShell()->GetRootFrame() : aRootFrame;
nsRect targetRect = GetTargetRect(aRootFrame, aPointRelativeToRootFrame,
restrictToDescendants, prefs, aFlags);
diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp
index 8d6f7c1080a1..f7209f2a6e30 100644
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -5277,7 +5277,7 @@ PresShell::AddCanvasBackgroundColorItem(nsDisplayListBuilder& aBuilder,
bool addedScrollingBackgroundColor = (aFlags & APPEND_UNSCROLLED_ONLY);
if (!aFrame->GetParent() && !addedScrollingBackgroundColor) {
nsIScrollableFrame* sf =
- aFrame->PresContext()->PresShell()->GetRootScrollFrameAsScrollable();
+ aFrame->PresShell()->GetRootScrollFrameAsScrollable();
if (sf) {
nsCanvasFrame* canvasFrame = do_QueryFrame(sf->GetScrolledFrame());
if (canvasFrame && canvasFrame->IsVisibleForPainting(&aBuilder)) {
@@ -5566,7 +5566,7 @@ static nsView* FindFloatingViewContaining(nsView* aView, nsPoint aPt)
nsIFrame* frame = aView->GetFrame();
if (frame) {
if (!frame->IsVisibleConsideringAncestors(nsIFrame::VISIBILITY_CROSS_CHROME_CONTENT_BOUNDARY) ||
- !frame->PresContext()->PresShell()->IsActive()) {
+ !frame->PresShell()->IsActive()) {
return nullptr;
}
}
@@ -5603,7 +5603,7 @@ static nsView* FindViewContaining(nsView* aView, nsPoint aPt)
nsIFrame* frame = aView->GetFrame();
if (frame) {
if (!frame->IsVisibleConsideringAncestors(nsIFrame::VISIBILITY_CROSS_CHROME_CONTENT_BOUNDARY) ||
- !frame->PresContext()->PresShell()->IsActive()) {
+ !frame->PresShell()->IsActive()) {
return nullptr;
}
}
@@ -5785,7 +5785,7 @@ PresShell::MarkFramesInListApproximatelyVisible(const nsDisplayList& aList,
}
// Use the presshell containing the frame.
- auto* presShell = static_cast(frame->PresContext()->PresShell());
+ auto* presShell = static_cast(frame->PresShell());
MOZ_ASSERT(!presShell->AssumeAllFramesVisible());
if (presShell->mApproximatelyVisibleFrames.EnsureInserted(frame)) {
// The frame was added to mApproximatelyVisibleFrames, so increment its visible count.
@@ -5919,7 +5919,7 @@ PresShell::MarkFramesInSubtreeApproximatelyVisible(nsIFrame* aFrame,
Maybe& aVisibleRegions,
bool aRemoveOnly /* = false */)
{
- MOZ_ASSERT(aFrame->PresContext()->PresShell() == this, "wrong presshell");
+ MOZ_ASSERT(aFrame->PresShell() == this, "wrong presshell");
if (aFrame->TrackingVisibility() &&
aFrame->StyleVisibility()->IsVisible() &&
@@ -7266,8 +7266,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
return NS_OK;
}
- PresShell* shell =
- static_cast(frame->PresContext()->PresShell());
+ PresShell* shell = static_cast(frame->PresShell());
switch (aEvent->mMessage) {
case eTouchMove:
case eTouchCancel:
@@ -7296,8 +7295,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
break;
}
- shell = static_cast(
- contentFrame->PresContext()->PresShell());
+ shell = static_cast(contentFrame->PresShell());
if (shell) {
break;
}
diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp
index 51c1b2a2604d..49fa4396807e 100644
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -728,6 +728,16 @@ RecomputePosition(nsIFrame* aFrame)
return false;
}
+ // Flexbox and Grid layout supports CSS Align and the optimizations below
+ // don't support that yet.
+ if (aFrame->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW)) {
+ nsIFrame* ph = aFrame->GetPlaceholderFrame();
+ if (ph && ph->HasAnyStateBits(PLACEHOLDER_STATICPOS_NEEDS_CSSALIGN)) {
+ StyleChangeReflow(aFrame, nsChangeHint_NeedReflow);
+ return false;
+ }
+ }
+
aFrame->SchedulePaint();
// For relative positioning, we can simply update the frame rect
@@ -797,7 +807,7 @@ RecomputePosition(nsIFrame* aFrame)
// doesn't need to change, we can simply update the frame position. Otherwise
// we fall back to a reflow.
RefPtr rc =
- aFrame->PresContext()->PresShell()->CreateReferenceRenderingContext();
+ aFrame->PresShell()->CreateReferenceRenderingContext();
// Construct a bogus parent reflow state so that there's a usable
// containing block reflow state.
@@ -1235,7 +1245,7 @@ StyleChangeReflow(nsIFrame* aFrame, nsChangeHint aHint)
}
do {
- aFrame->PresContext()->PresShell()->FrameNeedsReflow(
+ aFrame->PresShell()->FrameNeedsReflow(
aFrame, dirtyType, dirtyBits, rootHandling);
aFrame = nsLayoutUtils::GetNextContinuationOrIBSplitSibling(aFrame);
} while (aFrame);
diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp
index 510ca003f725..423a5f3685a5 100644
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -855,7 +855,7 @@ GetScrollFrameFromContent(nsIContent* aContent)
{
nsIFrame* frame = aContent->GetPrimaryFrame();
if (aContent->OwnerDoc()->GetRootElement() == aContent) {
- nsIPresShell* presShell = frame ? frame->PresContext()->PresShell() : nullptr;
+ nsIPresShell* presShell = frame ? frame->PresShell() : nullptr;
if (!presShell) {
presShell = aContent->OwnerDoc()->GetShell();
}
@@ -2176,7 +2176,7 @@ nsLayoutUtils::GetNearestScrollableFrame(nsIFrame* aFrame, uint32_t aFlags)
}
}
if (aFlags & SCROLLABLE_ALWAYS_MATCH_ROOT) {
- nsIPresShell* ps = f->PresContext()->PresShell();
+ nsIPresShell* ps = f->PresShell();
if (ps->GetRootScrollFrame() == f &&
ps->GetDocument() && ps->GetDocument()->IsRootDisplayDocument()) {
return scrollableFrame;
@@ -2186,7 +2186,7 @@ nsLayoutUtils::GetNearestScrollableFrame(nsIFrame* aFrame, uint32_t aFlags)
if ((aFlags & SCROLLABLE_FIXEDPOS_FINDS_ROOT) &&
f->StyleDisplay()->mPosition == NS_STYLE_POSITION_FIXED &&
nsLayoutUtils::IsReallyFixedPos(f)) {
- return f->PresContext()->PresShell()->GetRootScrollFrameAsScrollable();
+ return f->PresShell()->GetRootScrollFrameAsScrollable();
}
}
return nullptr;
@@ -2376,7 +2376,7 @@ nsLayoutUtils::GetEventCoordinatesRelativeTo(nsIWidget* aWidget,
int32_t rootAPD = rootFrame->PresContext()->AppUnitsPerDevPixel();
int32_t localAPD = aFrame->PresContext()->AppUnitsPerDevPixel();
widgetToView = widgetToView.ScaleToOtherAppUnits(rootAPD, localAPD);
- nsIPresShell* shell = aFrame->PresContext()->PresShell();
+ nsIPresShell* shell = aFrame->PresShell();
// XXX Bug 1224748 - Update nsLayoutUtils functions to correctly handle nsPresShell resolution
widgetToView = widgetToView.RemoveResolution(GetCurrentAPZResolutionScale(shell));
@@ -2777,7 +2777,7 @@ nsLayoutUtils::FindNearestCommonAncestorFrame(nsIFrame* aFrame1, nsIFrame* aFram
AutoTArray ancestors2;
nsIFrame* commonAncestor = nullptr;
if (aFrame1->PresContext() == aFrame2->PresContext()) {
- commonAncestor = aFrame1->PresContext()->PresShell()->GetRootFrame();
+ commonAncestor = aFrame1->PresShell()->GetRootFrame();
}
for (nsIFrame* f = aFrame1; f != commonAncestor;
f = nsLayoutUtils::GetCrossDocParentFrame(f)) {
@@ -3278,8 +3278,7 @@ nsLayoutUtils::GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect,
}
if (aFlags & IGNORE_ROOT_SCROLL_FRAME) {
- nsIFrame* rootScrollFrame =
- aFrame->PresContext()->PresShell()->GetRootScrollFrame();
+ nsIFrame* rootScrollFrame = aFrame->PresShell()->GetRootScrollFrame();
if (rootScrollFrame) {
builder.SetIgnoreScrollFrame(rootScrollFrame);
}
@@ -3460,11 +3459,11 @@ nsLayoutUtils::SetZeroMarginDisplayPortOnAsyncScrollableAncestors(nsIFrame* aFra
frame = do_QueryFrame(scrollAncestor);
MOZ_ASSERT(frame);
MOZ_ASSERT(scrollAncestor->WantAsyncScroll() ||
- frame->PresContext()->PresShell()->GetRootScrollFrame() == frame);
+ frame->PresShell()->GetRootScrollFrame() == frame);
if (nsLayoutUtils::AsyncPanZoomEnabled(frame) &&
!nsLayoutUtils::HasDisplayPort(frame->GetContent())) {
nsLayoutUtils::SetDisplayPortMargins(
- frame->GetContent(), frame->PresContext()->PresShell(), ScreenMargin(), 0,
+ frame->GetContent(), frame->PresShell(), ScreenMargin(), 0,
aRepaintMode);
}
}
@@ -3533,7 +3532,7 @@ nsLayoutUtils::ExpireDisplayPortOnAsyncScrollableAncestor(nsIFrame* aFrame)
break;
}
MOZ_ASSERT(scrollAncestor->WantAsyncScroll() ||
- frame->PresContext()->PresShell()->GetRootScrollFrame() == frame);
+ frame->PresShell()->GetRootScrollFrame() == frame);
if (nsLayoutUtils::HasDisplayPort(frame->GetContent())) {
scrollAncestor->TriggerDisplayPortExpiration();
// Stop after the first trigger. If it failed, there's no point in
@@ -4283,7 +4282,7 @@ void nsLayoutUtils::RectListBuilder::AddRect(const nsRect& aRect) {
nsIFrame* nsLayoutUtils::GetContainingBlockForClientRect(nsIFrame* aFrame)
{
- return aFrame->PresContext()->PresShell()->GetRootFrame();
+ return aFrame->PresShell()->GetRootFrame();
}
nsRect
@@ -4763,8 +4762,7 @@ nsLayoutUtils::IsViewportScrollbarFrame(nsIFrame* aFrame)
if (!aFrame)
return false;
- nsIFrame* rootScrollFrame =
- aFrame->PresContext()->PresShell()->GetRootScrollFrame();
+ nsIFrame* rootScrollFrame = aFrame->PresShell()->GetRootScrollFrame();
if (!rootScrollFrame)
return false;
@@ -6489,7 +6487,7 @@ nsLayoutUtils::GetClosestLayer(nsIFrame* aFrame)
}
if (layer)
return layer;
- return aFrame->PresContext()->PresShell()->FrameManager()->GetRootFrame();
+ return aFrame->PresShell()->FrameManager()->GetRootFrame();
}
SamplingFilter
@@ -8834,13 +8832,13 @@ nsLayoutUtils::CalculateExpandedScrollableRect(nsIFrame* aFrame)
{
nsRect scrollableRect =
CalculateScrollableRectForFrame(aFrame->GetScrollTargetFrame(),
- aFrame->PresContext()->PresShell()->GetRootFrame());
+ aFrame->PresShell()->GetRootFrame());
nsSize compSize = CalculateCompositionSizeForFrame(aFrame);
- if (aFrame == aFrame->PresContext()->PresShell()->GetRootScrollFrame()) {
+ if (aFrame == aFrame->PresShell()->GetRootScrollFrame()) {
// the composition size for the root scroll frame does not include the
// local resolution, so we adjust.
- float res = aFrame->PresContext()->PresShell()->GetResolution();
+ float res = aFrame->PresShell()->GetResolution();
compSize.width = NSToCoordRound(compSize.width / res);
compSize.height = NSToCoordRound(compSize.height / res);
}
diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp
index bddf1718308f..6a4c67b64444 100644
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -552,7 +552,7 @@ public:
static_cast(mFrame.GetFrame());
static_cast(combo->mDropdownFrame)->
SetSuppressScrollbarUpdate(true);
- nsCOMPtr shell = mFrame->PresContext()->PresShell();
+ nsCOMPtr shell = mFrame->PresShell();
shell->FrameNeedsReflow(combo->mDropdownFrame, nsIPresShell::eResize,
NS_FRAME_IS_DIRTY);
shell->FlushPendingNotifications(FlushType::Layout);
@@ -1046,7 +1046,7 @@ nsComboboxControlFrame::HandleRedisplayTextEvent()
ActuallyDisplayText(true);
// XXXbz This should perhaps be eResize. Check.
- PresContext()->PresShell()->FrameNeedsReflow(mDisplayFrame,
+ PresShell()->FrameNeedsReflow(mDisplayFrame,
nsIPresShell::eStyleChange,
NS_FRAME_IS_DIRTY);
@@ -1364,7 +1364,7 @@ nsComboboxControlFrame::CreateFrameForDisplayNode()
MOZ_ASSERT(mDisplayContent);
// Get PresShell
- nsIPresShell *shell = PresContext()->PresShell();
+ nsIPresShell *shell = PresShell();
StyleSetHandle styleSet = shell->StyleSet();
// create the style contexts for the anonymous block frame and text frame
diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp
index 415e96c7d40f..adb89fa00e6d 100644
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -1982,7 +1982,7 @@ nsListControlFrame::ScrollToFrame(dom::HTMLOptionElement& aOptElement)
// otherwise we find the content's frame and scroll to it
nsIFrame* childFrame = aOptElement.GetPrimaryFrame();
if (childFrame) {
- PresContext()->PresShell()->
+ PresShell()->
ScrollFrameRectIntoView(childFrame,
nsRect(nsPoint(0, 0), childFrame->GetSize()),
nsIPresShell::ScrollAxis(), nsIPresShell::ScrollAxis(),
diff --git a/layout/forms/nsMeterFrame.cpp b/layout/forms/nsMeterFrame.cpp
index 91eff1af6d62..18cdd8101f83 100644
--- a/layout/forms/nsMeterFrame.cpp
+++ b/layout/forms/nsMeterFrame.cpp
@@ -200,9 +200,8 @@ nsMeterFrame::AttributeChanged(int32_t aNameSpaceID,
aAttribute == nsGkAtoms::min )) {
nsIFrame* barFrame = mBarDiv->GetPrimaryFrame();
NS_ASSERTION(barFrame, "The meter frame should have a child with a frame!");
- PresContext()->PresShell()->FrameNeedsReflow(barFrame,
- nsIPresShell::eResize,
- NS_FRAME_IS_DIRTY);
+ PresShell()->FrameNeedsReflow(barFrame, nsIPresShell::eResize,
+ NS_FRAME_IS_DIRTY);
InvalidateFrame();
}
diff --git a/layout/forms/nsProgressFrame.cpp b/layout/forms/nsProgressFrame.cpp
index c6ca8368c52d..5ba47aeb03dd 100644
--- a/layout/forms/nsProgressFrame.cpp
+++ b/layout/forms/nsProgressFrame.cpp
@@ -212,7 +212,7 @@ nsProgressFrame::AttributeChanged(int32_t aNameSpaceID,
if (aNameSpaceID == kNameSpaceID_None &&
(aAttribute == nsGkAtoms::value || aAttribute == nsGkAtoms::max)) {
- auto shell = PresContext()->PresShell();
+ auto shell = PresShell();
for (auto childFrame : PrincipalChildList()) {
shell->FrameNeedsReflow(childFrame, nsIPresShell::eResize,
NS_FRAME_IS_DIRTY);
diff --git a/layout/forms/nsRangeFrame.cpp b/layout/forms/nsRangeFrame.cpp
index b1e0e65d1163..b99705e57f0d 100644
--- a/layout/forms/nsRangeFrame.cpp
+++ b/layout/forms/nsRangeFrame.cpp
@@ -630,7 +630,7 @@ nsRangeFrame::UpdateForValueChange()
#ifdef ACCESSIBILITY
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
- accService->RangeValueChanged(PresContext()->PresShell(), mContent);
+ accService->RangeValueChanged(PresShell(), mContent);
}
#endif
@@ -760,8 +760,8 @@ nsRangeFrame::AttributeChanged(int32_t aNameSpaceID,
UpdateForValueChange();
}
} else if (aAttribute == nsGkAtoms::orient) {
- PresContext()->PresShell()->FrameNeedsReflow(this, nsIPresShell::eResize,
- NS_FRAME_IS_DIRTY);
+ PresShell()->FrameNeedsReflow(this, nsIPresShell::eResize,
+ NS_FRAME_IS_DIRTY);
}
}
diff --git a/layout/generic/TextOverflow.cpp b/layout/generic/TextOverflow.cpp
index c997f6920679..b5a2f8ccdd64 100644
--- a/layout/generic/TextOverflow.cpp
+++ b/layout/generic/TextOverflow.cpp
@@ -41,7 +41,7 @@ public:
virtual already_AddRefed GetRefDrawTarget() override
{
RefPtr ctx =
- mFrame->PresContext()->PresShell()->CreateReferenceRenderingContext();
+ mFrame->PresShell()->CreateReferenceRenderingContext();
RefPtr dt = ctx->GetDrawTarget();
return dt.forget();
}
@@ -822,7 +822,7 @@ TextOverflow::CanHaveTextOverflow(nsIFrame* aBlockFrame)
}
// Inhibit the markers if a descendant content owns the caret.
- RefPtr caret = aBlockFrame->PresContext()->PresShell()->GetCaret();
+ RefPtr caret = aBlockFrame->PresShell()->GetCaret();
if (caret && caret->IsVisible()) {
nsCOMPtr domSelection = caret->GetSelection();
if (domSelection) {
@@ -896,7 +896,7 @@ TextOverflow::Marker::SetupString(nsIFrame* aFrame)
}
} else {
RefPtr rc =
- aFrame->PresContext()->PresShell()->CreateReferenceRenderingContext();
+ aFrame->PresShell()->CreateReferenceRenderingContext();
RefPtr fm =
nsLayoutUtils::GetInflatedFontMetricsForFrame(aFrame);
mISize = nsLayoutUtils::AppUnitWidthOfStringBidi(mStyle->mString, aFrame,
diff --git a/layout/generic/ViewportFrame.cpp b/layout/generic/ViewportFrame.cpp
index a6b4c55c50bb..1e480e7de805 100644
--- a/layout/generic/ViewportFrame.cpp
+++ b/layout/generic/ViewportFrame.cpp
@@ -178,7 +178,7 @@ ViewportFrame::BuildDisplayListForTopLayer(nsDisplayListBuilder* aBuilder,
}
}
- nsIPresShell* shell = PresContext()->PresShell();
+ nsIPresShell* shell = PresShell();
if (nsCanvasFrame* canvasFrame = shell->GetCanvasFrame()) {
if (Element* container = canvasFrame->GetCustomContentContainer()) {
if (nsIFrame* frame = container->GetPrimaryFrame()) {
@@ -279,7 +279,7 @@ ViewportFrame::AdjustReflowInputAsContainingBlock(ReflowInput* aReflowInput) con
// If a scroll position clamping scroll-port size has been set, layout
// fixed position elements to this size instead of the computed size.
nsRect rect(0, 0, aReflowInput->ComputedWidth(), aReflowInput->ComputedHeight());
- nsIPresShell* ps = PresContext()->PresShell();
+ nsIPresShell* ps = PresShell();
if (ps->IsScrollPositionClampingScrollPortSizeSet()) {
rect.SizeTo(ps->GetScrollPositionClampingScrollPortSize());
}
@@ -399,7 +399,7 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
nsSubDocumentFrame* container = static_cast
(nsLayoutUtils::GetCrossDocParentFrame(this));
if (container && !container->ShouldClipSubdocument()) {
- container->PresContext()->PresShell()->
+ container->PresShell()->
FrameNeedsReflow(container, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
}
}
@@ -412,7 +412,7 @@ bool
ViewportFrame::ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas)
{
nsIScrollableFrame* rootScrollFrame =
- PresContext()->PresShell()->GetRootScrollFrameAsScrollable();
+ PresShell()->GetRootScrollFrameAsScrollable();
if (rootScrollFrame && !rootScrollFrame->IsIgnoringViewportClipping()) {
return false;
}
diff --git a/layout/generic/nsAbsoluteContainingBlock.cpp b/layout/generic/nsAbsoluteContainingBlock.cpp
index 9cc6df039214..0f12b802897e 100644
--- a/layout/generic/nsAbsoluteContainingBlock.cpp
+++ b/layout/generic/nsAbsoluteContainingBlock.cpp
@@ -70,7 +70,7 @@ nsAbsoluteContainingBlock::AppendFrames(nsIFrame* aDelegatingFrame,
// no damage to intrinsic widths, since absolutely positioned frames can't
// change them
- aDelegatingFrame->PresContext()->PresShell()->
+ aDelegatingFrame->PresShell()->
FrameNeedsReflow(aDelegatingFrame, nsIPresShell::eResize,
NS_FRAME_HAS_DIRTY_CHILDREN);
}
@@ -92,7 +92,7 @@ nsAbsoluteContainingBlock::InsertFrames(nsIFrame* aDelegatingFrame,
// no damage to intrinsic widths, since absolutely positioned frames can't
// change them
- aDelegatingFrame->PresContext()->PresShell()->
+ aDelegatingFrame->PresShell()->
FrameNeedsReflow(aDelegatingFrame, nsIPresShell::eResize,
NS_FRAME_HAS_DIRTY_CHILDREN);
}
diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp
index 0930ec2201cd..7b33146518ab 100644
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -3044,9 +3044,8 @@ nsBlockFrame::AttributeChanged(int32_t aNameSpaceID,
if (ancestor) {
// XXX Not sure if this is necessary anymore
if (ancestor->RenumberList()) {
- PresContext()->PresShell()->
- FrameNeedsReflow(ancestor, nsIPresShell::eStyleChange,
- NS_FRAME_HAS_DIRTY_CHILDREN);
+ PresShell()->FrameNeedsReflow(ancestor, nsIPresShell::eStyleChange,
+ NS_FRAME_HAS_DIRTY_CHILDREN);
}
}
}
@@ -5103,7 +5102,7 @@ nsBlockFrame::SetOverflowOutOfFlows(const nsFrameList& aList,
nsFrameList* list = RemovePropTableFrames(OverflowOutOfFlowsProperty());
NS_ASSERTION(aPropValue == list, "prop value mismatch");
list->Clear();
- list->Delete(PresContext()->PresShell());
+ list->Delete(PresShell());
RemoveStateBits(NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS);
}
else if (GetStateBits() & NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS) {
@@ -5112,7 +5111,7 @@ nsBlockFrame::SetOverflowOutOfFlows(const nsFrameList& aList,
*aPropValue = aList;
}
else {
- SetPropTableFrames(new (PresContext()->PresShell()) nsFrameList(aList),
+ SetPropTableFrames(new (PresShell()) nsFrameList(aList),
OverflowOutOfFlowsProperty());
AddStateBits(NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS);
}
@@ -5170,7 +5169,7 @@ nsBlockFrame::EnsurePushedFloats()
if (result)
return result;
- result = new (PresContext()->PresShell()) nsFrameList;
+ result = new (PresShell()) nsFrameList;
SetProperty(PushedFloatProperty(), result);
AddStateBits(NS_BLOCK_HAS_PUSHED_FLOATS);
@@ -5234,7 +5233,7 @@ nsBlockFrame::AppendFrames(ChildListID aListID,
AddFrames(aFrameList, lastKid);
if (aListID != kNoReflowPrincipalList) {
- PresContext()->PresShell()->
+ PresShell()->
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
NS_FRAME_HAS_DIRTY_CHILDREN); // XXX sufficient?
}
@@ -5270,7 +5269,7 @@ nsBlockFrame::InsertFrames(ChildListID aListID,
AddFrames(aFrameList, aPrevFrame);
if (aListID != kNoReflowPrincipalList) {
- PresContext()->PresShell()->
+ PresShell()->
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
NS_FRAME_HAS_DIRTY_CHILDREN); // XXX sufficient?
}
@@ -5316,7 +5315,7 @@ nsBlockFrame::RemoveFrame(ChildListID aListID,
MOZ_CRASH("unexpected child list");
}
- PresContext()->PresShell()->
+ PresShell()->
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
NS_FRAME_HAS_DIRTY_CHILDREN); // XXX sufficient?
}
@@ -7095,7 +7094,7 @@ void
nsBlockFrame::CreateBulletFrameForListItem(bool aCreateBulletList,
bool aListStylePositionInside)
{
- nsIPresShell* shell = PresContext()->PresShell();
+ nsIPresShell* shell = PresShell();
CSSPseudoElementType pseudoType = aCreateBulletList ?
CSSPseudoElementType::mozListBullet :
diff --git a/layout/generic/nsBlockFrame.h b/layout/generic/nsBlockFrame.h
index 74881be3a490..5c34e378008b 100644
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -440,16 +440,16 @@ protected:
}
nsLineBox* NewLineBox(nsIFrame* aFrame, bool aIsBlock) {
- return NS_NewLineBox(PresContext()->PresShell(), aFrame, aIsBlock);
+ return NS_NewLineBox(PresShell(), aFrame, aIsBlock);
}
nsLineBox* NewLineBox(nsLineBox* aFromLine, nsIFrame* aFrame, int32_t aCount) {
- return NS_NewLineBox(PresContext()->PresShell(), aFromLine, aFrame, aCount);
+ return NS_NewLineBox(PresShell(), aFromLine, aFrame, aCount);
}
void FreeLineBox(nsLineBox* aLine) {
if (aLine == GetLineCursor()) {
ClearLineCursor();
}
- aLine->Destroy(PresContext()->PresShell());
+ aLine->Destroy(PresShell());
}
/**
* Helper method for StealFrame.
diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp
index 2324644ffab7..980edc02cfe2 100644
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -95,8 +95,7 @@ nsContainerFrame::SetInitialChildList(ChildListID aListID,
"The placeholder should points to a backdrop frame");
}
#endif
- nsFrameList* list =
- new (PresContext()->PresShell()) nsFrameList(aChildList);
+ nsFrameList* list = new (PresShell()) nsFrameList(aChildList);
SetProperty(BackdropProperty(), list);
} else {
MOZ_ASSERT_UNREACHABLE("Unexpected child list");
@@ -118,9 +117,8 @@ nsContainerFrame::AppendFrames(ChildListID aListID,
mFrames.AppendFrames(this, aFrameList);
if (aListID != kNoReflowPrincipalList) {
- PresContext()->PresShell()->
- FrameNeedsReflow(this, nsIPresShell::eTreeChange,
- NS_FRAME_HAS_DIRTY_CHILDREN);
+ PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
+ NS_FRAME_HAS_DIRTY_CHILDREN);
}
}
@@ -142,9 +140,8 @@ nsContainerFrame::InsertFrames(ChildListID aListID,
mFrames.InsertFrames(this, aPrevFrame, aFrameList);
if (aListID != kNoReflowPrincipalList) {
- PresContext()->PresShell()->
- FrameNeedsReflow(this, nsIPresShell::eTreeChange,
- NS_FRAME_HAS_DIRTY_CHILDREN);
+ PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
+ NS_FRAME_HAS_DIRTY_CHILDREN);
}
}
@@ -162,7 +159,7 @@ nsContainerFrame::RemoveFrame(ChildListID aListID,
if (kNoReflowPrincipalList == aListID) {
generateReflowCommand = false;
}
- nsIPresShell* shell = PresContext()->PresShell();
+ nsIPresShell* shell = PresShell();
nsContainerFrame* lastParent = nullptr;
while (aOldFrame) {
nsIFrame* oldFrameNextContinuation = aOldFrame->GetNextContinuation();
@@ -1257,7 +1254,7 @@ TryRemoveFrame(nsIFrame* aFrame,
// aChildToRemove *may* have been removed from this list.
if (list->IsEmpty()) {
aFrame->RemoveProperty(aProp);
- list->Delete(aFrame->PresContext()->PresShell());
+ list->Delete(aFrame->PresShell());
}
return true;
}
@@ -1641,7 +1638,7 @@ nsContainerFrame::DrainExcessOverflowContainersList(ChildFrameMerger aMergeFunc)
} else if (overflowContainers) {
aMergeFunc(*overflowContainers, toMove, this);
if (selfExcessOCFrames->IsEmpty()) {
- selfExcessOCFrames->Delete(PresContext()->PresShell());
+ selfExcessOCFrames->Delete(PresShell());
} else {
SetPropTableFrames(selfExcessOCFrames, ExcessOverflowContainersProperty());
}
@@ -1651,7 +1648,7 @@ nsContainerFrame::DrainExcessOverflowContainersList(ChildFrameMerger aMergeFunc)
overflowContainers = selfExcessOCFrames;
} else {
SetPropTableFrames(selfExcessOCFrames, ExcessOverflowContainersProperty());
- auto shell = PresContext()->PresShell();
+ auto shell = PresShell();
overflowContainers = new (shell) nsFrameList(toMove);
}
SetPropTableFrames(overflowContainers, OverflowContainersProperty());
@@ -1987,9 +1984,8 @@ nsContainerFrame::AttributeChanged(int32_t aNameSpaceID,
// XXX Not sure if this is necessary anymore
if (RenumberList()) {
- PresContext()->PresShell()->
- FrameNeedsReflow(this, nsIPresShell::eStyleChange,
- NS_FRAME_HAS_DIRTY_CHILDREN);
+ PresShell()->FrameNeedsReflow(this, nsIPresShell::eStyleChange,
+ NS_FRAME_HAS_DIRTY_CHILDREN);
}
}
return rv;
diff --git a/layout/generic/nsContainerFrame.h b/layout/generic/nsContainerFrame.h
index a8f359c5bb4c..4880742d6524 100644
--- a/layout/generic/nsContainerFrame.h
+++ b/layout/generic/nsContainerFrame.h
@@ -937,7 +937,7 @@ nsContainerFrame::DestroyOverflowList()
{
nsFrameList* list = RemovePropTableFrames(OverflowProperty());
MOZ_ASSERT(list && list->IsEmpty());
- list->Delete(PresContext()->PresShell());
+ list->Delete(PresShell());
}
#endif /* nsContainerFrame_h___ */
diff --git a/layout/generic/nsFontInflationData.cpp b/layout/generic/nsFontInflationData.cpp
index 34bcd5ed73b6..a6cee25e6c5e 100644
--- a/layout/generic/nsFontInflationData.cpp
+++ b/layout/generic/nsFontInflationData.cpp
@@ -204,7 +204,7 @@ nsFontInflationData::UpdateISize(const ReflowInput &aReflowInput)
// See comment above "font.size.inflation.lineThreshold" in
// modules/libpref/src/init/all.js .
- nsIPresShell* presShell = bfc->PresContext()->PresShell();
+ nsIPresShell* presShell = bfc->PresShell();
uint32_t lineThreshold = presShell->FontSizeInflationLineThreshold();
nscoord newTextThreshold = (newNCAISize * lineThreshold) / 100;
diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp
index f130f5562085..db094beeadbc 100644
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -715,7 +715,7 @@ nsFrame::Init(nsIContent* aContent,
"root frame should always be a container");
}
- if (PresContext()->PresShell()->AssumeAllFramesVisible() &&
+ if (PresShell()->AssumeAllFramesVisible() &&
TrackingVisibility()) {
IncApproximateVisibleCount();
}
@@ -1946,7 +1946,7 @@ nsIFrame::GetVisibility() const
void
nsIFrame::UpdateVisibilitySynchronously()
{
- nsIPresShell* presShell = PresContext()->PresShell();
+ nsIPresShell* presShell = PresShell();
if (!presShell) {
return;
}
@@ -2015,7 +2015,7 @@ nsIFrame::EnableVisibilityTracking()
AddStateBits(NS_FRAME_VISIBILITY_IS_TRACKED);
SetProperty(VisibilityStateProperty(), 0);
- nsIPresShell* presShell = PresContext()->PresShell();
+ nsIPresShell* presShell = PresShell();
if (!presShell) {
return;
}
@@ -2477,7 +2477,7 @@ DisplayDebugBorders(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
}
// Draw a border around the current event target
if (nsFrame::GetShowEventTargetFrameBorder() &&
- aFrame->PresContext()->PresShell()->GetDrawEventTargetFrame() == aFrame) {
+ aFrame->PresShell()->GetDrawEventTargetFrame() == aFrame) {
aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(aBuilder, aFrame, PaintEventTargetBorder, "EventTargetBorder",
DisplayItemType::TYPE_EVENT_TARGET_BORDER));
@@ -3369,7 +3369,7 @@ DescendIntoChild(nsDisplayListBuilder* aBuilder, nsIFrame *aChild,
// There are cases where the "ignore scroll frame" on the builder is not set
// correctly, and so we additionally want to catch cases where the child is
// a root scrollframe and we are ignoring scrolling on the viewport.
- nsIPresShell* shell = child->PresContext()->PresShell();
+ nsIPresShell* shell = child->PresShell();
bool keepDescending = child == aBuilder->GetIgnoreScrollFrame() ||
(shell->IgnoringViewportScrolling() && child == shell->GetRootScrollFrame());
if (!keepDescending) {
@@ -3556,7 +3556,7 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
// (which means we're painting it, modulo occlusion), mark it as visible
// within the displayport.
if (aBuilder->IsPaintingToWindow() && child->TrackingVisibility()) {
- child->PresContext()->PresShell()->EnsureFrameInApproximatelyVisibleList(child);
+ child->PresShell()->EnsureFrameInApproximatelyVisibleList(child);
awayFromCommonPath = true;
}
@@ -4594,7 +4594,7 @@ NS_IMETHODIMP nsFrame::HandleRelease(nsPresContext* aPresContext,
offsets = GetContentOffsetsFromPoint(pt, SKIP_HIDDEN);
handleTableSelection = false;
} else {
- GetDataForTableSelection(frameselection, PresContext()->PresShell(),
+ GetDataForTableSelection(frameselection, PresShell(),
aEvent->AsMouseEvent(),
getter_AddRefs(parentContent),
&contentOffsetForTableSel,
@@ -7924,7 +7924,7 @@ nsIFrame::GetConstFrameSelection() const
frame = frame->GetParent();
}
- return PresContext()->PresShell()->ConstFrameSelection();
+ return PresShell()->ConstFrameSelection();
}
bool
diff --git a/layout/generic/nsFrameSelection.cpp b/layout/generic/nsFrameSelection.cpp
index 300bdbe43874..efde175705d6 100644
--- a/layout/generic/nsFrameSelection.cpp
+++ b/layout/generic/nsFrameSelection.cpp
@@ -542,7 +542,7 @@ nsFrameSelection::ConstrainFrameAndPointToAnchorSubtree(nsIFrame *aFrame,
// If the mouse cursor in on a frame which is descendant of same
// selection root, we can expand the selection to the frame.
- if (cursorFrame && cursorFrame->PresContext()->PresShell() == mShell)
+ if (cursorFrame && cursorFrame->PresShell() == mShell)
{
nsIContent* cursorContent = cursorFrame->GetContent();
NS_ENSURE_TRUE(cursorContent, NS_ERROR_FAILURE);
diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp
index 4ace8b7f5b85..53807e9fb123 100644
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -381,7 +381,7 @@ nsHTMLScrollFrame::TryLayout(ScrollReflowInput* aState,
std::max(0, aState->mInsideBorderSize.height - hScrollbarDesiredHeight));
nsSize visualScrollPortSize = scrollPortSize;
- nsIPresShell* presShell = PresContext()->PresShell();
+ nsIPresShell* presShell = PresShell();
if (mHelper.mIsRoot && presShell->IsScrollPositionClampingScrollPortSizeSet()) {
nsSize compositionSize = nsLayoutUtils::CalculateCompositionSizeForFrame(this, false);
float resolution = presShell->GetResolution();
@@ -1055,7 +1055,7 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
PlaceScrollArea(state, oldScrollPosition);
if (!mHelper.mPostedReflowCallback) {
// Make sure we'll try scrolling to restored position
- PresContext()->PresShell()->PostReflowCallback(&mHelper);
+ PresShell()->PostReflowCallback(&mHelper);
mHelper.mPostedReflowCallback = true;
}
@@ -1879,7 +1879,7 @@ public:
}
mCallee = aCallee;
- APZCCallbackHelper::SuppressDisplayport(true, mCallee->mOuter->PresContext()->PresShell());
+ APZCCallbackHelper::SuppressDisplayport(true, mCallee->mOuter->PresShell());
return true;
}
@@ -1904,7 +1904,7 @@ private:
void RemoveObserver() {
if (mCallee) {
RefreshDriver(mCallee)->RemoveRefreshObserver(this, FlushType::Style);
- APZCCallbackHelper::SuppressDisplayport(false, mCallee->mOuter->PresContext()->PresShell());
+ APZCCallbackHelper::SuppressDisplayport(false, mCallee->mOuter->PresShell());
}
}
};
@@ -2091,7 +2091,7 @@ ScrollFrameHelper::ScrollFrameHelper(nsContainerFrame* aOuter,
// active scroll containers so that we paint by whole tile increments
// when scrolling.
nsLayoutUtils::SetDisplayPortMargins(mOuter->GetContent(),
- mOuter->PresContext()->PresShell(),
+ mOuter->PresShell(),
ScreenMargin(),
0,
nsLayoutUtils::RepaintMode::DoNotRepaint);
@@ -2452,13 +2452,13 @@ bool ScrollFrameHelper::IsIgnoringViewportClipping() const
if (!mIsRoot)
return false;
nsSubDocumentFrame* subdocFrame = static_cast
- (nsLayoutUtils::GetCrossDocParentFrame(mOuter->PresContext()->PresShell()->GetRootFrame()));
+ (nsLayoutUtils::GetCrossDocParentFrame(mOuter->PresShell()->GetRootFrame()));
return subdocFrame && !subdocFrame->ShouldClipSubdocument();
}
void ScrollFrameHelper::MarkScrollbarsDirtyForReflow() const
{
- nsIPresShell* presShell = mOuter->PresContext()->PresShell();
+ nsIPresShell* presShell = mOuter->PresShell();
if (mVScrollbarBox) {
presShell->FrameNeedsReflow(mVScrollbarBox, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
}
@@ -2472,7 +2472,7 @@ bool ScrollFrameHelper::ShouldClampScrollPosition() const
if (!mIsRoot)
return true;
nsSubDocumentFrame* subdocFrame = static_cast
- (nsLayoutUtils::GetCrossDocParentFrame(mOuter->PresContext()->PresShell()->GetRootFrame()));
+ (nsLayoutUtils::GetCrossDocParentFrame(mOuter->PresShell()->GetRootFrame()));
return !subdocFrame || subdocFrame->ShouldClampScrollPosition();
}
@@ -2719,7 +2719,7 @@ ScrollFrameHelper::ScrollActivityCallback(nsITimer *aTimer, void* anInstance)
// Fire the synth mouse move.
self->mScrollActivityTimer->Cancel();
self->mScrollActivityTimer = nullptr;
- self->mOuter->PresContext()->PresShell()->SynthesizeMouseMove(true);
+ self->mOuter->PresShell()->SynthesizeMouseMove(true);
}
@@ -3394,7 +3394,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// Root scrollframes have FrameMetrics and clipping on their container
// layers, so don't apply clipping again.
mAddClipRectToLayer =
- !(mIsRoot && mOuter->PresContext()->PresShell()->GetIsViewportOverridden());
+ !(mIsRoot && mOuter->PresShell()->GetIsViewportOverridden());
// Whether we might want to build a scrollable layer for this scroll frame
// at some point in the future. This controls whether we add the information
@@ -3493,7 +3493,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (mIsRoot) {
clipRect.SizeTo(nsLayoutUtils::CalculateCompositionSizeForFrame(mOuter));
if (mOuter->PresContext()->IsRootContentDocument()) {
- double res = mOuter->PresContext()->PresShell()->GetResolution();
+ double res = mOuter->PresShell()->GetResolution();
clipRect.width = NSToCoordRound(clipRect.width / res);
clipRect.height = NSToCoordRound(clipRect.height / res);
}
@@ -3596,7 +3596,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// Set a displayport so next paint we don't have to force layerization
// after the fact.
nsLayoutUtils::SetDisplayPortMargins(mOuter->GetContent(),
- mOuter->PresContext()->PresShell(),
+ mOuter->PresShell(),
ScreenMargin(),
0,
nsLayoutUtils::RepaintMode::DoNotRepaint);
@@ -3778,7 +3778,7 @@ ScrollFrameHelper::DecideScrollableLayer(nsDisplayListBuilder* aBuilder,
// The displayPort getter takes care of adjusting for resolution. So if
// we have resolution but no displayPort then we need to adjust for
// resolution here.
- nsIPresShell* presShell = mOuter->PresContext()->PresShell();
+ nsIPresShell* presShell = mOuter->PresShell();
*aVisibleRect = aVisibleRect->RemoveResolution(
presShell->ScaleToResolution() ? presShell->GetResolution () : 1.0f);
*aDirtyRect = aDirtyRect->RemoveResolution(
@@ -3947,7 +3947,7 @@ ScrollFrameHelper::GetScrollRangeForClamping() const
nsSize
ScrollFrameHelper::GetScrollPositionClampingScrollPortSize() const
{
- nsIPresShell* presShell = mOuter->PresContext()->PresShell();
+ nsIPresShell* presShell = mOuter->PresShell();
if (mIsRoot && presShell->IsScrollPositionClampingScrollPortSizeSet()) {
return presShell->GetScrollPositionClampingScrollPortSize();
}
@@ -4261,7 +4261,7 @@ ScrollFrameHelper::GetPageScrollAmount() const
if (mIsRoot) {
// Reduce effective scrollport height by the height of any fixed-pos
// headers or footers
- nsIFrame* root = mOuter->PresContext()->PresShell()->GetRootFrame();
+ nsIFrame* root = mOuter->PresShell()->GetRootFrame();
effectiveScrollPortSize =
GetScrollPortSizeExcludingHeadersAndFooters(root, mScrollPort);
} else {
@@ -4659,7 +4659,7 @@ ScrollFrameHelper::Destroy(PostDestroyData& aPostDestroyData)
aPostDestroyData.AddAnonymousContent(mResizerContent.forget());
if (mPostedReflowCallback) {
- mOuter->PresContext()->PresShell()->CancelReflowCallback(this);
+ mOuter->PresShell()->CancelReflowCallback(this);
mPostedReflowCallback = false;
}
@@ -5326,7 +5326,7 @@ nsXULScrollFrame::XULLayout(nsBoxLayoutState& aState)
}
if (!mHelper.mPostedReflowCallback) {
// Make sure we'll try scrolling to restored position
- PresContext()->PresShell()->PostReflowCallback(&mHelper);
+ PresShell()->PostReflowCallback(&mHelper);
mHelper.mPostedReflowCallback = true;
}
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
@@ -5531,7 +5531,7 @@ ScrollFrameHelper::ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas)
// needing reflow. Don't use NS_FRAME_IS_DIRTY as dirty as that means
// we have to reflow the frame and all its descendants, and we don't
// have to do that here. Only this frame needs to be reflowed.
- mOuter->PresContext()->PresShell()->FrameNeedsReflow(
+ mOuter->PresShell()->FrameNeedsReflow(
mOuter, nsIPresShell::eResize, NS_FRAME_HAS_DIRTY_CHILDREN);
// Ensure that next time nsHTMLScrollFrame::Reflow runs, we don't skip
// updating the scrollbars. (Because the overflow area of the scrolled
@@ -5634,7 +5634,7 @@ ScrollFrameHelper::LayoutScrollbars(nsBoxLayoutState& aState,
NS_ASSERTION(!mSuppressScrollbarUpdate,
"This should have been suppressed");
- nsIPresShell* presShell = mOuter->PresContext()->PresShell();
+ nsIPresShell* presShell = mOuter->PresShell();
bool hasResizer = HasResizer();
bool scrollbarOnLeft = !IsScrollbarOnRight();
@@ -5762,7 +5762,7 @@ ScrollFrameHelper::LayoutScrollbars(nsBoxLayoutState& aState,
// post reflow callback to modify scrollbar attributes
mUpdateScrollbarAttributes = true;
if (!mPostedReflowCallback) {
- aState.PresContext()->PresShell()->PostReflowCallback(this);
+ aState.PresShell()->PostReflowCallback(this);
mPostedReflowCallback = true;
}
}
@@ -5779,7 +5779,7 @@ void
ScrollFrameHelper::SetScrollbarEnabled(nsIContent* aContent, nscoord aMaxPos)
{
DebugOnly weakShell(
- do_GetWeakReference(mOuter->PresContext()->PresShell()));
+ do_GetWeakReference(mOuter->PresShell()));
if (aMaxPos) {
aContent->UnsetAttr(kNameSpaceID_None, nsGkAtoms::disabled, true);
} else {
@@ -5794,7 +5794,7 @@ ScrollFrameHelper::SetCoordAttribute(nsIContent* aContent, nsAtom* aAtom,
nscoord aSize)
{
DebugOnly weakShell(
- do_GetWeakReference(mOuter->PresContext()->PresShell()));
+ do_GetWeakReference(mOuter->PresShell()));
// convert to pixels
int32_t pixelSize = nsPresContext::AppUnitsToIntCSSPixels(aSize);
@@ -6093,7 +6093,7 @@ ScrollFrameHelper::SaveState() const
state->SetAllowScrollOriginDowngrade(allowScrollOriginDowngrade);
if (mIsRoot) {
// Only save resolution properties for root scroll frames
- nsIPresShell* shell = mOuter->PresContext()->PresShell();
+ nsIPresShell* shell = mOuter->PresShell();
state->SetResolution(shell->GetResolution());
state->SetScaleToResolution(shell->ScaleToResolution());
}
@@ -6114,7 +6114,7 @@ ScrollFrameHelper::RestoreState(nsPresState* aState)
aState->GetResolution() == 1.0));
if (mIsRoot) {
- nsIPresShell* presShell = mOuter->PresContext()->PresShell();
+ nsIPresShell* presShell = mOuter->PresShell();
if (aState->GetScaleToResolution()) {
presShell->SetResolutionAndScaleTo(aState->GetResolution());
} else {
diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp
index 6cc56b34bcaf..066b14d62a14 100644
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -6687,7 +6687,7 @@ nsGridContainerFrame::NoteNewChildren(ChildListID aListID,
MOZ_ASSERT(supportedLists.Contains(aListID), "unexpected child list");
#endif
- nsIPresShell* shell = PresContext()->PresShell();
+ nsIPresShell* shell = PresShell();
for (auto pif = GetPrevInFlow(); pif; pif = pif->GetPrevInFlow()) {
if (aListID == kPrincipalList) {
pif->AddStateBits(NS_STATE_GRID_DID_PUSH_ITEMS);
@@ -6726,7 +6726,7 @@ nsGridContainerFrame::MergeSortedExcessOverflowContainers(nsFrameList& aList)
if (eoc) {
::MergeSortedFrameLists(*eoc, aList, GetContent());
} else {
- SetPropTableFrames(new (PresContext()->PresShell()) nsFrameList(aList),
+ SetPropTableFrames(new (PresShell()) nsFrameList(aList),
ExcessOverflowContainersProperty());
}
}
@@ -6915,7 +6915,7 @@ nsGridContainerFrame::GetGridFrameWithComputedInfo(nsIFrame* aFrame)
if (reflowNeeded) {
// Trigger a reflow that generates additional grid property data.
- nsIPresShell* shell = gridFrame->PresContext()->PresShell();
+ nsIPresShell* shell = gridFrame->PresShell();
gridFrame->AddStateBits(NS_STATE_GRID_GENERATE_COMPUTED_VALUES);
shell->FrameNeedsReflow(gridFrame,
nsIPresShell::eResize,
diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h
index f525c3267f3e..60bc8e7009c8 100644
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -641,6 +641,10 @@ public:
return StyleContext()->PresContext();
}
+ nsIPresShell* PresShell() const {
+ return PresContext()->PresShell();
+ }
+
/**
* Called to initialize the frame. This is called immediately after creating
* the frame.
diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp
index 8da85dbb53cc..96fb0ff968f0 100644
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -188,7 +188,7 @@ nsImageFrame::DisconnectMap()
#ifdef ACCESSIBILITY
if (nsAccessibilityService* accService = GetAccService()) {
- accService->RecreateAccessible(PresContext()->PresShell(), mContent);
+ accService->RecreateAccessible(PresShell(), mContent);
}
#endif
}
@@ -197,7 +197,7 @@ void
nsImageFrame::DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData)
{
if (mReflowCallbackPosted) {
- PresContext()->PresShell()->CancelReflowCallback(this);
+ PresShell()->CancelReflowCallback(this);
mReflowCallbackPosted = false;
}
@@ -1072,7 +1072,7 @@ nsImageFrame::Reflow(nsPresContext* aPresContext,
FinishAndStoreOverflow(&aMetrics, aReflowInput.mStyleDisplay);
if ((GetStateBits() & NS_FRAME_FIRST_REFLOW) && !mReflowCallbackPosted) {
- nsIPresShell* shell = PresContext()->PresShell();
+ nsIPresShell* shell = PresShell();
mReflowCallbackPosted = true;
shell->PostReflowCallback(this);
}
@@ -2124,7 +2124,7 @@ nsImageFrame::GetCursor(const nsPoint& aPoint,
// here, since it means that areas on which the cursor isn't
// specified will inherit the style from the image.
RefPtr areaStyle =
- PresContext()->PresShell()->StyleSet()->
+ PresShell()->StyleSet()->
ResolveStyleFor(area->AsElement(), StyleContext(),
LazyComputeBehavior::Allow);
FillCursorInformationFromStyle(areaStyle->StyleUserInterface(),
@@ -2150,9 +2150,8 @@ nsImageFrame::AttributeChanged(int32_t aNameSpaceID,
}
if (nsGkAtoms::alt == aAttribute)
{
- PresContext()->PresShell()->FrameNeedsReflow(this,
- nsIPresShell::eStyleChange,
- NS_FRAME_IS_DIRTY);
+ PresShell()->FrameNeedsReflow(this, nsIPresShell::eStyleChange,
+ NS_FRAME_IS_DIRTY);
}
return NS_OK;
diff --git a/layout/generic/nsPluginFrame.cpp b/layout/generic/nsPluginFrame.cpp
index 38d92b78097a..6def7f6d53e3 100644
--- a/layout/generic/nsPluginFrame.cpp
+++ b/layout/generic/nsPluginFrame.cpp
@@ -195,7 +195,7 @@ void
nsPluginFrame::DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData)
{
if (mReflowCallbackPosted) {
- PresContext()->PresShell()->CancelReflowCallback(this);
+ PresShell()->CancelReflowCallback(this);
}
// Ensure our DidComposite observer is gone.
@@ -359,7 +359,7 @@ nsPluginFrame::PrepForDrawing(nsIWidget *aWidget)
#ifdef ACCESSIBILITY
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
- accService->RecreateAccessible(PresContext()->PresShell(), mContent);
+ accService->RecreateAccessible(PresShell(), mContent);
}
#endif
diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp
index e25f91e0e7c6..8668186b4c61 100644
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -221,7 +221,7 @@ nsSubDocumentFrame::GetSubdocumentPresShellForPainting(uint32_t aFlags)
nsIFrame* subdocRootFrame = subdocView->GetFrame();
if (subdocRootFrame) {
- presShell = subdocRootFrame->PresContext()->PresShell();
+ presShell = subdocRootFrame->PresShell();
}
// If painting is suppressed in the presshell, we try to look for a better
@@ -237,7 +237,7 @@ nsSubDocumentFrame::GetSubdocumentPresShellForPainting(uint32_t aFlags)
frame = nextView->GetFrame();
}
if (frame) {
- nsIPresShell* ps = frame->PresContext()->PresShell();
+ nsIPresShell* ps = frame->PresShell();
if (!presShell || (ps && !ps->IsPaintingSuppressed() && sShowPreviousPage)) {
subdocView = nextView;
subdocRootFrame = frame;
@@ -847,7 +847,7 @@ nsSubDocumentFrame::Reflow(nsPresContext* aPresContext,
FinishAndStoreOverflow(&aDesiredSize);
if (!aPresContext->IsPaginated() && !mPostedReflowCallback) {
- PresContext()->PresShell()->PostReflowCallback(this);
+ PresShell()->PostReflowCallback(this);
mPostedReflowCallback = true;
}
@@ -911,7 +911,7 @@ nsSubDocumentFrame::AttributeChanged(int32_t aNameSpaceID,
else if (aAttribute == nsGkAtoms::showresizer) {
nsIFrame* rootFrame = GetSubdocumentRootFrame();
if (rootFrame) {
- rootFrame->PresContext()->PresShell()->
+ rootFrame->PresShell()->
FrameNeedsReflow(rootFrame, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
}
}
@@ -1000,7 +1000,7 @@ void
nsSubDocumentFrame::DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData)
{
if (mPostedReflowCallback) {
- PresContext()->PresShell()->CancelReflowCallback(this);
+ PresShell()->CancelReflowCallback(this);
mPostedReflowCallback = false;
}
@@ -1021,7 +1021,7 @@ nsSubDocumentFrame::DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostD
nsContentUtils::AddScriptRunner(
new nsHideViewer(mContent,
frameloader,
- PresContext()->PresShell(),
+ PresShell(),
(mDidCreateDoc || mCallingShow)));
} else {
frameloader->SetDetachedSubdocFrame(nullptr, nullptr);
@@ -1254,12 +1254,12 @@ nsSubDocumentFrame::EndSwapDocShells(nsIFrame* aOther)
// And repaint them, for good measure, in case there's nothing
// interesting that happens during reflow.
if (weakThis.IsAlive()) {
- PresContext()->PresShell()->
+ PresShell()->
FrameNeedsReflow(this, nsIPresShell::eTreeChange, NS_FRAME_IS_DIRTY);
InvalidateFrameSubtree();
}
if (weakOther.IsAlive()) {
- other->PresContext()->PresShell()->
+ other->PresShell()->
FrameNeedsReflow(other, nsIPresShell::eTreeChange, NS_FRAME_IS_DIRTY);
other->InvalidateFrameSubtree();
}
diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp
index 6df8053c90df..e27ccca03413 100644
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -681,7 +681,7 @@ InvalidateFrameDueToGlyphsChanged(nsIFrame* aFrame)
{
MOZ_ASSERT(aFrame);
- nsIPresShell* shell = aFrame->PresContext()->PresShell();
+ nsIPresShell* shell = aFrame->PresShell();
for (nsIFrame* f = aFrame; f;
f = nsLayoutUtils::GetNextContinuationOrIBSplitSibling(f)) {
f->InvalidateFrame();
@@ -2036,7 +2036,7 @@ static already_AddRefed
CreateReferenceDrawTarget(const nsTextFrame* aTextFrame)
{
RefPtr ctx =
- aTextFrame->PresContext()->PresShell()->CreateReferenceRenderingContext();
+ aTextFrame->PresShell()->CreateReferenceRenderingContext();
RefPtr dt = ctx->GetDrawTarget();
return dt.forget();
}
diff --git a/layout/ipc/RenderFrameParent.cpp b/layout/ipc/RenderFrameParent.cpp
index 092526c34d28..8a6e7e556476 100644
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -362,7 +362,7 @@ nsDisplayRemote::nsDisplayRemote(nsDisplayListBuilder* aBuilder,
if (aBuilder->IsInsidePointerEventsNoneDoc() || frameIsPointerEventsNone) {
mEventRegionsOverride |= EventRegionsOverride::ForceEmptyHitRegion;
}
- if (nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(aFrame->PresContext()->PresShell())) {
+ if (nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(aFrame->PresShell())) {
mEventRegionsOverride |= EventRegionsOverride::ForceDispatchToContent;
}
}
diff --git a/layout/mathml/nsMathMLContainerFrame.cpp b/layout/mathml/nsMathMLContainerFrame.cpp
index aedc2e2905d0..dc3813e68187 100644
--- a/layout/mathml/nsMathMLContainerFrame.cpp
+++ b/layout/mathml/nsMathMLContainerFrame.cpp
@@ -705,7 +705,7 @@ nsMathMLContainerFrame::ReLayoutChildren(nsIFrame* aParentFrame)
if (!parent)
return NS_OK;
- frame->PresContext()->PresShell()->
+ frame->PresShell()->
FrameNeedsReflow(frame, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
return NS_OK;
@@ -770,7 +770,7 @@ nsMathMLContainerFrame::AttributeChanged(int32_t aNameSpaceID,
// XXX Since they are numerous MathML attributes that affect layout, and
// we can't check all of them here, play safe by requesting a reflow.
// XXXldb This should only do work for attributes that cause changes!
- PresContext()->PresShell()->
+ PresShell()->
FrameNeedsReflow(this, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
return NS_OK;
diff --git a/layout/mathml/nsMathMLmactionFrame.cpp b/layout/mathml/nsMathMLmactionFrame.cpp
index 6be40b77c704..af51234e7537 100644
--- a/layout/mathml/nsMathMLmactionFrame.cpp
+++ b/layout/mathml/nsMathMLmactionFrame.cpp
@@ -226,7 +226,7 @@ nsMathMLmactionFrame::AttributeChanged(int32_t aNameSpaceID,
}
if (needsReflow) {
- PresContext()->PresShell()->
+ PresShell()->
FrameNeedsReflow(this, nsIPresShell::eTreeChange, NS_FRAME_IS_DIRTY);
}
@@ -333,7 +333,7 @@ nsMathMLmactionFrame::MouseClick()
mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::selection_, value, notify);
// Now trigger a content-changed reflow...
- PresContext()->PresShell()->
+ PresShell()->
FrameNeedsReflow(mSelectedFrame, nsIPresShell::eTreeChange,
NS_FRAME_IS_DIRTY);
}
diff --git a/layout/mathml/nsMathMLmtableFrame.cpp b/layout/mathml/nsMathMLmtableFrame.cpp
index 8bab100054e6..b7614034c5e2 100644
--- a/layout/mathml/nsMathMLmtableFrame.cpp
+++ b/layout/mathml/nsMathMLmtableFrame.cpp
@@ -743,7 +743,7 @@ nsMathMLmtableWrapperFrame::AttributeChanged(int32_t aNameSpaceID,
// align - just need to issue a dirty (resize) reflow command
if (aAttribute == nsGkAtoms::align) {
- PresContext()->PresShell()->
+ PresShell()->
FrameNeedsReflow(this, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
return NS_OK;
}
@@ -755,7 +755,7 @@ nsMathMLmtableWrapperFrame::AttributeChanged(int32_t aNameSpaceID,
nsMathMLContainerFrame::RebuildAutomaticDataForChildren(GetParent());
// Need to reflow the parent, not us, because this can actually
// affect siblings.
- PresContext()->PresShell()->
+ PresShell()->
FrameNeedsReflow(GetParent(), nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
return NS_OK;
}
diff --git a/layout/mathml/nsMathMLmunderoverFrame.cpp b/layout/mathml/nsMathMLmunderoverFrame.cpp
index 359d36b90737..05ebbc8307c4 100644
--- a/layout/mathml/nsMathMLmunderoverFrame.cpp
+++ b/layout/mathml/nsMathMLmunderoverFrame.cpp
@@ -77,7 +77,7 @@ void
nsMathMLmunderoverFrame::DestroyFrom(nsIFrame* aDestroyRoot, PostDestroyData& aPostDestroyData)
{
if (!mPostReflowIncrementScriptLevelCommands.IsEmpty()) {
- PresContext()->PresShell()->CancelReflowCallback(this);
+ PresShell()->CancelReflowCallback(this);
}
nsMathMLContainerFrame::DestroyFrom(aDestroyRoot, aPostDestroyData);
}
@@ -119,7 +119,7 @@ nsMathMLmunderoverFrame::SetIncrementScriptLevel(uint32_t aChildIndex,
}
if (mPostReflowIncrementScriptLevelCommands.IsEmpty()) {
- PresContext()->PresShell()->PostReflowCallback(this);
+ PresShell()->PostReflowCallback(this);
}
mPostReflowIncrementScriptLevelCommands.AppendElement(
diff --git a/layout/painting/nsCSSRendering.cpp b/layout/painting/nsCSSRendering.cpp
index c16b1898971c..a1bd785271e5 100644
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -1460,7 +1460,7 @@ nsCSSRendering::FindBackgroundFrame(nsIFrame* aForFrame,
nsIFrame** aBackgroundFrame)
{
nsIFrame* rootElementFrame =
- aForFrame->PresContext()->PresShell()->FrameConstructor()->GetRootElementStyleFrame();
+ aForFrame->PresShell()->FrameConstructor()->GetRootElementStyleFrame();
if (IsCanvasFrame(aForFrame)) {
*aBackgroundFrame = FindCanvasBackgroundFrame(aForFrame, rootElementFrame);
return true;
diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp
index 24fa10886066..2f4e35162eea 100644
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -1125,7 +1125,7 @@ void nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame,
// position: fixed items are reflowed into and only drawn inside the
// viewport, or the scroll position clamping scrollport size, if one is
// set.
- nsIPresShell* ps = aFrame->PresContext()->PresShell();
+ nsIPresShell* ps = aFrame->PresShell();
if (ps->IsScrollPositionClampingScrollPortSizeSet()) {
dirtyRectRelativeToDirtyFrame =
nsRect(nsPoint(0, 0), ps->GetScrollPositionClampingScrollPortSize());
@@ -1266,7 +1266,7 @@ nsDisplayListBuilder::EnterPresShell(nsIFrame* aReferenceFrame,
bool aPointerEventsNoneDoc)
{
PresShellState* state = mPresShellStates.AppendElement();
- state->mPresShell = aReferenceFrame->PresContext()->PresShell();
+ state->mPresShell = aReferenceFrame->PresShell();
state->mCaretFrame = nullptr;
state->mFirstFrameMarkedForDisplay = mFramesMarkedForDisplay.Length();
@@ -1349,7 +1349,7 @@ void
nsDisplayListBuilder::LeavePresShell(nsIFrame* aReferenceFrame, nsDisplayList* aPaintedContents)
{
NS_ASSERTION(CurrentPresShellState()->mPresShell ==
- aReferenceFrame->PresContext()->PresShell(),
+ aReferenceFrame->PresShell(),
"Presshell mismatch");
if (mIsPaintingToWindow) {
@@ -1444,7 +1444,7 @@ nsDisplayListBuilder::MarkFramesForDisplayList(nsIFrame* aDirtyFrame,
// Store the current display data so that it can be used for fixed
// background images.
NS_ASSERTION(CurrentPresShellState()->mPresShell ==
- aDirtyFrame->PresContext()->PresShell(),
+ aDirtyFrame->PresShell(),
"Presshell mismatch");
MOZ_ASSERT(!CurrentPresShellState()->mFixedBackgroundDisplayData,
"already traversed this presshell's root frame?");
@@ -3274,7 +3274,7 @@ static Maybe
GetViewportRectRelativeToReferenceFrame(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame)
{
- nsIFrame* rootFrame = aFrame->PresContext()->PresShell()->GetRootFrame();
+ nsIFrame* rootFrame = aFrame->PresShell()->GetRootFrame();
nsRect rootRect = rootFrame->GetRectRelativeToSelf();
if (nsLayoutUtils::TransformRect(rootFrame, aFrame, rootRect) == nsLayoutUtils::TRANSFORM_SUCCEEDED) {
return Some(rootRect + aBuilder->ToReferenceFrame(aFrame));
@@ -6863,7 +6863,7 @@ nsDisplaySubDocument::nsDisplaySubDocument(nsDisplayListBuilder* aBuilder,
MOZ_COUNT_CTOR(nsDisplaySubDocument);
mForceDispatchToContentRegion =
aBuilder->IsBuildingLayerEventRegions() &&
- nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(aFrame->PresContext()->PresShell());
+ nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(aFrame->PresShell());
// The SubDocument display item is conceptually outside the viewport frame,
// so in cases where the viewport frame is an AGR, the SubDocument's AGR
@@ -6950,7 +6950,7 @@ nsDisplaySubDocument::ComputeVisibility(nsDisplayListBuilder* aBuilder,
}
nsRect displayport;
- nsIFrame* rootScrollFrame = mFrame->PresContext()->PresShell()->GetRootScrollFrame();
+ nsIFrame* rootScrollFrame = mFrame->PresShell()->GetRootScrollFrame();
MOZ_ASSERT(rootScrollFrame);
Unused << nsLayoutUtils::GetDisplayPort(rootScrollFrame->GetContent(), &displayport,
RelativeTo::ScrollFrame);
@@ -7027,7 +7027,7 @@ nsDisplayResolution::HitTest(nsDisplayListBuilder* aBuilder,
HitTestState* aState,
nsTArray *aOutFrames)
{
- nsIPresShell* presShell = mFrame->PresContext()->PresShell();
+ nsIPresShell* presShell = mFrame->PresShell();
nsRect rect = aRect.RemoveResolution(presShell->ScaleToResolution() ? presShell->GetResolution () : 1.0f);
mList.HitTest(aBuilder, rect, aState, aOutFrames);
}
@@ -7036,7 +7036,7 @@ already_AddRefed
nsDisplayResolution::BuildLayer(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aContainerParameters) {
- nsIPresShell* presShell = mFrame->PresContext()->PresShell();
+ nsIPresShell* presShell = mFrame->PresShell();
ContainerLayerParameters containerParameters(
presShell->GetResolution(), presShell->GetResolution(), nsIntPoint(),
aContainerParameters);
diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h
index 2cbec92eb4aa..40cf051182a1 100644
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -3310,10 +3310,10 @@ public:
#endif
virtual void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override {
- mFrame->PresContext()->PresShell()->PaintCount(mFrameName, aCtx,
- mFrame->PresContext(),
- mFrame, ToReferenceFrame(),
- mColor);
+ mFrame->PresShell()->PaintCount(mFrameName, aCtx,
+ mFrame->PresContext(),
+ mFrame, ToReferenceFrame(),
+ mColor);
}
NS_DISPLAY_DECL_NAME("nsDisplayReflowCount", TYPE_REFLOW_COUNT)
protected:
@@ -3324,7 +3324,7 @@ protected:
#define DO_GLOBAL_REFLOW_COUNT_DSP(_name) \
PR_BEGIN_MACRO \
if (!aBuilder->IsBackgroundOnly() && !aBuilder->IsForEventDelivery() && \
- PresContext()->PresShell()->IsPaintingFrameCounts()) { \
+ PresShell()->IsPaintingFrameCounts()) { \
aLists.Outlines()->AppendNewToTop( \
new (aBuilder) nsDisplayReflowCount(aBuilder, this, _name)); \
} \
@@ -3333,7 +3333,7 @@ protected:
#define DO_GLOBAL_REFLOW_COUNT_DSP_COLOR(_name, _color) \
PR_BEGIN_MACRO \
if (!aBuilder->IsBackgroundOnly() && !aBuilder->IsForEventDelivery() && \
- PresContext()->PresShell()->IsPaintingFrameCounts()) { \
+ PresShell()->IsPaintingFrameCounts()) { \
aLists.Outlines()->AppendNewToTop( \
new (aBuilder) nsDisplayReflowCount(aBuilder, this, _name, _color)); \
} \
diff --git a/layout/reftests/async-scrolling/reftest.list b/layout/reftests/async-scrolling/reftest.list
index 4b713c02ef12..f545fba3d1a1 100644
--- a/layout/reftests/async-scrolling/reftest.list
+++ b/layout/reftests/async-scrolling/reftest.list
@@ -5,7 +5,7 @@ skip-if(!asyncPan) == bg-fixed-cover-3.html bg-fixed-cover-3-ref.html
skip-if(!asyncPan) == bg-fixed-child.html bg-fixed-child-ref.html
skip-if(!asyncPan) == bg-fixed-child-clip-1.html bg-fixed-child-clip-ref.html
skip-if(!asyncPan) == bg-fixed-child-clip-2.html bg-fixed-child-clip-ref.html
-fuzzy(1,246) fuzzy-if(skiaContent,2,170) fuzzy-if(browserIsRemote&&d2d,53,185) skip-if(!asyncPan) == bg-fixed-child-mask.html bg-fixed-child-mask-ref.html
+fuzzy(1,246) fuzzy-if(skiaContent,2,170) fuzzy-if(browserIsRemote&&d2d,53,187) skip-if(!asyncPan) == bg-fixed-child-mask.html bg-fixed-child-mask-ref.html
skip-if(!asyncPan) == bg-fixed-in-opacity.html bg-fixed-in-opacity-ref.html
skip-if(!asyncPan) == bg-fixed-child-no-culling-1.html bg-fixed-child-no-culling-1-ref.html
skip-if(!asyncPan) == bg-fixed-child-no-culling-2.html bg-fixed-child-no-culling-2-ref.html
diff --git a/layout/reftests/border-radius/reftest.list b/layout/reftests/border-radius/reftest.list
index ac15821ef8f3..ea76c40249c1 100644
--- a/layout/reftests/border-radius/reftest.list
+++ b/layout/reftests/border-radius/reftest.list
@@ -43,22 +43,22 @@ fuzzy-if(skiaContent,17,62) fuzzy-if(webrender,41-41,66-66) == clipping-3.html c
# Tests for clipping the contents of replaced elements and overflow!=visible
!= clipping-4-ref.html clipping-4-notref.html
-fuzzy-if(true,1,20) fuzzy-if(d2d,64,196) fuzzy-if(cocoaWidget,1,180) fuzzy-if(Android,140,237) == clipping-4-canvas.html clipping-4-ref.html # bug 732535
+fuzzy-if(true,1,20) fuzzy-if(d2d,72,196) fuzzy-if(cocoaWidget,1,180) fuzzy-if(Android,140,237) == clipping-4-canvas.html clipping-4-ref.html # bug 732535
fuzzy-if(Android,5,54) fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,10) fuzzy-if(skiaContent,1,172) == clipping-4-image.html clipping-4-ref.html
fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,10) fuzzy-if(skiaContent,1,77) == clipping-4-overflow-hidden.html clipping-4-ref.html
== clipping-5-canvas.html clipping-5-refc.html
fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,5) == clipping-5-image.html clipping-5-refi.html
fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,5) fuzzy-if(skiaContent,1,77) == clipping-5-overflow-hidden.html clipping-5-ref.html
fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,5) fuzzy-if(Android,5,21) fuzzy-if(skiaContent,1,97) == clipping-5-refi.html clipping-5-ref.html
-fuzzy-if(true,1,7) fuzzy-if(d2d,48,94) fuzzy-if(cocoaWidget,1,99) fuzzy-if(Android,99,115) fuzzy-if(skiaContent,1,77) == clipping-5-refc.html clipping-5-ref.html # bug 732535
+fuzzy-if(true,1,7) fuzzy-if(d2d,55,94) fuzzy-if(cocoaWidget,1,99) fuzzy-if(Android,99,115) fuzzy-if(skiaContent,1,77) == clipping-5-refc.html clipping-5-ref.html # bug 732535
fuzzy-if(winWidget,105,71) fuzzy-if(Android,8,469) fuzzy-if(skiaContent,7,58) fuzzy-if(d3d11&&advancedLayers,120,319) fuzzy-if(winWidget&&stylo,137,319) == clipping-6.html clipping-6-ref.html # PaintedLayer and MaskLayer with transforms that aren't identical
fuzzy-if(true,2,29) fuzzy-if(d2d,46,71) fuzzy-if(Android,255,586) fuzzy-if(skiaContent,28,96) == clipping-7.html clipping-7-ref.html # ColorLayer and MaskLayer with transforms that aren't identical. Reference image rendered without using layers (which causes fuzzy failures).
fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,5) == clipping-and-zindex-1.html clipping-and-zindex-1-ref.html
-fuzzy-if(cocoaWidget,1,4) fuzzy-if(d3d11&&advancedLayers,30,3) == intersecting-clipping-1-canvas.html intersecting-clipping-1-refc.html
+fuzzy-if(cocoaWidget,1,4) fuzzy-if(d2d,59,342) fuzzy-if(d3d11&&advancedLayers&&!d2d,30,3) == intersecting-clipping-1-canvas.html intersecting-clipping-1-refc.html
== intersecting-clipping-1-image.html intersecting-clipping-1-refi.html
== intersecting-clipping-1-overflow-hidden.html intersecting-clipping-1-ref.html
fuzzy-if(Android,5,105) fuzzy-if(d2d,1,20) fuzzy-if(skiaContent,1,300) == intersecting-clipping-1-refi.html intersecting-clipping-1-ref.html
-fuzzy-if(true,1,33) fuzzy-if(d2d,48,350) fuzzy-if(cocoaWidget,1,332) fuzzy-if(Android,124,440) fuzzy-if(skiaContent,1,135) fuzzy-if(d3d11&&advancedLayers,48,353) == intersecting-clipping-1-refc.html intersecting-clipping-1-ref.html # bug 732535
+fuzzy-if(true,1,33) fuzzy-if(d2d,59,350) fuzzy-if(cocoaWidget,1,332) fuzzy-if(Android,124,440) fuzzy-if(skiaContent,1,135) fuzzy-if(d3d11&&advancedLayers,59,353) == intersecting-clipping-1-refc.html intersecting-clipping-1-ref.html # bug 732535
# Inheritance
== inherit-1.html inherit-1-ref.html # border-radius shouldn't inherit
diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list
index 47e1e5597620..eb289872050c 100644
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1714,7 +1714,7 @@ needs-focus != 703186-1.html 703186-2.html
== 714519-1-q.html 714519-1-ref.html
== 714519-2-as.html 714519-2-ref.html
== 714519-2-q.html 714519-2-ref.html
-fuzzy-if(true,1,21) fuzzy-if(d2d,69,173) fuzzy-if(cocoaWidget,1,170) == 718521.html 718521-ref.html # bug 773482
+fuzzy-if(true,1,21) fuzzy-if(d2d,71,173) fuzzy-if(cocoaWidget,1,170) == 718521.html 718521-ref.html # bug 773482
== 720987.html 720987-ref.html
== 722888-1.html 722888-1-ref.html
fuzzy(2,40000) == 722923-1.html 722923-1-ref.html
diff --git a/layout/reftests/css-grid/grid-item-align-dynamic-pos-001-ref.html b/layout/reftests/css-grid/grid-item-align-dynamic-pos-001-ref.html
new file mode 100644
index 000000000000..9c76a04314dd
--- /dev/null
+++ b/layout/reftests/css-grid/grid-item-align-dynamic-pos-001-ref.html
@@ -0,0 +1,37 @@
+
+
+
+ Reference: dynamic change .left on abs.pos. item w. align-self:center
+
+
+
+
+
+
+
+
+
diff --git a/layout/reftests/css-grid/grid-item-align-dynamic-pos-001.html b/layout/reftests/css-grid/grid-item-align-dynamic-pos-001.html
new file mode 100644
index 000000000000..0ae5584435f8
--- /dev/null
+++ b/layout/reftests/css-grid/grid-item-align-dynamic-pos-001.html
@@ -0,0 +1,46 @@
+
+
+
+ CSS Grid Test: dynamic change .left on abs.pos. item w. align-self:center
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/reftests/css-grid/grid-item-align-dynamic-pos-002-ref.html b/layout/reftests/css-grid/grid-item-align-dynamic-pos-002-ref.html
new file mode 100644
index 000000000000..3e5868d8b1b1
--- /dev/null
+++ b/layout/reftests/css-grid/grid-item-align-dynamic-pos-002-ref.html
@@ -0,0 +1,37 @@
+
+
+
+ Reference: dynamic change .left on abs.pos. item w. align-self:end
+
+
+
+
+
+
+
+
+
diff --git a/layout/reftests/css-grid/grid-item-align-dynamic-pos-002.html b/layout/reftests/css-grid/grid-item-align-dynamic-pos-002.html
new file mode 100644
index 000000000000..8659dcd619f6
--- /dev/null
+++ b/layout/reftests/css-grid/grid-item-align-dynamic-pos-002.html
@@ -0,0 +1,45 @@
+
+
+
+ CSS Grid Test: dynamic change .left on abs.pos. item w. align-self:end
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/reftests/css-grid/grid-item-align-dynamic-pos-003-ref.html b/layout/reftests/css-grid/grid-item-align-dynamic-pos-003-ref.html
new file mode 100644
index 000000000000..b25750147c38
--- /dev/null
+++ b/layout/reftests/css-grid/grid-item-align-dynamic-pos-003-ref.html
@@ -0,0 +1,38 @@
+
+
+
+ Reference: dynamic change .left on abs.pos. item w. align-self:start
+
+
+
+
+
+
+
+
+
diff --git a/layout/reftests/css-grid/grid-item-align-dynamic-pos-003.html b/layout/reftests/css-grid/grid-item-align-dynamic-pos-003.html
new file mode 100644
index 000000000000..1643494c9bb6
--- /dev/null
+++ b/layout/reftests/css-grid/grid-item-align-dynamic-pos-003.html
@@ -0,0 +1,47 @@
+
+
+
+ CSS Grid Test: dynamic change .left on abs.pos. item w. align-self:start
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/reftests/css-grid/reftest.list b/layout/reftests/css-grid/reftest.list
index 79c8c65f71a2..29b9b8649eca 100644
--- a/layout/reftests/css-grid/reftest.list
+++ b/layout/reftests/css-grid/reftest.list
@@ -278,5 +278,9 @@ asserts(0-10) == grid-fragmentation-015.html grid-fragmentation-015-ref.html # b
== grid-fragmentation-dyn2-029.html grid-fragmentation-029-ref.html
== grid-fragmentation-dyn2-030.html grid-fragmentation-030-ref.html
== grid-fragmentation-dyn2-031.html grid-fragmentation-031-ref.html
+
== bug1306106.html bug1306106-ref.html
== grid-percent-intrinsic-sizing-001.html grid-percent-intrinsic-sizing-001-ref.html
+== grid-item-align-dynamic-pos-001.html grid-item-align-dynamic-pos-001-ref.html
+== grid-item-align-dynamic-pos-002.html grid-item-align-dynamic-pos-002-ref.html
+== grid-item-align-dynamic-pos-003.html grid-item-align-dynamic-pos-003-ref.html
diff --git a/layout/reftests/flexbox/flexbox-item-align-self-dynamic-pos-001-ref.html b/layout/reftests/flexbox/flexbox-item-align-self-dynamic-pos-001-ref.html
new file mode 100644
index 000000000000..60b0b9955a38
--- /dev/null
+++ b/layout/reftests/flexbox/flexbox-item-align-self-dynamic-pos-001-ref.html
@@ -0,0 +1,36 @@
+
+
+
+ Reference: dynamic change .left on abs.pos. item w. align-self:center
+
+
+
+
+
+
+
+
+
diff --git a/layout/reftests/flexbox/flexbox-item-align-self-dynamic-pos-001.html b/layout/reftests/flexbox/flexbox-item-align-self-dynamic-pos-001.html
new file mode 100644
index 000000000000..9c7b3b4087ab
--- /dev/null
+++ b/layout/reftests/flexbox/flexbox-item-align-self-dynamic-pos-001.html
@@ -0,0 +1,45 @@
+
+
+
+ CSS Flexbox Test: dynamic change .left on abs.pos. item w. align-self:center
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/reftests/flexbox/flexbox-item-align-self-dynamic-pos-002-ref.html b/layout/reftests/flexbox/flexbox-item-align-self-dynamic-pos-002-ref.html
new file mode 100644
index 000000000000..13b3b950218a
--- /dev/null
+++ b/layout/reftests/flexbox/flexbox-item-align-self-dynamic-pos-002-ref.html
@@ -0,0 +1,36 @@
+
+
+
+ Reference: dynamic change .left on abs.pos. item w. align-self:end
+
+
+
+
+
+
+
+
+
diff --git a/layout/reftests/flexbox/flexbox-item-align-self-dynamic-pos-002.html b/layout/reftests/flexbox/flexbox-item-align-self-dynamic-pos-002.html
new file mode 100644
index 000000000000..405ea1b23622
--- /dev/null
+++ b/layout/reftests/flexbox/flexbox-item-align-self-dynamic-pos-002.html
@@ -0,0 +1,44 @@
+
+
+
+ CSS Flexbox Test: dynamic change .left on abs.pos. item w. align-self:end
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/reftests/flexbox/reftest.list b/layout/reftests/flexbox/reftest.list
index d305a7fb4b57..6a2f8414ebe8 100644
--- a/layout/reftests/flexbox/reftest.list
+++ b/layout/reftests/flexbox/reftest.list
@@ -19,6 +19,8 @@ fails == flexbox-align-self-baseline-horiz-2.xhtml flexbox-align-self-baseline-
# background size in test vs. ref
fuzzy-if(cocoaWidget,1,2) random-if(winWidget||gtkWidget) skip-if(Android) == flexbox-align-self-baseline-horiz-3.xhtml flexbox-align-self-baseline-horiz-3-ref.xhtml # XXXdholbert investigate the random-if. The skip-if(Android) is because checkbox/radio appearance:none doesn't work as expected.
== flexbox-align-self-baseline-horiz-4.xhtml flexbox-align-self-baseline-horiz-4-ref.xhtml
+== flexbox-item-align-self-dynamic-pos-001.html flexbox-item-align-self-dynamic-pos-001-ref.html
+== flexbox-item-align-self-dynamic-pos-002.html flexbox-item-align-self-dynamic-pos-002-ref.html
# Tests for box-sizing on flex containers and flex items.
== flexbox-box-sizing-on-container-horiz-1.html flexbox-box-sizing-on-container-horiz-1-ref.html
diff --git a/layout/style/crashtests/1415663.html b/layout/style/crashtests/1415663.html
new file mode 100644
index 000000000000..1e7cf93ab0b7
--- /dev/null
+++ b/layout/style/crashtests/1415663.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+