#399: M1249913 M1310403 M1260515

This commit is contained in:
Cameron Kaiser 2017-12-17 15:32:39 -08:00
parent 82f1d5895c
commit fbde989ca7
4 changed files with 9 additions and 80 deletions

View File

@ -1584,15 +1584,11 @@ nsXMLHttpRequest::Open(const nsACString& inMethod, const nsACString& url,
return rv;
}
// sync request is not allowed using withCredential or responseType
// sync request is not allowed to use responseType or timeout
// in window context
if (!async && HasOrHasHadOwner() &&
(mState & XML_HTTP_REQUEST_AC_WITH_CREDENTIALS ||
mTimeoutMilliseconds ||
(mTimeoutMilliseconds ||
mResponseType != XML_HTTP_RESPONSE_TYPE_DEFAULT)) {
if (mState & XML_HTTP_REQUEST_AC_WITH_CREDENTIALS) {
LogMessage("WithCredentialsSyncXHRWarning", GetOwner());
}
if (mTimeoutMilliseconds) {
LogMessage("TimeoutSyncXHRWarning", GetOwner());
}
@ -3262,14 +3258,6 @@ nsXMLHttpRequest::SetWithCredentials(bool aWithCredentials, ErrorResult& aRv)
return;
}
// sync request is not allowed setting withCredentials in window context
if (HasOrHasHadOwner() &&
!(mState & (XML_HTTP_REQUEST_UNSENT | XML_HTTP_REQUEST_ASYNC))) {
LogMessage("WithCredentialsSyncXHRWarning", GetOwner());
aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
return;
}
if (aWithCredentials) {
mState |= XML_HTTP_REQUEST_AC_WITH_CREDENTIALS;
} else {

View File

@ -311,69 +311,6 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
}
break;
case eMouseDown:
{
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (mouseEvent->button == WidgetMouseEvent::eLeftButton) {
if (mouseEvent->mFlags.mIsTrusted) {
EventStateManager* esm =
aVisitor.mPresContext->EventStateManager();
EventStateManager::SetActiveManager(
static_cast<EventStateManager*>(esm), this);
}
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm) {
uint32_t flags = nsIFocusManager::FLAG_BYMOUSE |
nsIFocusManager::FLAG_NOSCROLL;
// If this was a touch-generated event, pass that information:
if (mouseEvent->inputSource == nsIDOMMouseEvent::MOZ_SOURCE_TOUCH) {
flags |= nsIFocusManager::FLAG_BYTOUCH;
}
fm->SetFocus(this, flags);
}
mouseEvent->mFlags.mMultipleActionsPrevented = true;
} else if (mouseEvent->button == WidgetMouseEvent::eMiddleButton ||
mouseEvent->button == WidgetMouseEvent::eRightButton) {
// cancel all of these events for buttons
//XXXsmaug What to do with these events? Why these should be cancelled?
if (aVisitor.mDOMEvent) {
aVisitor.mDOMEvent->StopPropagation();
}
}
}
break;
// cancel all of these events for buttons
//XXXsmaug What to do with these events? Why these should be cancelled?
case eMouseUp:
case eMouseDoubleClick:
{
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (aVisitor.mDOMEvent &&
(mouseEvent->button == WidgetMouseEvent::eMiddleButton ||
mouseEvent->button == WidgetMouseEvent::eRightButton)) {
aVisitor.mDOMEvent->StopPropagation();
}
}
break;
case eMouseOver:
{
aVisitor.mPresContext->EventStateManager()->
SetContentState(this, NS_EVENT_STATE_HOVER);
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
}
break;
// XXX this doesn't seem to do anything yet
case eMouseOut:
{
aVisitor.mPresContext->EventStateManager()->
SetContentState(nullptr, NS_EVENT_STATE_HOVER);
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
}
break;
default:
break;
}

View File

@ -755,10 +755,13 @@ nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
} else {
MOZ_ASSERT(joinedBorderArea.IsEqualEdges(aBorderArea),
"Should use aBorderArea for box-decoration-break:clone");
MOZ_ASSERT(aForFrame->GetSkipSides().IsEmpty(),
MOZ_ASSERT(aForFrame->GetSkipSides().IsEmpty() ||
IS_TRUE_OVERFLOW_CONTAINER(aForFrame),
"Should not skip sides for box-decoration-break:clone except "
"::first-letter/line continuations or other frame types that "
"don't have borders but those shouldn't reach this point.");
"don't have borders but those shouldn't reach this point. "
"Overflow containers do reach this point though.");
border.ApplySkipSides(aSkipSides);
}
// Convert to dev pixels.

View File

@ -1011,7 +1011,8 @@ nsIFrame::Sides
nsIFrame::GetSkipSides(const nsHTMLReflowState* aReflowState) const
{
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
NS_STYLE_BOX_DECORATION_BREAK_CLONE) &&
!(GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)) {
return Sides();
}