mirror of
https://github.com/classilla/tenfourfox.git
synced 2025-02-15 18:31:43 +00:00
#399: implement scrollingElement, fix HTTP/2 options, enable SourceMap header
This commit is contained in:
parent
e085a5b30e
commit
3436d24318
@ -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)
|
||||
{
|
||||
|
@ -2529,6 +2529,8 @@ public:
|
||||
already_AddRefed<nsDOMCaretPosition>
|
||||
CaretPositionFromPoint(float aX, float aY);
|
||||
|
||||
Element* GetScrollingElement();
|
||||
|
||||
// QuerySelector and QuerySelectorAll already defined on nsINode
|
||||
nsINodeList* GetAnonymousNodes(Element& aElement);
|
||||
Element* GetAnonymousElementByAttribute(Element& aElement,
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user