merge mozilla-inbound to mozilla-central. r=merge a=merge

This commit is contained in:
Sebastian Hengst 2017-11-09 11:53:05 +02:00
commit 1b0413a887
142 changed files with 1427 additions and 738 deletions

View file

@ -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 =

View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<script>
function boom()
{
window.getSelection().collapse(document.createTextNode("."), 0);
}
</script>
</head>
<body onload="setTimeout(boom, 0);"></body>
</html>

View file

@ -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

View file

@ -951,7 +951,8 @@ nsContextMenu.prototype = {
this.browser.contentPrincipal,
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
openUILink(this.mediaURL, e, { disallowInheritPrincipal: true,
referrerURI });
referrerURI,
forceAllowDataURI: true });
}
},

View file

@ -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 &&

View file

@ -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}

View file

@ -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

View file

@ -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.

View file

@ -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"
]
}

View file

@ -13,6 +13,6 @@
"cxx": "cl.exe",
"ml": "ml64.exe",
"patches": [
"build/src/build/build-clang/loosen-msvc-detection.patch"
"loosen-msvc-detection.patch"
]
}

View file

@ -1310,6 +1310,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
nsCOMPtr<nsISHEntry> shEntry;
nsString target;
nsAutoString srcdoc;
bool forceAllowDataURI = false;
nsCOMPtr<nsIDocShell> sourceDocShell;
nsCOMPtr<nsIURI> 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<nsIRequest> 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<nsCOMPtr<nsIURI>> 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

View file

@ -452,6 +452,7 @@ protected:
mozilla::Maybe<nsCOMPtr<nsIURI>> const& aResultPrincipalURI,
bool aLoadReplace,
bool aLoadFromExternal,
bool aForceAllowDataURI,
nsIURI* aReferrer,
bool aSendReferrer,
uint32_t aReferrerPolicy,

View file

@ -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)
{

View file

@ -39,6 +39,7 @@ protected:
bool mLoadReplace;
bool mInheritPrincipal;
bool mPrincipalIsExplicit;
bool mForceAllowDataURI;
bool mSendReferrer;
nsDocShellInfoReferrerPolicy mReferrerPolicy;
nsDocShellInfoLoadType mLoadType;

View file

@ -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.
/**

View file

@ -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

View file

@ -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

View file

@ -783,7 +783,6 @@ CustomElementRegistry::Define(const nsAString& aName,
* observedAttributesIterable to a sequence<DOMString>. 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<MSG_NOT_SEQUENCE>(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<MSG_NOT_SEQUENCE>(NS_LITERAL_STRING("observedAttributes"));
return;
}
JS::Rooted<JS::Value> 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.

View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<body>
<script type="text/javascript">
class XFoo extends HTMLElement {
constructor() {
super();
}
static get observedAttributes() {
return [3.76277868767527e-310, Symbol("Ashitaka"), {}];
}
attributeChangedCallback(aName, aOldValue, aNewValue) {
}
}
customElements.define('x-foo', XFoo);
</script>
</html>

View file

@ -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

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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

View file

@ -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);

View file

@ -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<nsIEventTarget> mEventTarget;
uint64_t mInnerWindowID;

View file

@ -36,11 +36,11 @@ public:
return mTaskQueue->TailDispatcher();
}
void Dispatch(already_AddRefed<nsIRunnable> aRunnable,
DispatchFailureHandling aFailureHandling = AssertDispatchSuccess,
DispatchReason aReason = NormalDispatch) override
nsresult Dispatch(already_AddRefed<nsIRunnable> 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.

View file

@ -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<nsIURI> uri;
nsresult rv = NS_GetFinalChannelURI(aChannel, getter_AddRefs(uri));
NS_ENSURE_SUCCESS(rv, true);

View file

@ -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

View file

@ -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")
});
});
});

View file

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Bug 1407891: Test navigation for right-click view-image on data:image/svg</title>
</head>
<body>
<img id="testimage" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBkPSJNOCwxMkwzLDcsNCw2bDQsNCw0LTQsMSwxWiIgZmlsbD0iIzZBNkE2QSIgLz4KPC9zdmc+Cg=="></img>
</body>
</html>

View file

@ -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<Mutex>("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;

View file

@ -206,6 +206,7 @@ private:
sk_sp<SkSurface> mSurface;
SkCanvas* mCanvas;
SourceSurfaceSkia* mSnapshot;
std::shared_ptr<Mutex> mSnapshotLock;
#ifdef MOZ_WIDGET_COCOA
friend class BorrowedCGContext;

View file

@ -475,7 +475,7 @@ enum UnpremultiplyInputs
IN_UNPREMULTIPLY_IN = 0
};
class FilterNode : public RefCounted<FilterNode>
class FilterNode : public external::AtomicRefCounted<FilterNode>
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNode)

View file

@ -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<SkImage>& aImage,
SurfaceFormat aFormat,
DrawTargetSkia* aOwner)
DrawTargetSkia* aOwner,
shared_ptr<Mutex> aSnapshotLock)
{
if (!aImage) {
return false;
@ -137,6 +143,8 @@ SourceSurfaceSkia::InitFromImage(const sk_sp<SkImage>& 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,

View file

@ -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<SkImage>& aImage,
SurfaceFormat aFormat = SurfaceFormat::UNKNOWN,
DrawTargetSkia* aOwner = nullptr);
DrawTargetSkia* aOwner = nullptr,
std::shared_ptr<Mutex> aSnapshotLock = std::shared_ptr<Mutex>{});
virtual uint8_t* GetData();
@ -62,6 +64,7 @@ private:
IntSize mSize;
int32_t mStride;
RefPtr<DrawTargetSkia> mDrawTarget;
std::shared_ptr<Mutex> mSnapshotLock;
Mutex mChangeMutex;
};

View file

@ -213,6 +213,15 @@ GPUParent::RecvInit(nsTArray<GfxPrefSetting>&& 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.

View file

@ -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<dom::Element> 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;
}

View file

@ -268,7 +268,7 @@ static already_AddRefed<TextureClient>
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);

View file

@ -1141,11 +1141,6 @@ TextureClient::CreateForDrawing(TextureForwarder* aAllocator,
return MakeAndAddRef<TextureClient>(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) {

View file

@ -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);
}

View file

@ -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;
}

View file

@ -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(),

View file

@ -3130,8 +3130,17 @@ Parser<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::arrayBindingPattern(DeclarationKind kind, YieldHand
if (tt == TOK_RB) {
tokenStream.ungetToken();
tokenStream.addModifierException(TokenStream::OperandIsNone);
break;
}
@ -4600,7 +4611,7 @@ Parser<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::assignExpr(InHandling inHandling, YieldHandling yie
}
tokenStream.ungetToken();
tokenStream.addModifierException(TokenStream::OperandIsNone);
return lhs;
}
@ -8711,7 +8719,7 @@ Parser<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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<ParseHandler, CharT>::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));

View file

@ -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

View file

@ -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
-------------

View file

@ -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);

View file

@ -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");

View file

@ -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();

View file

@ -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);

View file

@ -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<PresShell*>(frame->PresContext()->PresShell());
auto* presShell = static_cast<PresShell*>(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<VisibleRegions>& 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<PresShell*>(frame->PresContext()->PresShell());
PresShell* shell = static_cast<PresShell*>(frame->PresShell());
switch (aEvent->mMessage) {
case eTouchMove:
case eTouchCancel:
@ -7296,8 +7295,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
break;
}
shell = static_cast<PresShell*>(
contentFrame->PresContext()->PresShell());
shell = static_cast<PresShell*>(contentFrame->PresShell());
if (shell) {
break;
}

View file

@ -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<gfxContext> 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);

View file

@ -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<nsIFrame*,100> 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);
}

View file

@ -552,7 +552,7 @@ public:
static_cast<nsComboboxControlFrame*>(mFrame.GetFrame());
static_cast<nsListControlFrame*>(combo->mDropdownFrame)->
SetSuppressScrollbarUpdate(true);
nsCOMPtr<nsIPresShell> shell = mFrame->PresContext()->PresShell();
nsCOMPtr<nsIPresShell> 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

View file

@ -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(),

View file

@ -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();
}

View file

@ -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);

View file

@ -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);
}
}

View file

@ -41,7 +41,7 @@ public:
virtual already_AddRefed<DrawTarget> GetRefDrawTarget() override
{
RefPtr<gfxContext> ctx =
mFrame->PresContext()->PresShell()->CreateReferenceRenderingContext();
mFrame->PresShell()->CreateReferenceRenderingContext();
RefPtr<DrawTarget> 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<nsCaret> caret = aBlockFrame->PresContext()->PresShell()->GetCaret();
RefPtr<nsCaret> caret = aBlockFrame->PresShell()->GetCaret();
if (caret && caret->IsVisible()) {
nsCOMPtr<nsISelection> domSelection = caret->GetSelection();
if (domSelection) {
@ -896,7 +896,7 @@ TextOverflow::Marker::SetupString(nsIFrame* aFrame)
}
} else {
RefPtr<gfxContext> rc =
aFrame->PresContext()->PresShell()->CreateReferenceRenderingContext();
aFrame->PresShell()->CreateReferenceRenderingContext();
RefPtr<nsFontMetrics> fm =
nsLayoutUtils::GetInflatedFontMetricsForFrame(aFrame);
mISize = nsLayoutUtils::AppUnitWidthOfStringBidi(mStyle->mString, aFrame,

View file

@ -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<nsSubDocumentFrame*>
(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;
}

View file

@ -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);
}

View file

@ -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 :

View file

@ -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.

View file

@ -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;

View file

@ -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___ */

View file

@ -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;

View file

@ -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

View file

@ -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);

View file

@ -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<nsSubDocumentFrame*>
(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<nsSubDocumentFrame*>
(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<nsWeakPtr> 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<nsWeakPtr> 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 {

View file

@ -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,

View file

@ -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.

View file

@ -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<nsStyleContext> 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;

View file

@ -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

View file

@ -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();
}

View file

@ -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<DrawTarget>
CreateReferenceDrawTarget(const nsTextFrame* aTextFrame)
{
RefPtr<gfxContext> ctx =
aTextFrame->PresContext()->PresShell()->CreateReferenceRenderingContext();
aTextFrame->PresShell()->CreateReferenceRenderingContext();
RefPtr<DrawTarget> dt = ctx->GetDrawTarget();
return dt.forget();
}

View file

@ -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;
}
}

View file

@ -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;

View file

@ -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);
}

View file

@ -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;
}

View file

@ -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(

View file

@ -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;

View file

@ -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<nsRect>
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<nsIFrame*> *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<Layer>
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);

View file

@ -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)); \
} \

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,37 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<title>Reference: dynamic change .left on abs.pos. item w. align-self:center</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1405319">
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
.grid {
display: inline-grid;
position: relative;
background: lightgrey;
grid: 50px 50px / 50px 50px;
}
#item {
background: grey;
position: absolute;
align-self: center;
left: 20px;
}
</style>
</head>
<body>
<div class="grid">
<div id="item">X</div>
</div>
</body>
</html>

View file

@ -0,0 +1,46 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<title>CSS Grid Test: dynamic change .left on abs.pos. item w. align-self:center</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1405319">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-self">
<link rel="match" href="grid-item-align-dynamic-pos-001-ref.html">
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
.grid {
display: inline-grid;
position: relative;
background: lightgrey;
grid: 50px 50px / 50px 50px;
}
#item {
background: grey;
position: absolute;
align-self: center;
left: 10px;
}
</style>
</head>
<body>
<div class="grid">
<div id="item">X</div>
</div>
<script>
document.body.offsetLeft;
var items = Array.prototype.slice.call(document.querySelectorAll('#item'));
items.map(item => item.style.left = "20px");
document.body.offsetLeft;
</script>
</body>
</html>

View file

@ -0,0 +1,37 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<title>Reference: dynamic change .left on abs.pos. item w. align-self:end</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1405319">
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
.grid {
display: inline-grid;
position: relative;
background: lightgrey;
grid: 50px 50px / 50px 50px;
}
#item {
background: grey;
position: absolute;
align-self: end;
left: 20px;
}
</style>
</head>
<body>
<div class="grid">
<div id="item">X</div>
</div>
</body>
</html>

View file

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<title>CSS Grid Test: dynamic change .left on abs.pos. item w. align-self:end</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1405319">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-self">
<link rel="match" href="grid-item-align-dynamic-pos-002-ref.html">
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
.grid {
display: inline-grid;
background: lightgrey;
grid: 50px 50px / 50px 50px;
}
#item {
background: grey;
position: absolute;
align-self: end;
left: 10px;
}
</style>
</head>
<body>
<div class="grid">
<div id="item">X</div>
</div>
<script>
document.body.offsetLeft;
var items = Array.prototype.slice.call(document.querySelectorAll('#item'));
items.map(item => item.style.left = "20px");
document.body.offsetLeft;
</script>
</body>
</html>

