diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index b1a576d0a..66f4a8aca 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -9,7 +9,7 @@ */ #include "nsDocument.h" - +#include "nsIDocumentInlines.h" #include "mozilla/ArrayUtils.h" #include "mozilla/AutoRestore.h" #include "mozilla/BinarySearch.h" @@ -10726,6 +10726,54 @@ nsDocument::CaretPositionFromPoint(float aX, float aY, nsISupports** aCaretPos) return NS_OK; } +static bool +IsPotentiallyScrollable(HTMLBodyElement* aBody) +{ + // An element is potentially scrollable if all of the following conditions are + // true: + + // The element has an associated CSS layout box. + nsIFrame* bodyFrame = aBody->GetPrimaryFrame(); + if (!bodyFrame) { + return false; + } + + // The element is not the HTML body element, or it is and the root element's + // used value of the overflow-x or overflow-y properties is not visible. + MOZ_ASSERT(aBody->GetParent() == aBody->OwnerDoc()->GetRootElement()); + nsIFrame* parentFrame = aBody->GetParent()->GetPrimaryFrame(); + if (parentFrame && + parentFrame->StyleDisplay()->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE && + parentFrame->StyleDisplay()->mOverflowY == NS_STYLE_OVERFLOW_VISIBLE) { + return false; + } + + // The element's used value of the overflow-x or overflow-y properties is not + // visible. + if (bodyFrame->StyleDisplay()->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE && + bodyFrame->StyleDisplay()->mOverflowY == NS_STYLE_OVERFLOW_VISIBLE) { + return false; + } + + return true; +} + +Element* +nsIDocument::GetScrollingElement() +{ + if (GetCompatibilityMode() == eCompatibility_NavQuirks) { + FlushPendingNotifications(Flush_Layout); + HTMLBodyElement* body = GetBodyElement(); + if (body && !IsPotentiallyScrollable(body)) { + return body; + } + + return nullptr; + } + + return GetRootElement(); +} + void nsIDocument::ObsoleteSheet(nsIURI *aSheetURI, ErrorResult& rv) { diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h index ecab86e3c..c74f96dbd 100644 --- a/dom/base/nsIDocument.h +++ b/dom/base/nsIDocument.h @@ -2529,6 +2529,8 @@ public: already_AddRefed CaretPositionFromPoint(float aX, float aY); + Element* GetScrollingElement(); + // QuerySelector and QuerySelectorAll already defined on nsINode nsINodeList* GetAnonymousNodes(Element& aElement); Element* GetAnonymousElementByAttribute(Element& aElement, diff --git a/dom/base/nsScriptLoader.cpp b/dom/base/nsScriptLoader.cpp index a89ce9e16..432b4fc33 100644 --- a/dom/base/nsScriptLoader.cpp +++ b/dom/base/nsScriptLoader.cpp @@ -1552,7 +1552,9 @@ nsScriptLoader::PrepareLoadedRequest(nsScriptLoadRequest* aRequest, } nsAutoCString sourceMapURL; - rv = httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("X-SourceMap"), sourceMapURL); + rv = httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("SourceMap"), sourceMapURL); + if (NS_FAILED(rv)) + rv = httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("X-SourceMap"), sourceMapURL); if (NS_SUCCEEDED(rv)) { aRequest->mHasSourceMapURL = true; aRequest->mSourceMapURL = NS_ConvertUTF8toUTF16(sourceMapURL); diff --git a/dom/webidl/Document.webidl b/dom/webidl/Document.webidl index 5c216e977..f78005f3e 100644 --- a/dom/webidl/Document.webidl +++ b/dom/webidl/Document.webidl @@ -280,6 +280,8 @@ partial interface Document { Element? elementFromPoint (float x, float y); CaretPosition? caretPositionFromPoint (float x, float y); + + readonly attribute Element? scrollingElement; }; // http://dvcs.w3.org/hg/undomanager/raw-file/tip/undomanager.html diff --git a/netwerk/protocol/http/Http2Stream.cpp b/netwerk/protocol/http/Http2Stream.cpp index cbde1ddb2..fea9b6155 100644 --- a/netwerk/protocol/http/Http2Stream.cpp +++ b/netwerk/protocol/http/Http2Stream.cpp @@ -576,8 +576,7 @@ Http2Stream::GenerateOpen() firstFrameFlags |= Http2Session::kFlag_END_STREAM; } else if (head->IsPost() || head->IsPut() || - head->IsConnect() || - head->IsOptions()) { + head->IsConnect()) { // place fin in a data frame even for 0 length messages for iterop } else if (!mRequestBodyLenRemaining) { // for other HTTP extension methods, rely on the content-length