Skip to content

Commit

Permalink
merge mozilla-inbound to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Sep 29, 2014
2 parents 007e054 + 3567f3d commit 0002d53
Show file tree
Hide file tree
Showing 359 changed files with 37,954 additions and 30,401 deletions.
2 changes: 1 addition & 1 deletion CLOBBER
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.

Bug 1065897: Updated moz.build requires CLOBBER
Bug 1069071: IPDL changes require CLOBBER
3 changes: 3 additions & 0 deletions b2g/dev/config/mozconfigs/win32/mulet
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
. "$topsrcdir/browser/config/mozconfigs/win32/nightly"

ac_add_options --enable-application=b2g/dev
2 changes: 1 addition & 1 deletion browser/devtools/timeline/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ let TimelineController = {
* updating the UI as needed.
*/
_stopRecordingAndDiscardData: function*() {
this._markers.length = 0;
yield this._stopRecording();
this._markers.length = 0;
},

/**
Expand Down
86 changes: 57 additions & 29 deletions browser/installer/windows/nsis/shared.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,15 @@ FunctionEnd
!macroend
!define ShowShortcuts "!insertmacro ShowShortcuts"

!macro AddAssociationIfNoneExist FILE_TYPE
ClearErrors
EnumRegKey $7 HKCR "${FILE_TYPE}" 0
${If} ${Errors}
WriteRegStr SHCTX "SOFTWARE\Classes\${FILE_TYPE}" "" "FirefoxHTML"
${EndIf}
!macroend
!define AddAssociationIfNoneExist "!insertmacro AddAssociationIfNoneExist"

; Adds the protocol and file handler registry entries for making Firefox the
; default handler (uses SHCTX).
!macro SetHandlers
Expand Down Expand Up @@ -430,35 +439,12 @@ FunctionEnd
WriteRegStr SHCTX "$0\.xhtml" "" "FirefoxHTML"
${EndIf}

; Only add .oga if it's not present
${CheckIfRegistryKeyExists} "$0" ".oga" $7
${If} $7 == "false"
WriteRegStr SHCTX "$0\.oga" "" "FirefoxHTML"
${EndIf}

; Only add .ogg if it's not present
${CheckIfRegistryKeyExists} "$0" ".ogg" $7
${If} $7 == "false"
WriteRegStr SHCTX "$0\.ogg" "" "FirefoxHTML"
${EndIf}

; Only add .ogv if it's not present
${CheckIfRegistryKeyExists} "$0" ".ogv" $7
${If} $7 == "false"
WriteRegStr SHCTX "$0\.ogv" "" "FirefoxHTML"
${EndIf}

; Only add .pdf if it's not present
${CheckIfRegistryKeyExists} "$0" ".pdf" $7
${If} $7 == "false"
WriteRegStr SHCTX "$0\.pdf" "" "FirefoxHTML"
${EndIf}

; Only add webm if it's not present
${CheckIfRegistryKeyExists} "$0" ".webm" $7
${If} $7 == "false"
WriteRegStr SHCTX "$0\.webm" "" "FirefoxHTML"
${EndIf}
${AddAssociationIfNoneExist} ".pdf"
${AddAssociationIfNoneExist} ".oga"
${AddAssociationIfNoneExist} ".ogg"
${AddAssociationIfNoneExist} ".ogv"
${AddAssociationIfNoneExist} ".pdf"
${AddAssociationIfNoneExist} ".webm"

; An empty string is used for the 5th param because FirefoxHTML is not a
; protocol handler
Expand Down Expand Up @@ -693,6 +679,40 @@ FunctionEnd
!macroend
!define SetUninstallKeys "!insertmacro SetUninstallKeys"

; Due to a bug when associating some file handlers, only SHCTX was checked for
; some file types such as ".pdf". SHCTX is set to HKCU or HKLM depending on
; whether the installer has write access to HKLM. The bug would happen when
; HCKU was checked and didn't exist since programs aren't required to set the
; HKCU Software\Classes keys when associating handlers. The fix uses the merged
; view in HKCR to check for existance of an existing association. This macro
; cleans affected installations by removing the HKLM and HKCU value if it is set
; to FirefoxHTML when there is a value for PersistentHandler or by removing the
; HKCU value when the HKLM value has a value other than an empty string.
!macro FixBadFileAssociation FILE_TYPE
; Only delete the default value in case the key has values for OpenWithList,
; OpenWithProgids, PersistentHandler, etc.
ReadRegStr $0 HKCU "Software\Classes\${FILE_TYPE}" ""
ReadRegStr $1 HKLM "Software\Classes\${FILE_TYPE}" ""
ReadRegStr $2 HKCR "${FILE_TYPE}\PersistentHandler" ""
${If} "$2" != ""
; Since there is a persistent handler remove FirefoxHTML as the default
; value from both HKCU and HKLM if it set to FirefoxHTML.
${If} "$0" == "FirefoxHTML"
DeleteRegValue HKCU "Software\Classes\${FILE_TYPE}" ""
${EndIf}
${If} "$1" == "FirefoxHTML"
DeleteRegValue HKLM "Software\Classes\${FILE_TYPE}" ""
${EndIf}
${ElseIf} "$0" == "FirefoxHTML"
; Since KHCU is set to FirefoxHTML remove FirefoxHTML as the default value
; from HKCU if HKLM is set to a value other than an empty string.
${If} "$1" != ""
DeleteRegValue HKCU "Software\Classes\${FILE_TYPE}" ""
${EndIf}
${EndIf}
!macroend
!define FixBadFileAssociation "!insertmacro FixBadFileAssociation"

; Add app specific handler registry entries under Software\Classes if they
; don't exist (does not use SHCTX).
!macro FixClassKeys
Expand All @@ -719,6 +739,14 @@ FunctionEnd
${WriteRegStr2} $TmpVal "$1\.xhtml" "" "xhtmlfile" 0
${WriteRegStr2} $TmpVal "$1\.xhtml" "Content Type" "application/xhtml+xml" 0
${EndIf}

; Remove possibly badly associated file types
${FixBadFileAssociation} ".pdf"
${FixBadFileAssociation} ".oga"
${FixBadFileAssociation} ".ogg"
${FixBadFileAssociation} ".ogv"
${FixBadFileAssociation} ".pdf"
${FixBadFileAssociation} ".webm"
!macroend
!define FixClassKeys "!insertmacro FixClassKeys"

Expand Down
2 changes: 1 addition & 1 deletion build/autoconf/android.m4
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ if test "$OS_TARGET" = "Android" -a -z "$gonkdir"; then
AC_MSG_ERROR([Couldn't find path to gnu-libstdc++ in the android ndk])
fi
else
STLPORT_CPPFLAGS="-isystem $_topsrcdir/build/stlport/stlport -isystem $android_ndk/sources/cxx-stl/system/include"
STLPORT_CPPFLAGS="-isystem $_topsrcdir/build/stlport/stlport -isystem $_topsrcdir/build/stlport/overrides -isystem $android_ndk/sources/cxx-stl/system/include"
STLPORT_LIBS="$_objdir/build/stlport/libstlport_static.a -static-libstdc++"
fi
fi
Expand Down
2 changes: 2 additions & 0 deletions build/stlport/README.mozilla
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
This copy of STLport was taken from the Android NDK r8e.
Android specific changes are listed in README.android.
The libs/ directory containing prebuilt static libraries was removed.
The overrides/ directory contains Mozilla-specific overrides to the standard
C++ headers found in the NDK.

The following patches are applied on top:
- android-mozilla-config.patch: Adjusts Android-specific configuration
Expand Down
65 changes: 65 additions & 0 deletions build/stlport/overrides/new
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* -*- c++ -*- */
/*
* Copyright (C) 2009 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* This header is taken from $ndk/sources/cxx-stl/system/include/new,
* and it fixes a bug in the NDK header where the nothrow versions of
* placement new and delete are not specified with 'throw()'. This bug
* causes GCC to not null-check the results from these functions.
*/
#ifndef __NEW__
#define __NEW__

#include <cstddef>

extern "C++" {

namespace std {
struct nothrow_t {};
extern const nothrow_t nothrow;
}

void* operator new(std::size_t);
void* operator new[](std::size_t);
void operator delete(void*);
void operator delete[](void*);
void* operator new(std::size_t, const std::nothrow_t&) throw();
void* operator new[](std::size_t, const std::nothrow_t&) throw();
void operator delete(void*, const std::nothrow_t&) throw();
void operator delete[](void*, const std::nothrow_t&) throw();

inline void* operator new(std::size_t, void* p) { return p; }
inline void* operator new[](std::size_t, void* p) { return p; }

// these next two are not really required, since exceptions are off
inline void operator delete(void*, void*) { }
inline void operator delete[](void*, void*) { }

} // extern C++

#endif // __NEW__
21 changes: 12 additions & 9 deletions content/base/public/nsDOMFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
#include "nsWrapperCache.h"
#include "nsCycleCollectionParticipant.h"
#include "nsWeakReference.h"

class nsDOMMultipartFile;
class nsIFile;
Expand Down Expand Up @@ -64,6 +65,7 @@ class DOMFile MOZ_FINAL : public nsIDOMFile
, public nsIXHRSendable
, public nsIMutable
, public nsIJSNativeInitializer
, public nsSupportsWeakReference
{
public:
NS_DECL_NSIDOMBLOB
Expand Down Expand Up @@ -190,9 +192,9 @@ class DOMFileImpl : public PIDOMFileImpl
virtual nsresult GetMozLastModifiedDate(uint64_t* aDate) = 0;

nsresult Slice(int64_t aStart, int64_t aEnd, const nsAString& aContentType,
uint8_t aArgc, nsIDOMBlob **aBlob);
uint8_t aArgc, DOMFileImpl** aBlobImpl);

virtual already_AddRefed<nsIDOMBlob>
virtual already_AddRefed<DOMFileImpl>
CreateSlice(uint64_t aStart, uint64_t aLength,
const nsAString& aContentType) = 0;

Expand Down Expand Up @@ -321,7 +323,7 @@ class DOMFileImplBase : public DOMFileImpl

virtual nsresult GetMozLastModifiedDate(uint64_t* aDate) MOZ_OVERRIDE;

virtual already_AddRefed<nsIDOMBlob>
virtual already_AddRefed<DOMFileImpl>
CreateSlice(uint64_t aStart, uint64_t aLength,
const nsAString& aContentType) MOZ_OVERRIDE;

Expand Down Expand Up @@ -464,7 +466,7 @@ class DOMFileImplMemory MOZ_FINAL : public DOMFileImplBase

virtual nsresult GetInternalStream(nsIInputStream** aStream) MOZ_OVERRIDE;

virtual already_AddRefed<nsIDOMBlob>
virtual already_AddRefed<DOMFileImpl>
CreateSlice(uint64_t aStart, uint64_t aLength,
const nsAString& aContentType) MOZ_OVERRIDE;

Expand Down Expand Up @@ -551,7 +553,7 @@ class DOMFileImplTemporaryFileBlob MOZ_FINAL : public DOMFileImplBase

virtual nsresult GetInternalStream(nsIInputStream** aStream) MOZ_OVERRIDE;

virtual already_AddRefed<nsIDOMBlob>
virtual already_AddRefed<DOMFileImpl>
CreateSlice(uint64_t aStart, uint64_t aLength,
const nsAString& aContentType) MOZ_OVERRIDE;

Expand All @@ -573,7 +575,7 @@ class DOMFileImplTemporaryFileBlob MOZ_FINAL : public DOMFileImplBase
nsString mContentType;
};

class DOMFileImplFile MOZ_FINAL : public DOMFileImplBase
class DOMFileImplFile : public DOMFileImplBase
{
public:
NS_DECL_ISUPPORTS_INHERITED
Expand Down Expand Up @@ -690,6 +692,9 @@ class DOMFileImplFile MOZ_FINAL : public DOMFileImplBase

void SetPath(const nsAString& aFullPath);

protected:
virtual ~DOMFileImplFile() {}

private:
// Create slice
DOMFileImplFile(const DOMFileImplFile* aOther, uint64_t aStart,
Expand Down Expand Up @@ -719,9 +724,7 @@ class DOMFileImplFile MOZ_FINAL : public DOMFileImplBase
}
}

~DOMFileImplFile() {}

virtual already_AddRefed<nsIDOMBlob>
virtual already_AddRefed<DOMFileImpl>
CreateSlice(uint64_t aStart, uint64_t aLength,
const nsAString& aContentType) MOZ_OVERRIDE;

Expand Down
41 changes: 37 additions & 4 deletions content/base/src/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,13 @@ Element::CreateShadowRoot(ErrorResult& aError)
SetShadowRoot(shadowRoot);
if (olderShadow) {
olderShadow->SetYoungerShadow(shadowRoot);

// Unbind children of older shadow root because they
// are no longer in the composed tree.
for (nsIContent* child = olderShadow->GetFirstChild(); child;
child = child->GetNextSibling()) {
child->UnbindFromTree(true, false);
}
}

// xblBinding takes ownership of docInfo.
Expand Down Expand Up @@ -1384,6 +1391,18 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
}
}

// Call BindToTree on shadow root children.
ShadowRoot* shadowRoot = GetShadowRoot();
if (shadowRoot) {
for (nsIContent* child = shadowRoot->GetFirstChild(); child;
child = child->GetNextSibling()) {
rv = child->BindToTree(nullptr, shadowRoot,
shadowRoot->GetBindingParent(),
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
}
}

// XXXbz script execution during binding can trigger some of these
// postcondition asserts.... But we do want that, since things will
// generally be quite broken when that happens.
Expand Down Expand Up @@ -1462,10 +1481,13 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
SetParentIsContent(false);
}
ClearInDocument();
UnsetFlags(NODE_IS_IN_SHADOW_TREE);

// Begin keeping track of our subtree root.
SetSubtreeRootPointer(aNullParent ? this : mParent->SubtreeRoot());
if (aNullParent || !mParent->IsInShadowTree()) {
UnsetFlags(NODE_IS_IN_SHADOW_TREE);

// Begin keeping track of our subtree root.
SetSubtreeRootPointer(aNullParent ? this : mParent->SubtreeRoot());
}

if (document) {
// Notify XBL- & nsIAnonymousContentCreator-generated
Expand Down Expand Up @@ -1514,7 +1536,9 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
if (clearBindingParent) {
slots->mBindingParent = nullptr;
}
slots->mContainingShadow = nullptr;
if (aNullParent || !mParent->IsInShadowTree()) {
slots->mContainingShadow = nullptr;
}
}

// This has to be here, rather than in nsGenericHTMLElement::UnbindFromTree,
Expand All @@ -1539,6 +1563,15 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
}

nsNodeUtils::ParentChainChanged(this);

// Unbind children of shadow root.
ShadowRoot* shadowRoot = GetShadowRoot();
if (shadowRoot) {
for (nsIContent* child = shadowRoot->GetFirstChild(); child;
child = child->GetNextSibling()) {
child->UnbindFromTree(true, false);
}
}
}

nsICSSDeclaration*
Expand Down
4 changes: 4 additions & 0 deletions content/base/src/FragmentOrElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,10 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FragmentOrElement)
unbind the child nodes.
} */

// Clear flag here because unlinking slots will clear the
// containing shadow root pointer.
tmp->UnsetFlags(NODE_IS_IN_SHADOW_TREE);

// Unlink any DOM slots of interest.
{
nsDOMSlots *slots = tmp->GetExistingDOMSlots();
Expand Down
Loading

0 comments on commit 0002d53

Please sign in to comment.