View file

@ -0,0 +1,38 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<title>Reference: dynamic change .left on abs.pos. item w. align-self:start</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1405319">
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
.grid {
display: inline-grid;
position: relative;
background: lightgrey;
grid: 50px 50px / 50px 50px;
}
#item {
background: grey;
position: absolute;
align-self: start;
left: 20px;
}
</style>
</head>
<body>
<div class="grid">
<div style="align-self: start; font-size:32pt">X</div>
<div id="item" style="grid-area:2/2">X</div>
</div>
</body>
</html>

View file

@ -0,0 +1,47 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<title>CSS Grid Test: dynamic change .left on abs.pos. item w. align-self:start</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1405319">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-self">
<link rel="match" href="grid-item-align-dynamic-pos-003-ref.html">
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
.grid {
display: inline-grid;
position: relative;
background: lightgrey;
grid: 50px 50px / 50px 50px;
}
#item {
background: grey;
position: absolute;
align-self: start;
left: 10px;
}
</style>
</head>
<body>
<div class="grid">
<div style="align-self: start; font-size:32pt">X</div>
<div id="item" style="grid-area:2/2">X</div>
</div>
<script>
document.body.offsetLeft;
var items = Array.prototype.slice.call(document.querySelectorAll('#item'));
items.map(item => item.style.left = "20px");
document.body.offsetLeft;
</script>
</body>
</html>

View file

@ -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

View file

@ -0,0 +1,36 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<title>Reference: dynamic change .left on abs.pos. item w. align-self:center</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1405319">
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
.flexbox {
display: flex;
position: relative;
height: 100px;
}
#item {
background: grey;
position: relative;
align-self: center;
left: 20px;
}
</style>
</head>
<body>
<div class="flexbox">
<div id="item">X</div>
</div>
</body>
</html>

View file

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<title>CSS Flexbox Test: dynamic change .left on abs.pos. item w. align-self:center</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1405319">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-self">
<link rel="match" href="flexbox-item-align-self-dynamic-pos-001-ref.html">
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
.flexbox {
display: flex;
position: relative;
height: 100px;
}
#item {
background: grey;
position: absolute;
align-self: center;
left: 10px;
}
</style>
</head>
<body>
<div class="flexbox">
<div id="item">X</div>
</div>
<script>
document.body.offsetLeft;
var items = Array.prototype.slice.call(document.querySelectorAll('#item'));
items.map(item => item.style.left = "20px");
document.body.offsetLeft;
</script>
</body>
</html>

View file

@ -0,0 +1,36 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<title>Reference: dynamic change .left on abs.pos. item w. align-self:end</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1405319">
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
.flexbox {
display: flex;
position: relative;
height: 100px;
}
#item {
background: grey;
position: relative;
align-self: end;
left: 20px;
}
</style>
</head>
<body>
<div class="flexbox">
<div id="item">X</div>
</div>
</body>
</html>

View file

@ -0,0 +1,44 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<title>CSS Flexbox Test: dynamic change .left on abs.pos. item w. align-self:end</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1405319">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-self">
<link rel="match" href="flexbox-item-align-self-dynamic-pos-002-ref.html">
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
.flexbox {
display: flex;
height: 100px;
}
#item {
background: grey;
position: absolute;
align-self: end;
left: 10px;
}
</style>
</head>
<body>
<div class="flexbox">
<div id="item">X</div>
</div>
<script>
document.body.offsetLeft;
var items = Array.prototype.slice.call(document.querySelectorAll('#item'));
items.map(item => item.style.left = "20px");
document.body.offsetLeft;
</script>
</body>
</html>

View file

@ -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

View file

@ -0,0 +1,13 @@
<html>
<head>
<script>
function boom() {
document.getElementById('x').createShadowRoot()
}
</script>
</head>
<body onload=boom()>
<marquee id='x'>
<table id='x'>
</body>
</html>

View file

@ -260,4 +260,5 @@ load 1411143.html
load 1411478.html
load 1413288.html
load 1413361.html
load 1415663.html
pref(dom.webcomponents.enabled,true) load 1415353.html

Some files were not shown because too many files have changed in this diff Show more