mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 20:37:31 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
5f18cf3bed
41 changed files with 234 additions and 485 deletions
|
|
@ -26,16 +26,19 @@
|
||||||
key="&closeCmd.key;"
|
key="&closeCmd.key;"
|
||||||
command="toolbox-cmd-close"
|
command="toolbox-cmd-close"
|
||||||
modifiers="accel"/>
|
modifiers="accel"/>
|
||||||
<key id="toolbox-key-toggle"
|
#ifdef XP_MACOSX
|
||||||
key="&toggleToolbox.key;"
|
|
||||||
command="toolbox-cmd-close"
|
|
||||||
modifiers="accel,shift"
|
|
||||||
disabled="true"/>
|
|
||||||
<key id="toolbox-key-toggle-osx"
|
<key id="toolbox-key-toggle-osx"
|
||||||
key="&toggleToolbox.key;"
|
key="&toggleToolbox.key;"
|
||||||
command="toolbox-cmd-close"
|
command="toolbox-cmd-close"
|
||||||
modifiers="accel,alt"
|
modifiers="accel,alt"
|
||||||
disabled="true"/>
|
disabled="true"/>
|
||||||
|
#else
|
||||||
|
<key id="toolbox-key-toggle"
|
||||||
|
key="&toggleToolbox.key;"
|
||||||
|
command="toolbox-cmd-close"
|
||||||
|
modifiers="accel,shift"
|
||||||
|
disabled="true"/>
|
||||||
|
#endif
|
||||||
<key id="toolbox-key-toggle-F12"
|
<key id="toolbox-key-toggle-F12"
|
||||||
keycode="&toggleToolboxF12.keycode;"
|
keycode="&toggleToolboxF12.keycode;"
|
||||||
keytext="&toggleToolboxF12.keytext;"
|
keytext="&toggleToolboxF12.keytext;"
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ devtools.jar:
|
||||||
content/commandline/commandline.css (commandline/commandline.css)
|
content/commandline/commandline.css (commandline/commandline.css)
|
||||||
content/commandline/commandlineoutput.xhtml (commandline/commandlineoutput.xhtml)
|
content/commandline/commandlineoutput.xhtml (commandline/commandlineoutput.xhtml)
|
||||||
content/commandline/commandlinetooltip.xhtml (commandline/commandlinetooltip.xhtml)
|
content/commandline/commandlinetooltip.xhtml (commandline/commandlinetooltip.xhtml)
|
||||||
content/framework/toolbox-window.xul (framework/toolbox-window.xul)
|
* content/framework/toolbox-window.xul (framework/toolbox-window.xul)
|
||||||
content/framework/toolbox-options.xhtml (framework/toolbox-options.xhtml)
|
content/framework/toolbox-options.xhtml (framework/toolbox-options.xhtml)
|
||||||
content/framework/toolbox.xul (framework/toolbox.xul)
|
content/framework/toolbox.xul (framework/toolbox.xul)
|
||||||
content/framework/toolbox-init.js (framework/toolbox-init.js)
|
content/framework/toolbox-init.js (framework/toolbox-init.js)
|
||||||
|
|
|
||||||
|
|
@ -1921,7 +1921,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(FragmentOrElement)
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoCString orphan;
|
nsAutoCString orphan;
|
||||||
if (!tmp->IsInUncomposedDoc() &&
|
if (!tmp->IsInComposedDoc() &&
|
||||||
// Ignore xbl:content, which is never in the document and hence always
|
// Ignore xbl:content, which is never in the document and hence always
|
||||||
// appears to be orphaned.
|
// appears to be orphaned.
|
||||||
!tmp->NodeInfo()->Equals(nsGkAtoms::content, kNameSpaceID_XBL)) {
|
!tmp->NodeInfo()->Equals(nsGkAtoms::content, kNameSpaceID_XBL)) {
|
||||||
|
|
|
||||||
|
|
@ -2367,75 +2367,6 @@ nsDOMWindowUtils::GetCurrentAudioBackend(nsAString& aBackend)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsDOMWindowUtils::StartFrameTimeRecording(uint32_t *startIndex)
|
|
||||||
{
|
|
||||||
NS_ENSURE_ARG_POINTER(startIndex);
|
|
||||||
|
|
||||||
nsCOMPtr<nsIWidget> widget = GetWidget();
|
|
||||||
if (!widget)
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
|
|
||||||
LayerManager *mgr = widget->GetLayerManager();
|
|
||||||
if (!mgr)
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
|
|
||||||
const uint32_t kRecordingMinSize = 60 * 10; // 10 seconds @60 fps.
|
|
||||||
const uint32_t kRecordingMaxSize = 60 * 60 * 60; // One hour
|
|
||||||
uint32_t bufferSize = Preferences::GetUint("toolkit.framesRecording.bufferSize", uint32_t(0));
|
|
||||||
bufferSize = std::min(bufferSize, kRecordingMaxSize);
|
|
||||||
bufferSize = std::max(bufferSize, kRecordingMinSize);
|
|
||||||
*startIndex = mgr->StartFrameTimeRecording(bufferSize);
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsDOMWindowUtils::StopFrameTimeRecording(uint32_t startIndex,
|
|
||||||
uint32_t *frameCount,
|
|
||||||
float **frameIntervals)
|
|
||||||
{
|
|
||||||
NS_ENSURE_ARG_POINTER(frameCount);
|
|
||||||
NS_ENSURE_ARG_POINTER(frameIntervals);
|
|
||||||
|
|
||||||
nsCOMPtr<nsIWidget> widget = GetWidget();
|
|
||||||
if (!widget)
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
|
|
||||||
LayerManager *mgr = widget->GetLayerManager();
|
|
||||||
if (!mgr)
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
|
|
||||||
nsTArray<float> tmpFrameIntervals;
|
|
||||||
mgr->StopFrameTimeRecording(startIndex, tmpFrameIntervals);
|
|
||||||
*frameCount = tmpFrameIntervals.Length();
|
|
||||||
|
|
||||||
*frameIntervals = (float*)moz_xmalloc(*frameCount * sizeof(float));
|
|
||||||
|
|
||||||
/* copy over the frame intervals and paint times into the arrays we just allocated */
|
|
||||||
for (uint32_t i = 0; i < *frameCount; i++) {
|
|
||||||
(*frameIntervals)[i] = tmpFrameIntervals[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsDOMWindowUtils::BeginTabSwitch()
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsIWidget> widget = GetWidget();
|
|
||||||
if (!widget)
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
|
|
||||||
LayerManager *mgr = widget->GetLayerManager();
|
|
||||||
if (!mgr)
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
|
|
||||||
mgr->BeginTabSwitch();
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
ComputeAnimationValue(nsCSSPropertyID aProperty,
|
ComputeAnimationValue(nsCSSPropertyID aProperty,
|
||||||
Element* aElement,
|
Element* aElement,
|
||||||
|
|
@ -2478,7 +2409,7 @@ nsDOMWindowUtils::AdvanceTimeAndRefresh(int64_t aMilliseconds)
|
||||||
|
|
||||||
nsPresContext* presContext = GetPresContext();
|
nsPresContext* presContext = GetPresContext();
|
||||||
if (presContext) {
|
if (presContext) {
|
||||||
nsRefreshDriver* driver = presContext->RefreshDriver();
|
RefPtr<nsRefreshDriver> driver = presContext->RefreshDriver();
|
||||||
driver->AdvanceTimeAndRefresh(aMilliseconds);
|
driver->AdvanceTimeAndRefresh(aMilliseconds);
|
||||||
|
|
||||||
RefPtr<LayerTransactionChild> transaction = GetLayerTransaction();
|
RefPtr<LayerTransactionChild> transaction = GetLayerTransaction();
|
||||||
|
|
|
||||||
|
|
@ -303,13 +303,13 @@ WebGLContext::FromDomElem(const char* funcName, TexImageTarget target, uint32_t
|
||||||
uint32_t height, uint32_t depth, const dom::Element& elem,
|
uint32_t height, uint32_t depth, const dom::Element& elem,
|
||||||
ErrorResult* const out_error)
|
ErrorResult* const out_error)
|
||||||
{
|
{
|
||||||
if (elem.IsHTMLElement(nsGkAtoms::canvas)) {
|
if (elem.IsHTMLElement(nsGkAtoms::canvas)) {
|
||||||
const dom::HTMLCanvasElement* canvas = static_cast<const dom::HTMLCanvasElement*>(&elem);
|
const dom::HTMLCanvasElement* canvas = static_cast<const dom::HTMLCanvasElement*>(&elem);
|
||||||
if (canvas->IsWriteOnly()) {
|
if (canvas->IsWriteOnly()) {
|
||||||
out_error->Throw(NS_ERROR_DOM_SECURITY_ERR);
|
out_error->Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t flags = nsLayoutUtils::SFE_WANT_IMAGE_SURFACE |
|
uint32_t flags = nsLayoutUtils::SFE_WANT_IMAGE_SURFACE |
|
||||||
nsLayoutUtils::SFE_USE_ELEMENT_SIZE_IF_VECTOR;
|
nsLayoutUtils::SFE_USE_ELEMENT_SIZE_IF_VECTOR;
|
||||||
|
|
@ -1032,9 +1032,27 @@ ValidateCompressedTexImageRestrictions(const char* funcName, WebGLContext* webgl
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
ValidateTargetForFormat(const char* funcName, WebGLContext* webgl, TexImageTarget target,
|
ValidateFormatAndSize(const char* funcName,
|
||||||
const webgl::FormatInfo* format)
|
WebGLContext* webgl,
|
||||||
{
|
TexImageTarget target,
|
||||||
|
const webgl::FormatInfo* format,
|
||||||
|
const uint32_t width,
|
||||||
|
const uint32_t height,
|
||||||
|
const uint32_t depth) {
|
||||||
|
// Check if texture size will likely be rejected by the driver and give a more
|
||||||
|
// meaningful error message.
|
||||||
|
auto baseImageSize = CheckedInt<uint64_t>(format->estimatedBytesPerPixel) *
|
||||||
|
width * height * depth;
|
||||||
|
if (target == LOCAL_GL_TEXTURE_CUBE_MAP) {
|
||||||
|
baseImageSize *= 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!baseImageSize.isValid() ||
|
||||||
|
baseImageSize.value() > (uint64_t)gfxPrefs::WebGLMaxSizePerTextureMB * (1024 * 1024)) {
|
||||||
|
webgl->ErrorOutOfMemory("Texture size too large; base image MB > webgl.max-size-per-texture-mb");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// GLES 3.0.4 p127:
|
// GLES 3.0.4 p127:
|
||||||
// "Textures with a base internal format of DEPTH_COMPONENT or DEPTH_STENCIL are
|
// "Textures with a base internal format of DEPTH_COMPONENT or DEPTH_STENCIL are
|
||||||
// supported by texture image specification commands only if `target` is TEXTURE_2D,
|
// supported by texture image specification commands only if `target` is TEXTURE_2D,
|
||||||
|
|
@ -1137,7 +1155,8 @@ WebGLTexture::TexStorage(const char* funcName, TexTarget target, GLsizei levels,
|
||||||
}
|
}
|
||||||
auto dstFormat = dstUsage->format;
|
auto dstFormat = dstUsage->format;
|
||||||
|
|
||||||
if (!ValidateTargetForFormat(funcName, mContext, testTarget, dstFormat))
|
if (!ValidateFormatAndSize(funcName, mContext, testTarget, dstFormat,
|
||||||
|
width, height, depth))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (dstFormat->compression) {
|
if (dstFormat->compression) {
|
||||||
|
|
@ -1264,7 +1283,8 @@ WebGLTexture::TexImage(const char* funcName, TexImageTarget target, GLint level,
|
||||||
// Check that source and dest info are compatible
|
// Check that source and dest info are compatible
|
||||||
auto dstFormat = dstUsage->format;
|
auto dstFormat = dstUsage->format;
|
||||||
|
|
||||||
if (!ValidateTargetForFormat(funcName, mContext, target, dstFormat))
|
if (!ValidateFormatAndSize(funcName, mContext, target, dstFormat,
|
||||||
|
blob->mWidth, blob->mHeight, blob->mDepth))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!mContext->IsWebGL2() && dstFormat->d) {
|
if (!mContext->IsWebGL2() && dstFormat->d) {
|
||||||
|
|
@ -1484,7 +1504,8 @@ WebGLTexture::CompressedTexImage(const char* funcName, TexImageTarget target, GL
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ValidateTargetForFormat(funcName, mContext, target, format))
|
if (!ValidateFormatAndSize(funcName, mContext, target, format,
|
||||||
|
blob->mWidth, blob->mHeight, blob->mDepth))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
|
|
@ -2143,7 +2164,8 @@ WebGLTexture::CopyTexImage2D(TexImageTarget target, GLint level, GLenum internal
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto& dstFormat = dstUsage->format;
|
const auto& dstFormat = dstUsage->format;
|
||||||
if (!ValidateTargetForFormat(funcName, mContext, target, dstFormat))
|
if (!ValidateFormatAndSize(funcName, mContext, target, dstFormat,
|
||||||
|
width, height, depth))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!mContext->IsWebGL2() && dstFormat->d) {
|
if (!mContext->IsWebGL2() && dstFormat->d) {
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ interface nsIJSRAIIHelper;
|
||||||
interface nsIContentPermissionRequest;
|
interface nsIContentPermissionRequest;
|
||||||
interface nsIObserver;
|
interface nsIObserver;
|
||||||
|
|
||||||
[scriptable, uuid(7fcc7958-77d9-45ff-8c81-277bde5f0dc8)]
|
[scriptable, uuid(58e97ce9-1d9e-4576-aabf-89480fdeb16d)]
|
||||||
interface nsIDOMWindowUtils : nsISupports {
|
interface nsIDOMWindowUtils : nsISupports {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1425,38 +1425,6 @@ interface nsIDOMWindowUtils : nsISupports {
|
||||||
*/
|
*/
|
||||||
readonly attribute AString currentAudioBackend;
|
readonly attribute AString currentAudioBackend;
|
||||||
|
|
||||||
/**
|
|
||||||
* Record (and return) frame-intervals for frames which were presented
|
|
||||||
* between calling StartFrameTimeRecording and StopFrameTimeRecording.
|
|
||||||
*
|
|
||||||
* - Uses a cyclic buffer and serves concurrent consumers, so if Stop is called too late
|
|
||||||
* (elements were overwritten since Start), result is considered invalid and hence empty.
|
|
||||||
* - Buffer is capable of holding 10 seconds @ 60fps (or more if frames were less frequent).
|
|
||||||
* Can be changed (up to 1 hour) via pref: toolkit.framesRecording.bufferSize.
|
|
||||||
* - Note: the first frame-interval may be longer than expected because last frame
|
|
||||||
* might have been presented some time before calling StartFrameTimeRecording.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a handle which represents current recording start position.
|
|
||||||
*/
|
|
||||||
void startFrameTimeRecording([retval] out unsigned long startIndex);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns number of recorded frames since startIndex was issued,
|
|
||||||
* and allocates+populates 2 arraye with the recorded data.
|
|
||||||
* - Allocation is infallible. Should be released even if size is 0.
|
|
||||||
*/
|
|
||||||
void stopFrameTimeRecording(in unsigned long startIndex,
|
|
||||||
[optional] out unsigned long frameCount,
|
|
||||||
[retval, array, size_is(frameCount)] out float frameIntervals);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Signals that we're begining to tab switch. This is used by painting code to
|
|
||||||
* determine total tab switch time.
|
|
||||||
*/
|
|
||||||
void beginTabSwitch();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The DPI of the display
|
* The DPI of the display
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -664,8 +664,7 @@ HTMLEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
|
||||||
return TypedText(NS_LITERAL_STRING("\t"), eTypedText);
|
return TypedText(NS_LITERAL_STRING("\t"), eTypedText);
|
||||||
}
|
}
|
||||||
case NS_VK_RETURN:
|
case NS_VK_RETURN:
|
||||||
if (nativeKeyEvent->IsControl() || nativeKeyEvent->IsAlt() ||
|
if (!nativeKeyEvent->IsInputtingLineBreak()) {
|
||||||
nativeKeyEvent->IsMeta() || nativeKeyEvent->IsOS()) {
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
aKeyEvent->AsEvent()->PreventDefault(); // consumed
|
aKeyEvent->AsEvent()->PreventDefault(); // consumed
|
||||||
|
|
@ -677,11 +676,7 @@ HTMLEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
|
||||||
return TypedText(EmptyString(), eTypedBreak);
|
return TypedText(EmptyString(), eTypedBreak);
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: On some keyboard layout, some characters are inputted with Control
|
if (!nativeKeyEvent->IsInputtingText()) {
|
||||||
// key or Alt key, but at that time, widget sets FALSE to these keys.
|
|
||||||
if (!nativeKeyEvent->mCharCode || nativeKeyEvent->IsControl() ||
|
|
||||||
nativeKeyEvent->IsAlt() || nativeKeyEvent->IsMeta() ||
|
|
||||||
nativeKeyEvent->IsOS()) {
|
|
||||||
// we don't PreventDefault() here or keybindings like control-x won't work
|
// we don't PreventDefault() here or keybindings like control-x won't work
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -397,20 +397,14 @@ TextEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
|
||||||
return TypedText(NS_LITERAL_STRING("\t"), eTypedText);
|
return TypedText(NS_LITERAL_STRING("\t"), eTypedText);
|
||||||
}
|
}
|
||||||
case NS_VK_RETURN:
|
case NS_VK_RETURN:
|
||||||
if (IsSingleLineEditor() || nativeKeyEvent->IsControl() ||
|
if (IsSingleLineEditor() || !nativeKeyEvent->IsInputtingLineBreak()) {
|
||||||
nativeKeyEvent->IsAlt() || nativeKeyEvent->IsMeta() ||
|
|
||||||
nativeKeyEvent->IsOS()) {
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
aKeyEvent->AsEvent()->PreventDefault();
|
aKeyEvent->AsEvent()->PreventDefault();
|
||||||
return TypedText(EmptyString(), eTypedBreak);
|
return TypedText(EmptyString(), eTypedBreak);
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: On some keyboard layout, some characters are inputted with Control
|
if (!nativeKeyEvent->IsInputtingText()) {
|
||||||
// key or Alt key, but at that time, widget sets FALSE to these keys.
|
|
||||||
if (!nativeKeyEvent->mCharCode || nativeKeyEvent->IsControl() ||
|
|
||||||
nativeKeyEvent->IsAlt() || nativeKeyEvent->IsMeta() ||
|
|
||||||
nativeKeyEvent->IsOS()) {
|
|
||||||
// we don't PreventDefault() here or keybindings like control-x won't work
|
// we don't PreventDefault() here or keybindings like control-x won't work
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -714,7 +714,7 @@ mozInlineSpellChecker::RegisterEventListeners()
|
||||||
true, false);
|
true, false);
|
||||||
piTarget->AddEventListener(NS_LITERAL_STRING("click"), this,
|
piTarget->AddEventListener(NS_LITERAL_STRING("click"), this,
|
||||||
false, false);
|
false, false);
|
||||||
piTarget->AddEventListener(NS_LITERAL_STRING("keypress"), this,
|
piTarget->AddEventListener(NS_LITERAL_STRING("keydown"), this,
|
||||||
false, false);
|
false, false);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
@ -738,7 +738,7 @@ mozInlineSpellChecker::UnregisterEventListeners()
|
||||||
|
|
||||||
piTarget->RemoveEventListener(NS_LITERAL_STRING("blur"), this, true);
|
piTarget->RemoveEventListener(NS_LITERAL_STRING("blur"), this, true);
|
||||||
piTarget->RemoveEventListener(NS_LITERAL_STRING("click"), this, false);
|
piTarget->RemoveEventListener(NS_LITERAL_STRING("click"), this, false);
|
||||||
piTarget->RemoveEventListener(NS_LITERAL_STRING("keypress"), this, false);
|
piTarget->RemoveEventListener(NS_LITERAL_STRING("keydown"), this, false);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1916,8 +1916,8 @@ NS_IMETHODIMP mozInlineSpellChecker::HandleEvent(nsIDOMEvent* aEvent)
|
||||||
if (eventType.EqualsLiteral("click")) {
|
if (eventType.EqualsLiteral("click")) {
|
||||||
return MouseClick(aEvent);
|
return MouseClick(aEvent);
|
||||||
}
|
}
|
||||||
if (eventType.EqualsLiteral("keypress")) {
|
if (eventType.EqualsLiteral("keydown")) {
|
||||||
return KeyPress(aEvent);
|
return KeyDown(aEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
@ -1943,7 +1943,7 @@ nsresult mozInlineSpellChecker::MouseClick(nsIDOMEvent *aMouseEvent)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult mozInlineSpellChecker::KeyPress(nsIDOMEvent* aKeyEvent)
|
nsresult mozInlineSpellChecker::KeyDown(nsIDOMEvent* aKeyEvent)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIDOMKeyEvent>keyEvent = do_QueryInterface(aKeyEvent);
|
nsCOMPtr<nsIDOMKeyEvent>keyEvent = do_QueryInterface(aKeyEvent);
|
||||||
NS_ENSURE_TRUE(keyEvent, NS_OK);
|
NS_ENSURE_TRUE(keyEvent, NS_OK);
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ public:
|
||||||
|
|
||||||
nsresult Blur(nsIDOMEvent* aEvent);
|
nsresult Blur(nsIDOMEvent* aEvent);
|
||||||
nsresult MouseClick(nsIDOMEvent* aMouseEvent);
|
nsresult MouseClick(nsIDOMEvent* aMouseEvent);
|
||||||
nsresult KeyPress(nsIDOMEvent* aKeyEvent);
|
nsresult KeyDown(nsIDOMEvent* aKeyEvent);
|
||||||
|
|
||||||
mozInlineSpellChecker();
|
mozInlineSpellChecker();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1545,115 +1545,6 @@ RefLayer::FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
||||||
aAttrs = RefLayerAttributes(GetReferentId(), mEventRegionsOverride);
|
aAttrs = RefLayerAttributes(GetReferentId(), mEventRegionsOverride);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* StartFrameTimeRecording, together with StopFrameTimeRecording
|
|
||||||
* enable recording of frame intervals.
|
|
||||||
*
|
|
||||||
* To allow concurrent consumers, a cyclic array is used which serves all
|
|
||||||
* consumers, practically stateless with regard to consumers.
|
|
||||||
*
|
|
||||||
* To save resources, the buffer is allocated on first call to StartFrameTimeRecording
|
|
||||||
* and recording is paused if no consumer which called StartFrameTimeRecording is able
|
|
||||||
* to get valid results (because the cyclic buffer was overwritten since that call).
|
|
||||||
*
|
|
||||||
* To determine availability of the data upon StopFrameTimeRecording:
|
|
||||||
* - mRecording.mNextIndex increases on each PostPresent, and never resets.
|
|
||||||
* - Cyclic buffer position is realized as mNextIndex % bufferSize.
|
|
||||||
* - StartFrameTimeRecording returns mNextIndex. When StopFrameTimeRecording is called,
|
|
||||||
* the required start index is passed as an arg, and we're able to calculate the required
|
|
||||||
* length. If this length is bigger than bufferSize, it means data was overwritten.
|
|
||||||
* otherwise, we can return the entire sequence.
|
|
||||||
* - To determine if we need to pause, mLatestStartIndex is updated to mNextIndex
|
|
||||||
* on each call to StartFrameTimeRecording. If this index gets overwritten,
|
|
||||||
* it means that all earlier start indices obtained via StartFrameTimeRecording
|
|
||||||
* were also overwritten, hence, no point in recording, so pause.
|
|
||||||
* - mCurrentRunStartIndex indicates the oldest index of the recording after which
|
|
||||||
* the recording was not paused. If StopFrameTimeRecording is invoked with a start index
|
|
||||||
* older than this, it means that some frames were not recorded, so data is invalid.
|
|
||||||
*/
|
|
||||||
uint32_t
|
|
||||||
LayerManager::StartFrameTimeRecording(int32_t aBufferSize)
|
|
||||||
{
|
|
||||||
if (mRecording.mIsPaused) {
|
|
||||||
mRecording.mIsPaused = false;
|
|
||||||
|
|
||||||
if (!mRecording.mIntervals.Length()) { // Initialize recording buffers
|
|
||||||
mRecording.mIntervals.SetLength(aBufferSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
// After being paused, recent values got invalid. Update them to now.
|
|
||||||
mRecording.mLastFrameTime = TimeStamp::Now();
|
|
||||||
|
|
||||||
// Any recording which started before this is invalid, since we were paused.
|
|
||||||
mRecording.mCurrentRunStartIndex = mRecording.mNextIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we'll overwrite this index, there are no more consumers with aStartIndex
|
|
||||||
// for which we're able to provide the full recording, so no point in keep recording.
|
|
||||||
mRecording.mLatestStartIndex = mRecording.mNextIndex;
|
|
||||||
return mRecording.mNextIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
LayerManager::RecordFrame()
|
|
||||||
{
|
|
||||||
if (!mRecording.mIsPaused) {
|
|
||||||
TimeStamp now = TimeStamp::Now();
|
|
||||||
uint32_t i = mRecording.mNextIndex % mRecording.mIntervals.Length();
|
|
||||||
mRecording.mIntervals[i] = static_cast<float>((now - mRecording.mLastFrameTime)
|
|
||||||
.ToMilliseconds());
|
|
||||||
mRecording.mNextIndex++;
|
|
||||||
mRecording.mLastFrameTime = now;
|
|
||||||
|
|
||||||
if (mRecording.mNextIndex > (mRecording.mLatestStartIndex + mRecording.mIntervals.Length())) {
|
|
||||||
// We've just overwritten the most recent recording start -> pause.
|
|
||||||
mRecording.mIsPaused = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
LayerManager::PostPresent()
|
|
||||||
{
|
|
||||||
if (!mTabSwitchStart.IsNull()) {
|
|
||||||
mTabSwitchStart = TimeStamp();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
LayerManager::StopFrameTimeRecording(uint32_t aStartIndex,
|
|
||||||
nsTArray<float>& aFrameIntervals)
|
|
||||||
{
|
|
||||||
uint32_t bufferSize = mRecording.mIntervals.Length();
|
|
||||||
uint32_t length = mRecording.mNextIndex - aStartIndex;
|
|
||||||
if (mRecording.mIsPaused || length > bufferSize || aStartIndex < mRecording.mCurrentRunStartIndex) {
|
|
||||||
// aStartIndex is too old. Also if aStartIndex was issued before mRecordingNextIndex overflowed (uint32_t)
|
|
||||||
// and stopped after the overflow (would happen once every 828 days of constant 60fps).
|
|
||||||
length = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!length) {
|
|
||||||
aFrameIntervals.Clear();
|
|
||||||
return; // empty recording, return empty arrays.
|
|
||||||
}
|
|
||||||
// Set length in advance to avoid possibly repeated reallocations
|
|
||||||
aFrameIntervals.SetLength(length);
|
|
||||||
|
|
||||||
uint32_t cyclicPos = aStartIndex % bufferSize;
|
|
||||||
for (uint32_t i = 0; i < length; i++, cyclicPos++) {
|
|
||||||
if (cyclicPos == bufferSize) {
|
|
||||||
cyclicPos = 0;
|
|
||||||
}
|
|
||||||
aFrameIntervals[i] = mRecording.mIntervals[cyclicPos];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
LayerManager::BeginTabSwitch()
|
|
||||||
{
|
|
||||||
mTabSwitchStart = TimeStamp::Now();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void PrintInfo(std::stringstream& aStream, LayerComposite* aLayerComposite);
|
static void PrintInfo(std::stringstream& aStream, LayerComposite* aLayerComposite);
|
||||||
|
|
||||||
#ifdef MOZ_DUMP_PAINTING
|
#ifdef MOZ_DUMP_PAINTING
|
||||||
|
|
|
||||||
|
|
@ -586,36 +586,6 @@ public:
|
||||||
*/
|
*/
|
||||||
void LogSelf(const char* aPrefix="");
|
void LogSelf(const char* aPrefix="");
|
||||||
|
|
||||||
/**
|
|
||||||
* Record (and return) frame-intervals and paint-times for frames which were presented
|
|
||||||
* between calling StartFrameTimeRecording and StopFrameTimeRecording.
|
|
||||||
*
|
|
||||||
* - Uses a cyclic buffer and serves concurrent consumers, so if Stop is called too late
|
|
||||||
* (elements were overwritten since Start), result is considered invalid and hence empty.
|
|
||||||
* - Buffer is capable of holding 10 seconds @ 60fps (or more if frames were less frequent).
|
|
||||||
* Can be changed (up to 1 hour) via pref: toolkit.framesRecording.bufferSize.
|
|
||||||
* - Note: the first frame-interval may be longer than expected because last frame
|
|
||||||
* might have been presented some time before calling StartFrameTimeRecording.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a handle which represents current recording start position.
|
|
||||||
*/
|
|
||||||
virtual uint32_t StartFrameTimeRecording(int32_t aBufferSize);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clears, then populates aFrameIntervals with the recorded frame timing
|
|
||||||
* data. The array will be empty if data was overwritten since
|
|
||||||
* aStartIndex was obtained.
|
|
||||||
*/
|
|
||||||
virtual void StopFrameTimeRecording(uint32_t aStartIndex,
|
|
||||||
nsTArray<float>& aFrameIntervals);
|
|
||||||
|
|
||||||
void RecordFrame();
|
|
||||||
void PostPresent();
|
|
||||||
|
|
||||||
void BeginTabSwitch();
|
|
||||||
|
|
||||||
static bool IsLogEnabled();
|
static bool IsLogEnabled();
|
||||||
static mozilla::LogModule* GetLog();
|
static mozilla::LogModule* GetLog();
|
||||||
|
|
||||||
|
|
@ -686,27 +656,6 @@ protected:
|
||||||
TimeStamp mAnimationReadyTime;
|
TimeStamp mAnimationReadyTime;
|
||||||
// The count of pixels that were painted in the current transaction.
|
// The count of pixels that were painted in the current transaction.
|
||||||
uint32_t mPaintedPixelCount;
|
uint32_t mPaintedPixelCount;
|
||||||
private:
|
|
||||||
struct FramesTimingRecording
|
|
||||||
{
|
|
||||||
// Stores state and data for frame intervals and paint times recording.
|
|
||||||
// see LayerManager::StartFrameTimeRecording() at Layers.cpp for more details.
|
|
||||||
FramesTimingRecording()
|
|
||||||
: mNextIndex(0)
|
|
||||||
, mLatestStartIndex(0)
|
|
||||||
, mCurrentRunStartIndex(0)
|
|
||||||
, mIsPaused(true)
|
|
||||||
{}
|
|
||||||
nsTArray<float> mIntervals;
|
|
||||||
TimeStamp mLastFrameTime;
|
|
||||||
uint32_t mNextIndex;
|
|
||||||
uint32_t mLatestStartIndex;
|
|
||||||
uint32_t mCurrentRunStartIndex;
|
|
||||||
bool mIsPaused;
|
|
||||||
};
|
|
||||||
FramesTimingRecording mRecording;
|
|
||||||
|
|
||||||
TimeStamp mTabSwitchStart;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -629,8 +629,6 @@ BasicLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback,
|
||||||
if (mWidget) {
|
if (mWidget) {
|
||||||
FlashWidgetUpdateArea(mTarget);
|
FlashWidgetUpdateArea(mTarget);
|
||||||
}
|
}
|
||||||
RecordFrame();
|
|
||||||
PostPresent();
|
|
||||||
|
|
||||||
if (!mTransactionIncomplete) {
|
if (!mTransactionIncomplete) {
|
||||||
// Clear out target if we have a complete transaction.
|
// Clear out target if we have a complete transaction.
|
||||||
|
|
|
||||||
|
|
@ -617,28 +617,6 @@ ClientLayerManager::SendInvalidRegion(const nsIntRegion& aRegion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
|
||||||
ClientLayerManager::StartFrameTimeRecording(int32_t aBufferSize)
|
|
||||||
{
|
|
||||||
CompositorBridgeChild* renderer = GetRemoteRenderer();
|
|
||||||
if (renderer) {
|
|
||||||
uint32_t startIndex;
|
|
||||||
renderer->SendStartFrameTimeRecording(aBufferSize, &startIndex);
|
|
||||||
return startIndex;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientLayerManager::StopFrameTimeRecording(uint32_t aStartIndex,
|
|
||||||
nsTArray<float>& aFrameIntervals)
|
|
||||||
{
|
|
||||||
CompositorBridgeChild* renderer = GetRemoteRenderer();
|
|
||||||
if (renderer) {
|
|
||||||
renderer->SendStopFrameTimeRecording(aStartIndex, &aFrameIntervals);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientLayerManager::ForwardTransaction(bool aScheduleComposite)
|
ClientLayerManager::ForwardTransaction(bool aScheduleComposite)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -98,11 +98,6 @@ public:
|
||||||
virtual void FlushRendering() override;
|
virtual void FlushRendering() override;
|
||||||
void SendInvalidRegion(const nsIntRegion& aRegion);
|
void SendInvalidRegion(const nsIntRegion& aRegion);
|
||||||
|
|
||||||
virtual uint32_t StartFrameTimeRecording(int32_t aBufferSize) override;
|
|
||||||
|
|
||||||
virtual void StopFrameTimeRecording(uint32_t aStartIndex,
|
|
||||||
nsTArray<float>& aFrameIntervals) override;
|
|
||||||
|
|
||||||
virtual bool NeedsWidgetInvalidation() override { return false; }
|
virtual bool NeedsWidgetInvalidation() override { return false; }
|
||||||
|
|
||||||
ShadowableLayer* Hold(Layer* aLayer);
|
ShadowableLayer* Hold(Layer* aLayer);
|
||||||
|
|
|
||||||
|
|
@ -966,8 +966,6 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion, const nsIntRegi
|
||||||
}
|
}
|
||||||
|
|
||||||
mCompositor->GetWidget()->PostRender(&widgetContext);
|
mCompositor->GetWidget()->PostRender(&widgetContext);
|
||||||
|
|
||||||
RecordFrame();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<PaintedLayerComposite>
|
already_AddRefed<PaintedLayerComposite>
|
||||||
|
|
|
||||||
|
|
@ -802,24 +802,6 @@ CompositorBridgeChild::SendFlushRendering()
|
||||||
return PCompositorBridgeChild::SendFlushRendering();
|
return PCompositorBridgeChild::SendFlushRendering();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
CompositorBridgeChild::SendStartFrameTimeRecording(const int32_t& bufferSize, uint32_t* startIndex)
|
|
||||||
{
|
|
||||||
if (!mCanSend) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return PCompositorBridgeChild::SendStartFrameTimeRecording(bufferSize, startIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
CompositorBridgeChild::SendStopFrameTimeRecording(const uint32_t& startIndex, nsTArray<float>* intervals)
|
|
||||||
{
|
|
||||||
if (!mCanSend) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return PCompositorBridgeChild::SendStopFrameTimeRecording(startIndex, intervals);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CompositorBridgeChild::SendNotifyRegionInvalidated(const nsIntRegion& region)
|
CompositorBridgeChild::SendNotifyRegionInvalidated(const nsIntRegion& region)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -159,8 +159,6 @@ public:
|
||||||
bool SendMakeSnapshot(const SurfaceDescriptor& inSnapshot, const gfx::IntRect& dirtyRect);
|
bool SendMakeSnapshot(const SurfaceDescriptor& inSnapshot, const gfx::IntRect& dirtyRect);
|
||||||
bool SendFlushRendering();
|
bool SendFlushRendering();
|
||||||
bool SendGetTileSize(int32_t* tileWidth, int32_t* tileHeight);
|
bool SendGetTileSize(int32_t* tileWidth, int32_t* tileHeight);
|
||||||
bool SendStartFrameTimeRecording(const int32_t& bufferSize, uint32_t* startIndex);
|
|
||||||
bool SendStopFrameTimeRecording(const uint32_t& startIndex, nsTArray<float>* intervals);
|
|
||||||
bool SendNotifyRegionInvalidated(const nsIntRegion& region);
|
bool SendNotifyRegionInvalidated(const nsIntRegion& region);
|
||||||
bool SendRequestNotifyAfterRemotePaint();
|
bool SendRequestNotifyAfterRemotePaint();
|
||||||
bool SendClearApproximatelyVisibleRegions(uint64_t aLayersId, uint32_t aPresShellId);
|
bool SendClearApproximatelyVisibleRegions(uint64_t aLayersId, uint32_t aPresShellId);
|
||||||
|
|
|
||||||
|
|
@ -817,27 +817,6 @@ CompositorBridgeParent::Invalidate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
CompositorBridgeParent::RecvStartFrameTimeRecording(const int32_t& aBufferSize, uint32_t* aOutStartIndex)
|
|
||||||
{
|
|
||||||
if (mLayerManager) {
|
|
||||||
*aOutStartIndex = mLayerManager->StartFrameTimeRecording(aBufferSize);
|
|
||||||
} else {
|
|
||||||
*aOutStartIndex = 0;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
CompositorBridgeParent::RecvStopFrameTimeRecording(const uint32_t& aStartIndex,
|
|
||||||
InfallibleTArray<float>* intervals)
|
|
||||||
{
|
|
||||||
if (mLayerManager) {
|
|
||||||
mLayerManager->StopFrameTimeRecording(aStartIndex, *intervals);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CompositorBridgeParent::RecvClearApproximatelyVisibleRegions(const uint64_t& aLayersId,
|
CompositorBridgeParent::RecvClearApproximatelyVisibleRegions(const uint64_t& aLayersId,
|
||||||
const uint32_t& aPresShellId)
|
const uint32_t& aPresShellId)
|
||||||
|
|
|
||||||
|
|
@ -281,8 +281,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool RecvNotifyRegionInvalidated(const nsIntRegion& aRegion) override;
|
virtual bool RecvNotifyRegionInvalidated(const nsIntRegion& aRegion) override;
|
||||||
virtual bool RecvStartFrameTimeRecording(const int32_t& aBufferSize, uint32_t* aOutStartIndex) override;
|
|
||||||
virtual bool RecvStopFrameTimeRecording(const uint32_t& aStartIndex, InfallibleTArray<float>* intervals) override;
|
|
||||||
|
|
||||||
// Unused for chrome <-> compositor communication (which this class does).
|
// Unused for chrome <-> compositor communication (which this class does).
|
||||||
// @see CrossProcessCompositorBridgeParent::RecvRequestNotifyAfterRemotePaint
|
// @see CrossProcessCompositorBridgeParent::RecvRequestNotifyAfterRemotePaint
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,6 @@ public:
|
||||||
virtual bool RecvFlushRendering() override { return true; }
|
virtual bool RecvFlushRendering() override { return true; }
|
||||||
virtual bool RecvForcePresent() override { return true; }
|
virtual bool RecvForcePresent() override { return true; }
|
||||||
virtual bool RecvNotifyRegionInvalidated(const nsIntRegion& aRegion) override { return true; }
|
virtual bool RecvNotifyRegionInvalidated(const nsIntRegion& aRegion) override { return true; }
|
||||||
virtual bool RecvStartFrameTimeRecording(const int32_t& aBufferSize, uint32_t* aOutStartIndex) override { return true; }
|
|
||||||
virtual bool RecvStopFrameTimeRecording(const uint32_t& aStartIndex, InfallibleTArray<float>* intervals) override { return true; }
|
|
||||||
|
|
||||||
virtual bool RecvClearApproximatelyVisibleRegions(const uint64_t& aLayersId,
|
virtual bool RecvClearApproximatelyVisibleRegions(const uint64_t& aLayersId,
|
||||||
const uint32_t& aPresShellId) override;
|
const uint32_t& aPresShellId) override;
|
||||||
|
|
|
||||||
|
|
@ -184,12 +184,6 @@ parent:
|
||||||
// work around a windows presentation bug (See Bug 1232042)
|
// work around a windows presentation bug (See Bug 1232042)
|
||||||
async ForcePresent();
|
async ForcePresent();
|
||||||
|
|
||||||
sync StartFrameTimeRecording(int32_t bufferSize)
|
|
||||||
returns (uint32_t startIndex);
|
|
||||||
|
|
||||||
sync StopFrameTimeRecording(uint32_t startIndex)
|
|
||||||
returns (float[] intervals);
|
|
||||||
|
|
||||||
// layersBackendHints is an ordered list of preffered backends where
|
// layersBackendHints is an ordered list of preffered backends where
|
||||||
// layersBackendHints[0] is the best backend. If any hints are LayersBackend::LAYERS_NONE
|
// layersBackendHints[0] is the best backend. If any hints are LayersBackend::LAYERS_NONE
|
||||||
// that hint is ignored.
|
// that hint is ignored.
|
||||||
|
|
|
||||||
|
|
@ -593,6 +593,7 @@ private:
|
||||||
DECL_GFX_PREF(Once, "webgl.force-layers-readback", WebGLForceLayersReadback, bool, false);
|
DECL_GFX_PREF(Once, "webgl.force-layers-readback", WebGLForceLayersReadback, bool, false);
|
||||||
DECL_GFX_PREF(Live, "webgl.lose-context-on-memory-pressure", WebGLLoseContextOnMemoryPressure, bool, false);
|
DECL_GFX_PREF(Live, "webgl.lose-context-on-memory-pressure", WebGLLoseContextOnMemoryPressure, bool, false);
|
||||||
DECL_GFX_PREF(Live, "webgl.max-warnings-per-context", WebGLMaxWarningsPerContext, uint32_t, 32);
|
DECL_GFX_PREF(Live, "webgl.max-warnings-per-context", WebGLMaxWarningsPerContext, uint32_t, 32);
|
||||||
|
DECL_GFX_PREF(Live, "webgl.max-size-per-texture-mb", WebGLMaxSizePerTextureMB, uint32_t, 1024);
|
||||||
DECL_GFX_PREF(Live, "webgl.min_capability_mode", WebGLMinCapabilityMode, bool, false);
|
DECL_GFX_PREF(Live, "webgl.min_capability_mode", WebGLMinCapabilityMode, bool, false);
|
||||||
DECL_GFX_PREF(Live, "webgl.msaa-force", WebGLForceMSAA, bool, false);
|
DECL_GFX_PREF(Live, "webgl.msaa-force", WebGLForceMSAA, bool, false);
|
||||||
DECL_GFX_PREF(Live, "webgl.prefer-16bpp", WebGLPrefer16bpp, bool, false);
|
DECL_GFX_PREF(Live, "webgl.prefer-16bpp", WebGLPrefer16bpp, bool, false);
|
||||||
|
|
|
||||||
|
|
@ -212,9 +212,12 @@ SVGDocumentWrapper::TickRefreshDriver()
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell;
|
||||||
mViewer->GetPresShell(getter_AddRefs(presShell));
|
mViewer->GetPresShell(getter_AddRefs(presShell));
|
||||||
if (presShell) {
|
if (presShell) {
|
||||||
nsPresContext* presContext = presShell->GetPresContext();
|
RefPtr<nsPresContext> presContext = presShell->GetPresContext();
|
||||||
if (presContext) {
|
if (presContext) {
|
||||||
presContext->RefreshDriver()->DoTick();
|
RefPtr<nsRefreshDriver> driver = presContext->RefreshDriver();
|
||||||
|
if (driver) {
|
||||||
|
driver->DoTick();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
|
|
||||||
use std::env;
|
|
||||||
use std::process::{Command, Stdio};
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let out_dir = env::var("OUT_DIR").expect("Should have env var OUT_DIR");
|
|
||||||
let target = env::var("TARGET").expect("Should have env var TARGET");
|
|
||||||
|
|
||||||
let js_src = env::var("CARGO_MANIFEST_DIR").expect("Should have env var CARGO_MANIFEST_DIR");
|
|
||||||
|
|
||||||
env::set_current_dir(&js_src).unwrap();
|
|
||||||
|
|
||||||
let variant = if cfg!(feature = "debugmozjs") {
|
|
||||||
"plaindebug"
|
|
||||||
} else {
|
|
||||||
"plain"
|
|
||||||
};
|
|
||||||
|
|
||||||
let python = env::var("PYTHON").unwrap_or("python2.7".into());
|
|
||||||
let mut cmd = Command::new(&python);
|
|
||||||
cmd.args(&["./devtools/automation/autospider.py",
|
|
||||||
"--build-only",
|
|
||||||
"--objdir", &out_dir,
|
|
||||||
variant])
|
|
||||||
.env("SOURCE", &js_src)
|
|
||||||
.env("PWD", &js_src)
|
|
||||||
.env("AUTOMATION", "1")
|
|
||||||
.stdout(Stdio::inherit())
|
|
||||||
.stderr(Stdio::inherit());
|
|
||||||
println!("Running command: {:?}", cmd);
|
|
||||||
let result = cmd
|
|
||||||
.status()
|
|
||||||
.expect("Should spawn autospider OK");
|
|
||||||
assert!(result.success(), "autospider should exit OK");
|
|
||||||
|
|
||||||
println!("cargo:rustc-link-search=native={}/js/src", out_dir);
|
|
||||||
|
|
||||||
if target.contains("windows") {
|
|
||||||
println!("cargo:rustc-link-lib=winmm");
|
|
||||||
println!("cargo:rustc-link-lib=psapi");
|
|
||||||
if target.contains("gnu") {
|
|
||||||
println!("cargo:rustc-link-lib=stdc++");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
println!("cargo:rustc-link-lib=stdc++");
|
|
||||||
}
|
|
||||||
|
|
||||||
println!("cargo:rustc-link-lib=static=js_static");
|
|
||||||
println!("cargo:outdir={}", out_dir);
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
extern crate libz_sys;
|
|
||||||
|
|
||||||
|
|
@ -231,6 +231,10 @@ pref("dom.keyboardevent.code.enabled", true);
|
||||||
// even if this is true).
|
// even if this is true).
|
||||||
pref("dom.keyboardevent.dispatch_during_composition", false);
|
pref("dom.keyboardevent.dispatch_during_composition", false);
|
||||||
|
|
||||||
|
// If this is true, TextEventDispatcher dispatches keypress events
|
||||||
|
// for the input of non-printable characters (content only).
|
||||||
|
pref("dom.keyboardevent.keypress.dispatch_non_printable_in_content", false);
|
||||||
|
|
||||||
// Whether URL,Location,Link::GetHash should be percent encoded
|
// Whether URL,Location,Link::GetHash should be percent encoded
|
||||||
// in setter and percent decoded in getter (old behaviour = true)
|
// in setter and percent decoded in getter (old behaviour = true)
|
||||||
pref("dom.url.encode_decode_hash", true);
|
pref("dom.url.encode_decode_hash", true);
|
||||||
|
|
@ -4284,6 +4288,7 @@ pref("webgl.lose-context-on-memory-pressure", false);
|
||||||
pref("webgl.can-lose-context-in-foreground", true);
|
pref("webgl.can-lose-context-in-foreground", true);
|
||||||
pref("webgl.restore-context-when-visible", true);
|
pref("webgl.restore-context-when-visible", true);
|
||||||
pref("webgl.max-warnings-per-context", 32);
|
pref("webgl.max-warnings-per-context", 32);
|
||||||
|
pref("webgl.max-size-per-texture-mb", 1024);
|
||||||
pref("webgl.enable-draft-extensions", false);
|
pref("webgl.enable-draft-extensions", false);
|
||||||
pref("webgl.enable-privileged-extensions", false);
|
pref("webgl.enable-privileged-extensions", false);
|
||||||
pref("webgl.bypass-shader-validation", false);
|
pref("webgl.bypass-shader-validation", false);
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
#include "nsFormFillController.h"
|
#include "nsFormFillController.h"
|
||||||
|
|
||||||
|
#include "mozilla/EventListenerManager.h"
|
||||||
#include "mozilla/dom/Element.h"
|
#include "mozilla/dom/Element.h"
|
||||||
#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
|
#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
|
||||||
#include "nsIFormAutoComplete.h"
|
#include "nsIFormAutoComplete.h"
|
||||||
|
|
@ -40,6 +41,7 @@
|
||||||
#include "nsIScriptSecurityManager.h"
|
#include "nsIScriptSecurityManager.h"
|
||||||
#include "nsFocusManager.h"
|
#include "nsFocusManager.h"
|
||||||
|
|
||||||
|
using namespace mozilla;
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
|
|
||||||
NS_IMPL_CYCLE_COLLECTION(nsFormFillController,
|
NS_IMPL_CYCLE_COLLECTION(nsFormFillController,
|
||||||
|
|
@ -1188,23 +1190,29 @@ nsFormFillController::AddWindowListeners(nsPIDOMWindowOuter* aWindow)
|
||||||
if (!target)
|
if (!target)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
target->AddEventListener(NS_LITERAL_STRING("focus"), this,
|
EventListenerManager* elm = target->GetOrCreateListenerManager();
|
||||||
true, false);
|
if (NS_WARN_IF(!elm)) {
|
||||||
target->AddEventListener(NS_LITERAL_STRING("blur"), this,
|
return;
|
||||||
true, false);
|
}
|
||||||
target->AddEventListener(NS_LITERAL_STRING("pagehide"), this,
|
|
||||||
true, false);
|
elm->AddEventListenerByType(this, NS_LITERAL_STRING("focus"),
|
||||||
target->AddEventListener(NS_LITERAL_STRING("mousedown"), this,
|
TrustedEventsAtCapture());
|
||||||
true, false);
|
elm->AddEventListenerByType(this, NS_LITERAL_STRING("blur"),
|
||||||
target->AddEventListener(NS_LITERAL_STRING("input"), this,
|
TrustedEventsAtCapture());
|
||||||
true, false);
|
elm->AddEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
|
||||||
target->AddEventListener(NS_LITERAL_STRING("keypress"), this, true, false);
|
TrustedEventsAtCapture());
|
||||||
target->AddEventListener(NS_LITERAL_STRING("compositionstart"), this,
|
elm->AddEventListenerByType(this, NS_LITERAL_STRING("mousedown"),
|
||||||
true, false);
|
TrustedEventsAtCapture());
|
||||||
target->AddEventListener(NS_LITERAL_STRING("compositionend"), this,
|
elm->AddEventListenerByType(this, NS_LITERAL_STRING("input"),
|
||||||
true, false);
|
TrustedEventsAtCapture());
|
||||||
target->AddEventListener(NS_LITERAL_STRING("contextmenu"), this,
|
elm->AddEventListenerByType(this, NS_LITERAL_STRING("keypress"),
|
||||||
true, false);
|
TrustedEventsAtSystemGroupCapture());
|
||||||
|
elm->AddEventListenerByType(this, NS_LITERAL_STRING("compositionstart"),
|
||||||
|
TrustedEventsAtCapture());
|
||||||
|
elm->AddEventListenerByType(this, NS_LITERAL_STRING("compositionend"),
|
||||||
|
TrustedEventsAtCapture());
|
||||||
|
elm->AddEventListenerByType(this, NS_LITERAL_STRING("contextmenu"),
|
||||||
|
TrustedEventsAtCapture());
|
||||||
|
|
||||||
// Note that any additional listeners added should ensure that they ignore
|
// Note that any additional listeners added should ensure that they ignore
|
||||||
// untrusted events, which might be sent by content that's up to no good.
|
// untrusted events, which might be sent by content that's up to no good.
|
||||||
|
|
@ -1226,17 +1234,29 @@ nsFormFillController::RemoveWindowListeners(nsPIDOMWindowOuter* aWindow)
|
||||||
if (!target)
|
if (!target)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
target->RemoveEventListener(NS_LITERAL_STRING("focus"), this, true);
|
EventListenerManager* elm = target->GetOrCreateListenerManager();
|
||||||
target->RemoveEventListener(NS_LITERAL_STRING("blur"), this, true);
|
if (NS_WARN_IF(!elm)) {
|
||||||
target->RemoveEventListener(NS_LITERAL_STRING("pagehide"), this, true);
|
return;
|
||||||
target->RemoveEventListener(NS_LITERAL_STRING("mousedown"), this, true);
|
}
|
||||||
target->RemoveEventListener(NS_LITERAL_STRING("input"), this, true);
|
|
||||||
target->RemoveEventListener(NS_LITERAL_STRING("keypress"), this, true);
|
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("focus"),
|
||||||
target->RemoveEventListener(NS_LITERAL_STRING("compositionstart"), this,
|
TrustedEventsAtCapture());
|
||||||
true);
|
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("blur"),
|
||||||
target->RemoveEventListener(NS_LITERAL_STRING("compositionend"), this,
|
TrustedEventsAtCapture());
|
||||||
true);
|
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
|
||||||
target->RemoveEventListener(NS_LITERAL_STRING("contextmenu"), this, true);
|
TrustedEventsAtCapture());
|
||||||
|
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("mousedown"),
|
||||||
|
TrustedEventsAtCapture());
|
||||||
|
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("input"),
|
||||||
|
TrustedEventsAtCapture());
|
||||||
|
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("keypress"),
|
||||||
|
TrustedEventsAtSystemGroupCapture());
|
||||||
|
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("compositionstart"),
|
||||||
|
TrustedEventsAtCapture());
|
||||||
|
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("compositionend"),
|
||||||
|
TrustedEventsAtCapture());
|
||||||
|
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("contextmenu"),
|
||||||
|
TrustedEventsAtCapture());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -648,7 +648,7 @@
|
||||||
this.onInput(event);
|
this.onInput(event);
|
||||||
]]></handler>
|
]]></handler>
|
||||||
|
|
||||||
<handler event="keypress" phase="capturing"
|
<handler event="keypress" phase="capturing" group="system"
|
||||||
action="return this.onKeyPress(event);"/>
|
action="return this.onKeyPress(event);"/>
|
||||||
|
|
||||||
<handler event="compositionstart" phase="capturing"
|
<handler event="compositionstart" phase="capturing"
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,6 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
|
||||||
if CONFIG['OS_ARCH'] == 'SunOS':
|
if CONFIG['OS_ARCH'] == 'SunOS':
|
||||||
OS_LIBS += [
|
OS_LIBS += [
|
||||||
'elf',
|
'elf',
|
||||||
'demangle',
|
|
||||||
'sendfile',
|
'sendfile',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,7 @@ toolbar#ToolbarMode .toolbarbutton-text {
|
||||||
}
|
}
|
||||||
|
|
||||||
%ifdef XP_WIN
|
%ifdef XP_WIN
|
||||||
@media not (-moz-os-version: windows-win10) {
|
@media not all and (-moz-os-version: windows-win10) {
|
||||||
#ToolbarMode {
|
#ToolbarMode {
|
||||||
-moz-appearance: -moz-win-browsertabbar-toolbox;
|
-moz-appearance: -moz-win-browsertabbar-toolbox;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,23 @@ enum class OperatingSystem {
|
||||||
Windows8_1,
|
Windows8_1,
|
||||||
Windows10,
|
Windows10,
|
||||||
Linux,
|
Linux,
|
||||||
|
OSX,
|
||||||
|
OSX10_5,
|
||||||
|
OSX10_6,
|
||||||
|
OSX10_7,
|
||||||
|
OSX10_8,
|
||||||
|
OSX10_9,
|
||||||
|
OSX10_10,
|
||||||
|
OSX10_11,
|
||||||
|
OSX10_12,
|
||||||
|
OSX10_13,
|
||||||
|
OSX10_14,
|
||||||
|
OSX10_15,
|
||||||
|
OSX10_16,
|
||||||
|
OSX11_0,
|
||||||
|
OSX12_0,
|
||||||
|
OSX13_0,
|
||||||
|
Ios
|
||||||
};
|
};
|
||||||
|
|
||||||
enum VersionComparisonOp {
|
enum VersionComparisonOp {
|
||||||
|
|
|
||||||
|
|
@ -264,6 +264,34 @@ BlacklistOSToOperatingSystem(const nsAString& os)
|
||||||
return OperatingSystem::Windows10;
|
return OperatingSystem::Windows10;
|
||||||
else if (os.EqualsLiteral("Linux"))
|
else if (os.EqualsLiteral("Linux"))
|
||||||
return OperatingSystem::Linux;
|
return OperatingSystem::Linux;
|
||||||
|
else if (os.EqualsLiteral("Darwin 9"))
|
||||||
|
return OperatingSystem::OSX10_5;
|
||||||
|
else if (os.EqualsLiteral("Darwin 10"))
|
||||||
|
return OperatingSystem::OSX10_6;
|
||||||
|
else if (os.EqualsLiteral("Darwin 11"))
|
||||||
|
return OperatingSystem::OSX10_7;
|
||||||
|
else if (os.EqualsLiteral("Darwin 12"))
|
||||||
|
return OperatingSystem::OSX10_8;
|
||||||
|
else if (os.EqualsLiteral("Darwin 13"))
|
||||||
|
return OperatingSystem::OSX10_9;
|
||||||
|
else if (os.EqualsLiteral("Darwin 14"))
|
||||||
|
return OperatingSystem::OSX10_10;
|
||||||
|
else if (os.EqualsLiteral("Darwin 15"))
|
||||||
|
return OperatingSystem::OSX10_11;
|
||||||
|
else if (os.EqualsLiteral("Darwin 16"))
|
||||||
|
return OperatingSystem::OSX10_12;
|
||||||
|
else if (os.EqualsLiteral("Darwin 17"))
|
||||||
|
return OperatingSystem::OSX10_13;
|
||||||
|
else if (os.EqualsLiteral("Darwin 18"))
|
||||||
|
return OperatingSystem::OSX10_14;
|
||||||
|
else if (os.EqualsLiteral("Darwin 19"))
|
||||||
|
return OperatingSystem::OSX10_15;
|
||||||
|
else if (os.EqualsLiteral("Darwin 20"))
|
||||||
|
return OperatingSystem::OSX11_0;
|
||||||
|
else if (os.EqualsLiteral("Darwin 21"))
|
||||||
|
return OperatingSystem::OSX12_0;
|
||||||
|
else if (os.EqualsLiteral("Darwin 22"))
|
||||||
|
return OperatingSystem::OSX13_0;
|
||||||
// For historical reasons, "All" in blocklist means "All Windows"
|
// For historical reasons, "All" in blocklist means "All Windows"
|
||||||
else if (os.EqualsLiteral("All"))
|
else if (os.EqualsLiteral("All"))
|
||||||
return OperatingSystem::Windows;
|
return OperatingSystem::Windows;
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ namespace widget {
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
bool TextEventDispatcher::sDispatchKeyEventsDuringComposition = false;
|
bool TextEventDispatcher::sDispatchKeyEventsDuringComposition = false;
|
||||||
|
bool TextEventDispatcher::sDispatchKeyPressEventNonPrintableInContent = false;
|
||||||
|
|
||||||
TextEventDispatcher::TextEventDispatcher(nsIWidget* aWidget)
|
TextEventDispatcher::TextEventDispatcher(nsIWidget* aWidget)
|
||||||
: mWidget(aWidget)
|
: mWidget(aWidget)
|
||||||
|
|
@ -36,6 +37,10 @@ TextEventDispatcher::TextEventDispatcher(nsIWidget* aWidget)
|
||||||
&sDispatchKeyEventsDuringComposition,
|
&sDispatchKeyEventsDuringComposition,
|
||||||
"dom.keyboardevent.dispatch_during_composition",
|
"dom.keyboardevent.dispatch_during_composition",
|
||||||
false);
|
false);
|
||||||
|
Preferences::AddBoolVarCache(
|
||||||
|
&sDispatchKeyPressEventNonPrintableInContent,
|
||||||
|
"dom.keyboardevent.keypress.dispatch_non_printable_in_content",
|
||||||
|
false);
|
||||||
sInitialized = true;
|
sInitialized = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -531,6 +536,13 @@ TextEventDispatcher::DispatchKeyboardEventInternal(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!sDispatchKeyPressEventNonPrintableInContent &&
|
||||||
|
keyEvent.mMessage == eKeyPress &&
|
||||||
|
!keyEvent.IsInputtingText() &&
|
||||||
|
!keyEvent.IsInputtingLineBreak()) {
|
||||||
|
keyEvent.mFlags.mOnlySystemGroupDispatchInContent = true;
|
||||||
|
}
|
||||||
|
|
||||||
DispatchInputEvent(mWidget, keyEvent, aStatus);
|
DispatchInputEvent(mWidget, keyEvent, aStatus);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -399,6 +399,10 @@ private:
|
||||||
// is a composition.
|
// is a composition.
|
||||||
static bool sDispatchKeyEventsDuringComposition;
|
static bool sDispatchKeyEventsDuringComposition;
|
||||||
|
|
||||||
|
// If this is true, keypress events for non-printable keys are dispatched to
|
||||||
|
// event listeners of the system event group in web content.
|
||||||
|
static bool sDispatchKeyPressEventNonPrintableInContent;
|
||||||
|
|
||||||
nsresult BeginInputTransactionInternal(
|
nsresult BeginInputTransactionInternal(
|
||||||
TextEventDispatcherListener* aListener,
|
TextEventDispatcherListener* aListener,
|
||||||
InputTransactionType aType);
|
InputTransactionType aType);
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,30 @@ public:
|
||||||
return IsKeyEventOnPlugin(mMessage);
|
return IsKeyEventOnPlugin(mMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsInputtingText() const
|
||||||
|
{
|
||||||
|
// NOTE: On some keyboard layouts, some characters are put in with Control
|
||||||
|
// or Alt keys, but at that time, widget unsets the modifier flag
|
||||||
|
// from the eKeyPress event, so it does not count as a modifier in
|
||||||
|
// this check.
|
||||||
|
return mMessage == eKeyPress &&
|
||||||
|
mCharCode &&
|
||||||
|
!(mModifiers & (MODIFIER_ALT |
|
||||||
|
MODIFIER_CONTROL |
|
||||||
|
MODIFIER_META |
|
||||||
|
MODIFIER_OS));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsInputtingLineBreak() const
|
||||||
|
{
|
||||||
|
return mMessage == eKeyPress &&
|
||||||
|
mKeyNameIndex == KEY_NAME_INDEX_Enter &&
|
||||||
|
!(mModifiers & (MODIFIER_ALT |
|
||||||
|
MODIFIER_CONTROL |
|
||||||
|
MODIFIER_META |
|
||||||
|
MODIFIER_OS));
|
||||||
|
}
|
||||||
|
|
||||||
virtual WidgetEvent* Duplicate() const override
|
virtual WidgetEvent* Duplicate() const override
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mClass == eKeyboardEventClass,
|
MOZ_ASSERT(mClass == eKeyboardEventClass,
|
||||||
|
|
|
||||||
|
|
@ -63,12 +63,12 @@ OSXVersionToOperatingSystem(uint32_t aOSXVersion) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
switch (nsCocoaFeatures::ExtractMinorVersion(aOSXVersion)) {
|
return OperatingSystem::OSX11_0;
|
||||||
case 0:
|
case 12:
|
||||||
return OperatingSystem::OSX11_0;
|
return OperatingSystem::OSX12_0;
|
||||||
default:
|
case 13:
|
||||||
break;
|
return OperatingSystem::OSX13_0;
|
||||||
}
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ public:
|
||||||
static bool OnCatalinaOrLater();
|
static bool OnCatalinaOrLater();
|
||||||
static bool OnBigSurOrLater();
|
static bool OnBigSurOrLater();
|
||||||
static bool OnMontereyOrLater();
|
static bool OnMontereyOrLater();
|
||||||
|
static bool OnVenturaOrLater();
|
||||||
|
|
||||||
static bool IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix=0);
|
static bool IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix=0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
#define MACOS_VERSION_10_16_HEX 0x000A1000
|
#define MACOS_VERSION_10_16_HEX 0x000A1000
|
||||||
#define MACOS_VERSION_11_0_HEX 0x000B0000
|
#define MACOS_VERSION_11_0_HEX 0x000B0000
|
||||||
#define MACOS_VERSION_12_0_HEX 0x000C0000
|
#define MACOS_VERSION_12_0_HEX 0x000C0000
|
||||||
|
#define MACOS_VERSION_13_0_HEX 0x000D0000
|
||||||
|
|
||||||
#include "nsCocoaFeatures.h"
|
#include "nsCocoaFeatures.h"
|
||||||
#include "nsCocoaUtils.h"
|
#include "nsCocoaUtils.h"
|
||||||
|
|
@ -212,7 +213,8 @@ nsCocoaFeatures::OnBigSurOrLater()
|
||||||
(macOSVersion() >= MACOS_VERSION_11_0_HEX));
|
(macOSVersion() >= MACOS_VERSION_11_0_HEX));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ bool nsCocoaFeatures::OnMontereyOrLater()
|
/* static */ bool
|
||||||
|
nsCocoaFeatures::OnMontereyOrLater()
|
||||||
{
|
{
|
||||||
// Monterey pretends to be 10.16 and is indistinguishable from Big Sur.
|
// Monterey pretends to be 10.16 and is indistinguishable from Big Sur.
|
||||||
// In practice, this means that an Intel build can return false
|
// In practice, this means that an Intel build can return false
|
||||||
|
|
@ -221,6 +223,12 @@ nsCocoaFeatures::OnBigSurOrLater()
|
||||||
return (macOSVersion() >= MACOS_VERSION_12_0_HEX);
|
return (macOSVersion() >= MACOS_VERSION_12_0_HEX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* static */ bool
|
||||||
|
nsCocoaFeatures::OnVenturaOrLater()
|
||||||
|
{
|
||||||
|
return (macOSVersion() >= MACOS_VERSION_13_0_HEX);
|
||||||
|
}
|
||||||
|
|
||||||
/* static */ bool
|
/* static */ bool
|
||||||
nsCocoaFeatures::IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix)
|
nsCocoaFeatures::IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix)
|
||||||
{
|
{
|
||||||
|
|
@ -234,7 +242,8 @@ nsCocoaFeatures::IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFi
|
||||||
* for this purpose. Note: using this in a sandboxed process requires allowing
|
* for this purpose. Note: using this in a sandboxed process requires allowing
|
||||||
* the sysctl in the sandbox policy.
|
* the sysctl in the sandbox policy.
|
||||||
*/
|
*/
|
||||||
/* static */ bool nsCocoaFeatures::ProcessIsRosettaTranslated()
|
/* static */ bool
|
||||||
|
nsCocoaFeatures::ProcessIsRosettaTranslated()
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
size_t size = sizeof(ret);
|
size_t size = sizeof(ret);
|
||||||
|
|
|
||||||
|
|
@ -2903,6 +2903,10 @@ static NSMutableSet *gSwizzledFrameViewClasses = nil;
|
||||||
{
|
{
|
||||||
mDrawsIntoWindowFrame = NO;
|
mDrawsIntoWindowFrame = NO;
|
||||||
[super initWithContentRect:aContentRect styleMask:aStyle backing:aBufferingType defer:aFlag];
|
[super initWithContentRect:aContentRect styleMask:aStyle backing:aBufferingType defer:aFlag];
|
||||||
|
// MacOS 13 Ventura, doesn't seem to create the contentView... so create it ourselves
|
||||||
|
if(![super contentView]) {
|
||||||
|
[super setContentView:[[NSView alloc] initWithFrame:aContentRect]];
|
||||||
|
}
|
||||||
mState = nil;
|
mState = nil;
|
||||||
mActiveTitlebarColor = nil;
|
mActiveTitlebarColor = nil;
|
||||||
mInactiveTitlebarColor = nil;
|
mInactiveTitlebarColor = nil;
|
||||||
|
|
|
||||||
|
|
@ -246,6 +246,7 @@ EncodeInputStream(nsIInputStream* aInputStream,
|
||||||
|
|
||||||
static const char kBase64URLAlphabet[] =
|
static const char kBase64URLAlphabet[] =
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
||||||
|
static_assert(mozilla::ArrayLength(kBase64URLAlphabet) == 0x41);
|
||||||
|
|
||||||
// Maps an encoded character to a value in the Base64 URL alphabet, per
|
// Maps an encoded character to a value in the Base64 URL alphabet, per
|
||||||
// RFC 4648, Table 2. Invalid input characters map to UINT8_MAX.
|
// RFC 4648, Table 2. Invalid input characters map to UINT8_MAX.
|
||||||
|
|
@ -267,14 +268,19 @@ static const uint8_t kBase64URLDecodeTable[] = {
|
||||||
255,
|
255,
|
||||||
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
|
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
|
||||||
42, 43, 44, 45, 46, 47, 48, 49, 50, 51, /* a - z */
|
42, 43, 44, 45, 46, 47, 48, 49, 50, 51, /* a - z */
|
||||||
255, 255, 255, 255,
|
255, 255, 255, 255, 255
|
||||||
};
|
};
|
||||||
|
static_assert(mozilla::ArrayLength(kBase64URLDecodeTable) == 0x80);
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Base64URLCharToValue(char aChar, uint8_t* aValue) {
|
Base64URLCharToValue(char aChar, uint8_t* aValue) {
|
||||||
uint8_t index = static_cast<uint8_t>(aChar);
|
uint8_t index = static_cast<uint8_t>(aChar);
|
||||||
*aValue = kBase64URLDecodeTable[index & 0x7f];
|
if (index >= mozilla::ArrayLength(kBase64URLDecodeTable)) {
|
||||||
return (*aValue != 255) && !(index & ~0x7f);
|
*aValue = 255;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
*aValue = kBase64URLDecodeTable[index];
|
||||||
|
return *aValue != 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue