Merge pull request #14 from classilla/master

Keep up with master
This commit is contained in:
Riccardo 2018-09-15 13:02:57 +02:00 committed by GitHub
commit 910f7e3494
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 10095 additions and 2962 deletions

View File

@ -1 +1 @@
45.18.0
45.19.0

View File

@ -1 +1 @@
Feature Parity Release 9
Feature Parity Release 10

View File

@ -10,4 +10,4 @@
# hardcoded milestones in the tree from these two files.
#--------------------------------------------------------
45.18.0
45.19.0

View File

@ -1196,28 +1196,56 @@ Element::GetAttribute(const nsAString& aName, DOMString& aReturn)
}
}
bool
Element::ToggleAttribute(const nsAString& aName,
const Optional<bool>& aForce,
ErrorResult& aError)
{
aError = nsContentUtils::CheckQName(aName, false);
if (aError.Failed()) {
return false;
}
nsAutoString nameToUse;
const nsAttrName* name = InternalGetAttrNameFromQName(aName, &nameToUse);
if (!name) {
if (aForce.WasPassed() && !aForce.Value()) {
return false;
}
nsCOMPtr<nsIAtom> nameAtom = NS_AtomizeMainThread(nameToUse);
if (!nameAtom) {
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
return false;
}
aError = SetAttr(kNameSpaceID_None, nameAtom, EmptyString(), true);
return true;
}
if (aForce.WasPassed() && aForce.Value()) {
return true;
}
// Hold a strong reference here so that the atom or nodeinfo doesn't go
// away during UnsetAttr. If it did UnsetAttr would be left with a
// dangling pointer as argument without knowing it.
nsAttrName tmp(*name);
aError = UnsetAttr(name->NamespaceID(), name->LocalName(), true);
return false;
}
void
Element::SetAttribute(const nsAString& aName,
const nsAString& aValue,
ErrorResult& aError)
{
const nsAttrName* name = InternalGetExistingAttrNameFromQName(aName);
aError = nsContentUtils::CheckQName(aName, false);
if (aError.Failed()) {
return;
}
nsAutoString nameToUse;
const nsAttrName* name = InternalGetAttrNameFromQName(aName, &nameToUse);
if (!name) {
aError = nsContentUtils::CheckQName(aName, false);
if (aError.Failed()) {
return;
}
nsCOMPtr<nsIAtom> nameAtom;
if (IsHTMLElement() && IsInHTMLDocument()) {
nsAutoString lower;
nsContentUtils::ASCIIToLower(aName, lower);
nameAtom = NS_AtomizeMainThread(lower);
}
else {
nameAtom = NS_AtomizeMainThread(aName);
}
nsCOMPtr<nsIAtom> nameAtom = NS_AtomizeMainThread(nameToUse);
if (!nameAtom) {
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
@ -1234,7 +1262,7 @@ Element::SetAttribute(const nsAString& aName,
void
Element::RemoveAttribute(const nsAString& aName, ErrorResult& aError)
{
const nsAttrName* name = InternalGetExistingAttrNameFromQName(aName);
const nsAttrName* name = InternalGetAttrNameFromQName(aName);
if (!name) {
// If there is no canonical nsAttrName for this attribute name, then the
@ -2017,7 +2045,7 @@ Element::FindAttributeDependence(const nsIAtom* aAttribute,
already_AddRefed<mozilla::dom::NodeInfo>
Element::GetExistingAttrNameFromQName(const nsAString& aStr) const
{
const nsAttrName* name = InternalGetExistingAttrNameFromQName(aStr);
const nsAttrName* name = InternalGetAttrNameFromQName(aStr);
if (!name) {
return nullptr;
}
@ -2193,9 +2221,27 @@ Element::SetEventHandler(nsIAtom* aEventName,
//----------------------------------------------------------------------
const nsAttrName*
Element::InternalGetExistingAttrNameFromQName(const nsAString& aStr) const
Element::InternalGetAttrNameFromQName(const nsAString& aStr,
nsAutoString* aNameToUse) const
{
return mAttrsAndChildren.GetExistingAttrNameFromQName(aStr);
MOZ_ASSERT(!aNameToUse || aNameToUse->IsEmpty());
const nsAttrName* val = nullptr;
if (IsHTMLElement() && IsInHTMLDocument()) {
nsAutoString lower;
nsAutoString& outStr = aNameToUse ? *aNameToUse : lower;
nsContentUtils::ASCIIToLower(aStr, outStr);
val = mAttrsAndChildren.GetExistingAttrNameFromQName(outStr);
if (val) {
outStr.Truncate();
}
} else {
val = mAttrsAndChildren.GetExistingAttrNameFromQName(aStr);
if (!val && aNameToUse) {
*aNameToUse = aStr;
}
}
return val;
}
bool

View File

@ -675,6 +675,8 @@ public:
void GetAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsAString& aReturn);
bool ToggleAttribute(const nsAString& aName, const Optional<bool>& aForce,
ErrorResult& aError);
void SetAttribute(const nsAString& aName, const nsAString& aValue,
ErrorResult& aError);
void SetAttributeNS(const nsAString& aNamespaceURI,
@ -688,7 +690,7 @@ public:
ErrorResult& aError);
bool HasAttribute(const nsAString& aName) const
{
return InternalGetExistingAttrNameFromQName(aName) != nullptr;
return InternalGetAttrNameFromQName(aName) != nullptr;
}
bool HasAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName) const;
@ -1281,9 +1283,13 @@ protected:
GetEventListenerManagerForAttr(nsIAtom* aAttrName, bool* aDefer);
/**
* Internal hook for converting an attribute name-string to an atomized name
* Internal hook for converting an attribute name-string to nsAttrName in
* case there is such existing attribute. aNameToUse can be passed to get
* name which was used for looking for the attribute (lowercase in HTML).
*/
virtual const nsAttrName* InternalGetExistingAttrNameFromQName(const nsAString& aStr) const;
const nsAttrName*
InternalGetAttrNameFromQName(const nsAString& aStr,
nsAutoString* aNameToUse = nullptr) const;
nsIFrame* GetStyledFrame();

View File

@ -3274,15 +3274,39 @@ nsIDocument::ElementFromPoint(float aX, float aY)
return ElementFromPointHelper(aX, aY, false, true);
}
void
nsIDocument::ElementsFromPoint(float aX, float aY,
nsTArray<RefPtr<Element>>& aElements)
{
ElementsFromPointHelper(aX, aY, nsIDocument::FLUSH_LAYOUT, aElements);
}
Element*
nsDocument::ElementFromPointHelper(float aX, float aY,
bool aIgnoreRootScrollFrame,
bool aFlushLayout)
{
// As per the the spec, we return null if either coord is negative
if (!aIgnoreRootScrollFrame && (aX < 0 || aY < 0)) {
nsAutoTArray<RefPtr<Element>, 1> elementArray;
ElementsFromPointHelper(aX, aY,
((aIgnoreRootScrollFrame ? nsIDocument::IGNORE_ROOT_SCROLL_FRAME : 0) |
(aFlushLayout ? nsIDocument::FLUSH_LAYOUT : 0) |
nsIDocument::IS_ELEMENT_FROM_POINT),
elementArray);
if (elementArray.IsEmpty()) {
return nullptr;
}
return elementArray[0];
}
void
nsDocument::ElementsFromPointHelper(float aX, float aY,
uint32_t aFlags,
nsTArray<RefPtr<mozilla::dom::Element>>& aElements)
{
// As per the the spec, we return null if either coord is negative
if (!(aFlags & nsIDocument::IGNORE_ROOT_SCROLL_FRAME) && (aX < 0 || aY < 0)) {
return;
}
nscoord x = nsPresContext::CSSPixelsToAppUnits(aX);
nscoord y = nsPresContext::CSSPixelsToAppUnits(aY);
@ -3290,32 +3314,58 @@ nsDocument::ElementFromPointHelper(float aX, float aY,
// Make sure the layout information we get is up-to-date, and
// ensure we get a root frame (for everything but XUL)
if (aFlushLayout)
if (aFlags & nsIDocument::FLUSH_LAYOUT) {
FlushPendingNotifications(Flush_Layout);
}
nsIPresShell *ps = GetShell();
if (!ps) {
return nullptr;
return;
}
nsIFrame *rootFrame = ps->GetRootFrame();
// XUL docs, unlike HTML, have no frame tree until everything's done loading
if (!rootFrame) {
return nullptr; // return null to premature XUL callers as a reminder to wait
return; // return null to premature XUL callers as a reminder to wait
}
nsIFrame *ptFrame = nsLayoutUtils::GetFrameForPoint(rootFrame, pt,
nsTArray<nsIFrame*> outFrames;
// Emulate what GetFrameAtPoint does, since we want all the frames under our
// point.
nsLayoutUtils::GetFramesForArea(rootFrame, nsRect(pt, nsSize(1, 1)), outFrames,
nsLayoutUtils::IGNORE_PAINT_SUPPRESSION | nsLayoutUtils::IGNORE_CROSS_DOC |
(aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0));
if (!ptFrame) {
return nullptr;
((aFlags & nsIDocument::IGNORE_ROOT_SCROLL_FRAME) ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0));
// Dunno when this would ever happen, as we should at least have a root frame under us?
if (outFrames.IsEmpty()) {
return;
}
nsIContent* elem = GetContentInThisDocument(ptFrame);
if (elem && !elem->IsElement()) {
elem = elem->GetParent();
// Used to filter out repeated elements in sequence.
nsIContent* lastAdded = nullptr;
for (uint32_t i = 0; i < outFrames.Length(); i++) {
nsIContent* node = GetContentInThisDocument(outFrames[i]);
if (!node || !node->IsElement()) {
// If this helper is called via ElementsFromPoint, we need to make sure
// our frame is an element. Otherwise return whatever the top frame is
// even if it isn't the top-painted element.
if (!(aFlags & nsIDocument::IS_ELEMENT_FROM_POINT)) {
continue;
}
node = node->GetParent();
}
if (node && node != lastAdded) {
aElements.AppendElement(node->AsElement());
lastAdded = node;
// If this helper is called via ElementFromPoint, just return the first
// element we find.
if (aFlags & nsIDocument::IS_ELEMENT_FROM_POINT) {
return;
}
}
}
return elem ? elem->AsElement() : nullptr;
}
nsresult

View File

@ -1029,8 +1029,12 @@ public:
const nsAString& aAttrValue) const override;
virtual Element* ElementFromPointHelper(float aX, float aY,
bool aIgnoreRootScrollFrame,
bool aFlushLayout) override;
bool aIgnoreRootScrollFrame,
bool aFlushLayout) override;
virtual void ElementsFromPointHelper(float aX, float aY,
uint32_t aFlags,
nsTArray<RefPtr<mozilla::dom::Element>>& aElements) override;
virtual nsresult NodesFromRectHelper(float aX, float aY,
float aTopSize, float aRightSize,

View File

@ -1672,6 +1672,16 @@ public:
bool aIgnoreRootScrollFrame,
bool aFlushLayout) = 0;
enum ElementsFromPointFlags {
IGNORE_ROOT_SCROLL_FRAME = 1,
FLUSH_LAYOUT = 2,
IS_ELEMENT_FROM_POINT = 4
};
virtual void ElementsFromPointHelper(float aX, float aY,
uint32_t aFlags,
nsTArray<RefPtr<mozilla::dom::Element>>& aElements) = 0;
virtual nsresult NodesFromRectHelper(float aX, float aY,
float aTopSize, float aRightSize,
float aBottomSize, float aLeftSize,
@ -2531,6 +2541,9 @@ public:
virtual mozilla::dom::DOMStringList* StyleSheetSets() = 0;
virtual void EnableStyleSheetsForSet(const nsAString& aSheetSet) = 0;
Element* ElementFromPoint(float aX, float aY);
void ElementsFromPoint(float aX,
float aY,
nsTArray<RefPtr<mozilla::dom::Element>>& aElements);
/**
* Retrieve the location of the caret position (DOM node and character

View File

@ -2857,18 +2857,6 @@ nsGenericHTMLElement::PerformAccesskey(bool aKeyCausesActivation,
return focused;
}
const nsAttrName*
nsGenericHTMLElement::InternalGetExistingAttrNameFromQName(const nsAString& aStr) const
{
if (IsInHTMLDocument()) {
nsAutoString lower;
nsContentUtils::ASCIIToLower(aStr, lower);
return mAttrsAndChildren.GetExistingAttrNameFromQName(lower);
}
return mAttrsAndChildren.GetExistingAttrNameFromQName(aStr);
}
nsresult
nsGenericHTMLElement::GetEditor(nsIEditor** aEditor)
{

View File

@ -1025,8 +1025,6 @@ protected:
GetEventListenerManagerForAttr(nsIAtom* aAttrName,
bool* aDefer) override;
virtual const nsAttrName* InternalGetExistingAttrNameFromQName(const nsAString& aStr) const override;
/**
* Create a URI for the given aURISpec string.
* Returns INVALID_STATE_ERR and nulls *aURI if aURISpec is empty

View File

@ -278,7 +278,7 @@ partial interface Document {
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-document-interface
partial interface Document {
Element? elementFromPoint (float x, float y);
sequence<Element> elementsFromPoint (float x, float y);
CaretPosition? caretPositionFromPoint (float x, float y);
readonly attribute Element? scrollingElement;

View File

@ -42,6 +42,8 @@ interface Element : Node {
[Pure]
DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
[Throws]
boolean toggleAttribute(DOMString name, optional boolean force);
[Throws]
void setAttribute(DOMString name, DOMString value);
[Throws]
void setAttributeNS(DOMString? namespace, DOMString name, DOMString value);

View File

@ -17,6 +17,8 @@ interface Event {
readonly attribute DOMString type;
[Pure]
readonly attribute EventTarget? target;
[Pure, BinaryName="target"]
readonly attribute EventTarget? srcElement;
[Pure]
readonly attribute EventTarget? currentTarget;

View File

@ -308,6 +308,7 @@ BackgroundChildImpl::DeallocPCamerasChild(camera::PCamerasChild *aActor)
RefPtr<camera::CamerasChild> child =
dont_AddRef(static_cast<camera::CamerasChild*>(aActor));
MOZ_ASSERT(aActor);
camera::Shutdown();
#endif
return true;
}

View File

@ -428,6 +428,8 @@ nsNumberControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
nsContentUtils::AddScriptRunner(focusJob);
}
SyncDisabledState(); // Sync disabled state of 'mTextField'.
if (StyleDisplay()->mAppearance == NS_THEME_TEXTFIELD) {
// The author has elected to hide the spinner by setting this
// -moz-appearance. We will reframe if it changes.
@ -459,8 +461,6 @@ nsNumberControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
nsCSSPseudoElements::ePseudo_mozNumberSpinDown,
spinBoxCI.mStyleContext);
SyncDisabledState();
return rv;
}

View File

@ -509,10 +509,16 @@ BackgroundFileSaver::ProcessStateChange()
NS_ENSURE_SUCCESS(rv, rv);
}
// Now we can update the actual target file name.
mActualTarget = renamedTarget;
mActualTargetKeepPartial = renamedTargetKeepPartial;
// We should not only update the mActualTarget with renameTarget when
// they point to the different files.
// In this way, if mActualTarget and renamedTarget point to the same file
// with different addresses, "CheckCompletion()" will return false forever.
}
// Update mActualTarget with renameTarget,
// even if they point to the same file.
mActualTarget = renamedTarget;
mActualTargetKeepPartial = renamedTargetKeepPartial;
}
// Notify if the target file name actually changed.

View File

@ -143,6 +143,10 @@ static const char kGOOGLE_PIN_Entrust_SSLFingerprint[] =
static const char kGOOGLE_PIN_GTECyberTrustGlobalRootFingerprint[] =
"EGn6R6CqT4z3ERscrqNl7q7RC//zJmDe9uBhS/rnCHU=";
/* GOOGLE_PIN_GTSCA1O1 */
static const char kGOOGLE_PIN_GTSCA1O1Fingerprint[] =
"YZPgTZ+woNCCCIW3LH2CxQeLzB/1m42QcCTBSdgayjs=";
/* GOOGLE_PIN_GeoTrustGlobal2 */
static const char kGOOGLE_PIN_GeoTrustGlobal2Fingerprint[] =
"F3VaXClfPS1y5vAxofB/QAxYi55YKyLxfq4xoVkNEYU=";
@ -155,6 +159,10 @@ static const char kGOOGLE_PIN_GoDaddySecureFingerprint[] =
static const char kGOOGLE_PIN_GoogleG2Fingerprint[] =
"7HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=";
/* GOOGLE_PIN_GoogleG3 */
static const char kGOOGLE_PIN_GoogleG3Fingerprint[] =
"f8NnEFZxQ4ExFOhSN7EiFWtiudZQVD2oY60uauV/n78=";
/* GOOGLE_PIN_RapidSSL */
static const char kGOOGLE_PIN_RapidSSLFingerprint[] =
"lT09gPUeQfbYrlxRtpsHrjDblj9Rpz+u7ajfCrg4qDM=";
@ -461,7 +469,8 @@ static const StaticFingerprints kPinset_test = {
static const char* const kPinset_google_Data[] = {
kGOOGLE_PIN_GoogleG2Fingerprint,
kGoogleBackup2048Fingerprint,
kGeoTrust_Global_CAFingerprint,
kGOOGLE_PIN_GTSCA1O1Fingerprint,
kGOOGLE_PIN_GoogleG3Fingerprint,
kGlobalSign_Root_CA___R2Fingerprint,
};
static const StaticFingerprints kPinset_google = {
@ -1165,4 +1174,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
static const int32_t kUnknownId = -1;
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1539869141315000);
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1544124515242000);

File diff suppressed because it is too large Load Diff

View File

@ -3326,7 +3326,7 @@ Checker.prototype = {
getCharPref(PREF_APP_UPDATE_URL);
*/
// We do not want to corrupt Firefox 3.6's prefs, so this is hard-coded.
url = "http://www.floodgap.com/software/tenfourfox/updatefpr.xml?ver="
url = "https://www.floodgap.com/software/tenfourfox/updatefpr.xml?ver="
+ Services.appinfo.version+"_"+Services.appinfo.buildInfoTenFourFox;
} catch (e) {