mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-25 08:37:30 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
f4d2bf6c3d
32 changed files with 149 additions and 374 deletions
|
|
@ -9359,6 +9359,12 @@ private:
|
||||||
case 0x00A0:
|
case 0x00A0:
|
||||||
aOut.AppendLiteral(" ");
|
aOut.AppendLiteral(" ");
|
||||||
break;
|
break;
|
||||||
|
case '<':
|
||||||
|
aOut.AppendLiteral("<");
|
||||||
|
break;
|
||||||
|
case '>':
|
||||||
|
aOut.AppendLiteral(">");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
aOut.Append(*c);
|
aOut.Append(*c);
|
||||||
break;
|
break;
|
||||||
|
|
@ -9500,6 +9506,12 @@ AppendEncodedAttributeValue(nsAutoString* aValue, StringBuilder& aBuilder)
|
||||||
case 0x00A0:
|
case 0x00A0:
|
||||||
extraSpaceNeeded += ArrayLength(" ") - 2;
|
extraSpaceNeeded += ArrayLength(" ") - 2;
|
||||||
break;
|
break;
|
||||||
|
case '<':
|
||||||
|
extraSpaceNeeded += ArrayLength("<") - 2;
|
||||||
|
break;
|
||||||
|
case '>':
|
||||||
|
extraSpaceNeeded += ArrayLength(">") - 2;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1546,26 +1546,22 @@ nsObjectLoadingContent::MaybeRewriteYoutubeEmbed(nsIURI* aURI, nsIURI* aBaseURI,
|
||||||
}
|
}
|
||||||
|
|
||||||
// See if requester is planning on using the JS API.
|
// See if requester is planning on using the JS API.
|
||||||
nsAutoCString uri;
|
nsAutoCString prePath;
|
||||||
nsresult rv = aURI->GetSpec(uri);
|
nsresult rv = aURI->GetPrePath(prePath);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uri.Find("enablejsapi=1", true, 0, -1) != kNotFound) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Some YouTube urls have parameters in path components, e.g.
|
// Some YouTube urls have parameters in path components, e.g.
|
||||||
// http://youtube.com/embed/7LcUOEP7Brc&start=35. These URLs work with flash,
|
// http://youtube.com/embed/7LcUOEP7Brc&start=35. These URLs work with flash,
|
||||||
// but break iframe/object embedding. If this situation occurs with rewritten
|
// but break iframe/object embedding. If this situation occurs with rewritten
|
||||||
// URLs, convert the parameters to query in order to make the video load
|
// URLs, convert the parameters to query in order to make the video load
|
||||||
// correctly as an iframe. In either case, warn about it in the
|
// correctly as an iframe. In either case, warn about it in the
|
||||||
// developer console.
|
// developer console.
|
||||||
int32_t ampIndex = uri.FindChar('&', 0);
|
int32_t ampIndex = path.FindChar('&', 0);
|
||||||
bool replaceQuery = false;
|
bool replaceQuery = false;
|
||||||
if (ampIndex != -1) {
|
if (ampIndex != -1) {
|
||||||
int32_t qmIndex = uri.FindChar('?', 0);
|
int32_t qmIndex = path.FindChar('?', 0);
|
||||||
if (qmIndex == -1 ||
|
if (qmIndex == -1 ||
|
||||||
qmIndex > ampIndex) {
|
qmIndex > ampIndex) {
|
||||||
replaceQuery = true;
|
replaceQuery = true;
|
||||||
|
|
@ -1576,20 +1572,22 @@ nsObjectLoadingContent::MaybeRewriteYoutubeEmbed(nsIURI* aURI, nsIURI* aBaseURI,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoString utf16OldURI = NS_ConvertUTF8toUTF16(uri);
|
NS_ConvertUTF8toUTF16 utf16OldURI(prePath);
|
||||||
|
AppendUTF8toUTF16(path, utf16OldURI);
|
||||||
// If we need to convert the URL, it means an ampersand comes first.
|
// If we need to convert the URL, it means an ampersand comes first.
|
||||||
// Use the index we found earlier.
|
// Use the index we found earlier.
|
||||||
if (replaceQuery) {
|
if (replaceQuery) {
|
||||||
// Replace question marks with ampersands.
|
// Replace question marks with ampersands.
|
||||||
uri.ReplaceChar('?', '&');
|
path.ReplaceChar('?', '&');
|
||||||
// Replace the first ampersand with a question mark.
|
// Replace the first ampersand with a question mark.
|
||||||
uri.SetCharAt('?', ampIndex);
|
path.SetCharAt('?', ampIndex);
|
||||||
}
|
}
|
||||||
// Switch out video access url formats, which should possibly allow HTML5
|
// Switch out video access url formats, which should possibly allow HTML5
|
||||||
// video loading.
|
// video loading.
|
||||||
uri.ReplaceSubstring(NS_LITERAL_CSTRING("/v/"),
|
path.ReplaceSubstring(NS_LITERAL_CSTRING("/v/"),
|
||||||
NS_LITERAL_CSTRING("/embed/"));
|
NS_LITERAL_CSTRING("/embed/"));
|
||||||
nsAutoString utf16URI = NS_ConvertUTF8toUTF16(uri);
|
NS_ConvertUTF8toUTF16 utf16URI(prePath);
|
||||||
|
AppendUTF8toUTF16(path, utf16URI);
|
||||||
rv = nsContentUtils::NewURIWithDocumentCharset(aOutURI,
|
rv = nsContentUtils::NewURIWithDocumentCharset(aOutURI,
|
||||||
utf16URI,
|
utf16URI,
|
||||||
thisContent->OwnerDoc(),
|
thisContent->OwnerDoc(),
|
||||||
|
|
|
||||||
|
|
@ -572,12 +572,12 @@ class nsObjectLoadingContent : public nsImageLoadingContent
|
||||||
*
|
*
|
||||||
* - is an embed or object node
|
* - is an embed or object node
|
||||||
* - has a URL pointing at the youtube.com domain, using "/v/" style video
|
* - has a URL pointing at the youtube.com domain, using "/v/" style video
|
||||||
* path reference, and without enablejsapi=1 in the path
|
* path reference.
|
||||||
*
|
*
|
||||||
* Having the enablejsapi flag means the document that contains the element
|
* Having the enablejsapi flag means the document that contains the element
|
||||||
* could possibly be manipulating the youtube video elsewhere on the page
|
* could possibly be manipulating the youtube video elsewhere on the page
|
||||||
* via javascript. We can't rewrite these kinds of elements without possibly
|
* via javascript. In the context of embed elements, this usage has been
|
||||||
* breaking content, which we want to avoid.
|
* deprecated by youtube, so we can just rewrite as normal.
|
||||||
*
|
*
|
||||||
* If we can rewrite the URL, we change the "/v/" to "/embed/", and change
|
* If we can rewrite the URL, we change the "/v/" to "/embed/", and change
|
||||||
* our type to eType_Document so that we render similarly to an iframe
|
* our type to eType_Document so that we render similarly to an iframe
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@
|
||||||
#include "mozilla/dom/ScrollAreaEvent.h"
|
#include "mozilla/dom/ScrollAreaEvent.h"
|
||||||
#include "mozilla/dom/SimpleGestureEvent.h"
|
#include "mozilla/dom/SimpleGestureEvent.h"
|
||||||
#include "mozilla/dom/StorageEvent.h"
|
#include "mozilla/dom/StorageEvent.h"
|
||||||
#include "mozilla/dom/SVGZoomEvent.h"
|
|
||||||
#include "mozilla/dom/TimeEvent.h"
|
#include "mozilla/dom/TimeEvent.h"
|
||||||
#include "mozilla/dom/TouchEvent.h"
|
#include "mozilla/dom/TouchEvent.h"
|
||||||
#include "mozilla/dom/TransitionEvent.h"
|
#include "mozilla/dom/TransitionEvent.h"
|
||||||
|
|
@ -1047,9 +1046,6 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
|
||||||
case eClipboardEventClass:
|
case eClipboardEventClass:
|
||||||
return NS_NewDOMClipboardEvent(aOwner, aPresContext,
|
return NS_NewDOMClipboardEvent(aOwner, aPresContext,
|
||||||
aEvent->AsClipboardEvent());
|
aEvent->AsClipboardEvent());
|
||||||
case eSVGZoomEventClass:
|
|
||||||
return NS_NewDOMSVGZoomEvent(aOwner, aPresContext,
|
|
||||||
aEvent->AsSVGZoomEvent());
|
|
||||||
case eSMILTimeEventClass:
|
case eSMILTimeEventClass:
|
||||||
return NS_NewDOMTimeEvent(aOwner, aPresContext,
|
return NS_NewDOMTimeEvent(aOwner, aPresContext,
|
||||||
aEvent->AsSMILTimeEvent());
|
aEvent->AsSMILTimeEvent());
|
||||||
|
|
@ -1148,12 +1144,6 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
|
||||||
if (aEventType.LowerCaseEqualsLiteral("svgevents")) {
|
if (aEventType.LowerCaseEqualsLiteral("svgevents")) {
|
||||||
return NS_NewDOMEvent(aOwner, aPresContext, nullptr);
|
return NS_NewDOMEvent(aOwner, aPresContext, nullptr);
|
||||||
}
|
}
|
||||||
if (aEventType.LowerCaseEqualsLiteral("svgzoomevent")) {
|
|
||||||
return NS_NewDOMSVGZoomEvent(aOwner, aPresContext, nullptr);
|
|
||||||
}
|
|
||||||
if (aEventType.LowerCaseEqualsLiteral("svgzoomevents")) {
|
|
||||||
return NS_NewDOMSVGZoomEvent(aOwner, aPresContext, nullptr);
|
|
||||||
}
|
|
||||||
if (aEventType.LowerCaseEqualsLiteral("timeevent")) {
|
if (aEventType.LowerCaseEqualsLiteral("timeevent")) {
|
||||||
return NS_NewDOMTimeEvent(aOwner, aPresContext, nullptr);
|
return NS_NewDOMTimeEvent(aOwner, aPresContext, nullptr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -825,19 +825,6 @@ NON_IDL_EVENT(SVGScroll,
|
||||||
EventNameType_None,
|
EventNameType_None,
|
||||||
eBasicEventClass)
|
eBasicEventClass)
|
||||||
|
|
||||||
NON_IDL_EVENT(SVGZoom,
|
|
||||||
eSVGZoom,
|
|
||||||
EventNameType_None,
|
|
||||||
eSVGZoomEventClass)
|
|
||||||
|
|
||||||
// Only map the ID to the real event name when MESSAGE_TO_EVENT is defined.
|
|
||||||
#ifndef MESSAGE_TO_EVENT
|
|
||||||
// This is a bit hackish, but SVG's event names are weird.
|
|
||||||
NON_IDL_EVENT(zoom,
|
|
||||||
eSVGZoom,
|
|
||||||
EventNameType_SVGSVG,
|
|
||||||
eBasicEventClass)
|
|
||||||
#endif
|
|
||||||
// Only map the ID to the real event name when MESSAGE_TO_EVENT is defined.
|
// Only map the ID to the real event name when MESSAGE_TO_EVENT is defined.
|
||||||
#ifndef MESSAGE_TO_EVENT
|
#ifndef MESSAGE_TO_EVENT
|
||||||
NON_IDL_EVENT(begin,
|
NON_IDL_EVENT(begin,
|
||||||
|
|
|
||||||
|
|
@ -401,13 +401,6 @@ const kEventConstructors = {
|
||||||
},
|
},
|
||||||
chromeOnly: true,
|
chromeOnly: true,
|
||||||
},
|
},
|
||||||
SVGZoomEvent: { create: function (aName, aProps) {
|
|
||||||
var e = document.createEvent("svgzoomevent");
|
|
||||||
e.initUIEvent(aName, aProps.bubbles, aProps.cancelable,
|
|
||||||
aProps.view, aProps.detail);
|
|
||||||
return e;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
TCPSocketErrorEvent: { create: function(aName, aProps) {
|
TCPSocketErrorEvent: { create: function(aName, aProps) {
|
||||||
return new TCPSocketErrorEvent(aName, aProps);
|
return new TCPSocketErrorEvent(aName, aProps);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -474,7 +474,7 @@ SVGSVGElement::SetZoomAndPan(uint16_t aZoomAndPan, ErrorResult& rv)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// helper methods for implementing SVGZoomEvent:
|
// helper methods for implementing SetCurrentScale/Translate
|
||||||
|
|
||||||
void
|
void
|
||||||
SVGSVGElement::SetCurrentScaleTranslate(float s, float x, float y)
|
SVGSVGElement::SetCurrentScaleTranslate(float s, float x, float y)
|
||||||
|
|
@ -498,6 +498,8 @@ SVGSVGElement::SetCurrentScaleTranslate(float s, float x, float y)
|
||||||
// change that caused the event's dispatch, which is *not* necessarily the
|
// change that caused the event's dispatch, which is *not* necessarily the
|
||||||
// same thing as the values of currentScale and currentTranslate prior to
|
// same thing as the values of currentScale and currentTranslate prior to
|
||||||
// their own last change.
|
// their own last change.
|
||||||
|
//
|
||||||
|
// TODO: simplify some of this code since SVGZoomEvent was removed.
|
||||||
mPreviousScale = mCurrentScale;
|
mPreviousScale = mCurrentScale;
|
||||||
mPreviousTranslate = mCurrentTranslate;
|
mPreviousTranslate = mCurrentTranslate;
|
||||||
|
|
||||||
|
|
@ -510,10 +512,7 @@ SVGSVGElement::SetCurrentScaleTranslate(float s, float x, float y)
|
||||||
nsCOMPtr<nsIPresShell> presShell = doc->GetShell();
|
nsCOMPtr<nsIPresShell> presShell = doc->GetShell();
|
||||||
if (presShell && IsRoot()) {
|
if (presShell && IsRoot()) {
|
||||||
nsEventStatus status = nsEventStatus_eIgnore;
|
nsEventStatus status = nsEventStatus_eIgnore;
|
||||||
if (mPreviousScale != mCurrentScale) {
|
if (mPreviousScale == mCurrentScale) {
|
||||||
InternalSVGZoomEvent svgZoomEvent(true, eSVGZoom);
|
|
||||||
presShell->HandleDOMEventWithTarget(this, &svgZoomEvent, &status);
|
|
||||||
} else {
|
|
||||||
WidgetEvent svgScrollEvent(true, eSVGScroll);
|
WidgetEvent svgScrollEvent(true, eSVGScroll);
|
||||||
presShell->HandleDOMEventWithTarget(this, &svgScrollEvent, &status);
|
presShell->HandleDOMEventWithTarget(this, &svgScrollEvent, &status);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,8 @@ public:
|
||||||
* For use by zoom controls to allow currentScale, currentTranslate.x and
|
* For use by zoom controls to allow currentScale, currentTranslate.x and
|
||||||
* currentTranslate.y to be set by a single operation that dispatches a
|
* currentTranslate.y to be set by a single operation that dispatches a
|
||||||
* single SVGZoom event (instead of one SVGZoom and two SVGScroll events).
|
* single SVGZoom event (instead of one SVGZoom and two SVGScroll events).
|
||||||
|
*
|
||||||
|
* XXX SVGZoomEvent was removed; is this still needed?
|
||||||
*/
|
*/
|
||||||
void SetCurrentScaleTranslate(float s, float x, float y);
|
void SetCurrentScaleTranslate(float s, float x, float y);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,102 +0,0 @@
|
||||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#include "DOMSVGPoint.h"
|
|
||||||
#include "mozilla/ContentEvents.h"
|
|
||||||
#include "mozilla/dom/Element.h"
|
|
||||||
#include "mozilla/dom/SVGSVGElement.h"
|
|
||||||
#include "mozilla/dom/SVGZoomEvent.h"
|
|
||||||
#include "nsIDocument.h"
|
|
||||||
#include "nsIPresShell.h"
|
|
||||||
#include "prtime.h"
|
|
||||||
|
|
||||||
namespace mozilla {
|
|
||||||
namespace dom {
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
// Implementation
|
|
||||||
|
|
||||||
NS_IMPL_CYCLE_COLLECTION_INHERITED(SVGZoomEvent, UIEvent, mPreviousTranslate, mNewTranslate)
|
|
||||||
|
|
||||||
NS_IMPL_ADDREF_INHERITED(SVGZoomEvent, UIEvent)
|
|
||||||
NS_IMPL_RELEASE_INHERITED(SVGZoomEvent, UIEvent)
|
|
||||||
|
|
||||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGZoomEvent)
|
|
||||||
NS_INTERFACE_MAP_END_INHERITING(UIEvent)
|
|
||||||
|
|
||||||
SVGZoomEvent::SVGZoomEvent(EventTarget* aOwner,
|
|
||||||
nsPresContext* aPresContext,
|
|
||||||
InternalSVGZoomEvent* aEvent)
|
|
||||||
: UIEvent(aOwner, aPresContext,
|
|
||||||
aEvent ? aEvent : new InternalSVGZoomEvent(false, eSVGZoom))
|
|
||||||
, mPreviousScale(0)
|
|
||||||
, mNewScale(0)
|
|
||||||
{
|
|
||||||
if (aEvent) {
|
|
||||||
mEventIsInternal = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
mEventIsInternal = true;
|
|
||||||
mEvent->mTime = PR_Now();
|
|
||||||
}
|
|
||||||
|
|
||||||
// We must store the "Previous" and "New" values before this event is
|
|
||||||
// dispatched. Reading the values from the root 'svg' element after we've
|
|
||||||
// been dispatched is not an option since event handler code may change
|
|
||||||
// currentScale and currentTranslate in response to this event.
|
|
||||||
nsIPresShell *presShell;
|
|
||||||
if (mPresContext && (presShell = mPresContext->GetPresShell())) {
|
|
||||||
nsIDocument *doc = presShell->GetDocument();
|
|
||||||
if (doc) {
|
|
||||||
Element *rootElement = doc->GetRootElement();
|
|
||||||
if (rootElement) {
|
|
||||||
// If the root element isn't an SVG 'svg' element
|
|
||||||
// (e.g. if this event was created by calling createEvent on a
|
|
||||||
// non-SVGDocument), then the "New" and "Previous"
|
|
||||||
// properties will be left null which is probably what we want.
|
|
||||||
if (rootElement->IsSVGElement(nsGkAtoms::svg)) {
|
|
||||||
SVGSVGElement *SVGSVGElem =
|
|
||||||
static_cast<SVGSVGElement*>(rootElement);
|
|
||||||
|
|
||||||
mNewScale = SVGSVGElem->GetCurrentScale();
|
|
||||||
mPreviousScale = SVGSVGElem->GetPreviousScale();
|
|
||||||
|
|
||||||
const SVGPoint& translate = SVGSVGElem->GetCurrentTranslate();
|
|
||||||
mNewTranslate =
|
|
||||||
new DOMSVGPoint(translate.GetX(), translate.GetY());
|
|
||||||
mNewTranslate->SetReadonly(true);
|
|
||||||
|
|
||||||
const SVGPoint& prevTranslate = SVGSVGElem->GetPreviousTranslate();
|
|
||||||
mPreviousTranslate =
|
|
||||||
new DOMSVGPoint(prevTranslate.GetX(), prevTranslate.GetY());
|
|
||||||
mPreviousTranslate->SetReadonly(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SVGZoomEvent::~SVGZoomEvent()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace dom
|
|
||||||
} // namespace mozilla
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
|
||||||
// Exported creation functions:
|
|
||||||
|
|
||||||
using namespace mozilla;
|
|
||||||
using namespace mozilla::dom;
|
|
||||||
|
|
||||||
already_AddRefed<SVGZoomEvent>
|
|
||||||
NS_NewDOMSVGZoomEvent(EventTarget* aOwner,
|
|
||||||
nsPresContext* aPresContext,
|
|
||||||
mozilla::InternalSVGZoomEvent* aEvent)
|
|
||||||
{
|
|
||||||
RefPtr<SVGZoomEvent> it = new SVGZoomEvent(aOwner, aPresContext, aEvent);
|
|
||||||
return it.forget();
|
|
||||||
}
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#ifndef mozilla_dom_SVGZoomEvent_h
|
|
||||||
#define mozilla_dom_SVGZoomEvent_h
|
|
||||||
|
|
||||||
#include "DOMSVGPoint.h"
|
|
||||||
#include "mozilla/dom/UIEvent.h"
|
|
||||||
#include "mozilla/dom/SVGZoomEventBinding.h"
|
|
||||||
#include "mozilla/EventForwards.h"
|
|
||||||
|
|
||||||
class nsPresContext;
|
|
||||||
|
|
||||||
namespace mozilla {
|
|
||||||
|
|
||||||
class nsISVGPoint;
|
|
||||||
|
|
||||||
namespace dom {
|
|
||||||
|
|
||||||
class SVGZoomEvent final : public UIEvent
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(SVGZoomEvent, UIEvent)
|
|
||||||
NS_DECL_ISUPPORTS_INHERITED
|
|
||||||
|
|
||||||
SVGZoomEvent(EventTarget* aOwner, nsPresContext* aPresContext,
|
|
||||||
InternalSVGZoomEvent* aEvent);
|
|
||||||
|
|
||||||
// Forward to base class
|
|
||||||
NS_FORWARD_TO_UIEVENT
|
|
||||||
|
|
||||||
virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
|
|
||||||
{
|
|
||||||
return SVGZoomEventBinding::Wrap(aCx, this, aGivenProto);
|
|
||||||
}
|
|
||||||
|
|
||||||
float PreviousScale() const
|
|
||||||
{
|
|
||||||
return mPreviousScale;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsISVGPoint* GetPreviousTranslate() const
|
|
||||||
{
|
|
||||||
return mPreviousTranslate;
|
|
||||||
}
|
|
||||||
|
|
||||||
float NewScale() const
|
|
||||||
{
|
|
||||||
return mNewScale;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsISVGPoint* GetNewTranslate() const
|
|
||||||
{
|
|
||||||
return mNewTranslate;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
~SVGZoomEvent();
|
|
||||||
|
|
||||||
float mPreviousScale;
|
|
||||||
float mNewScale;
|
|
||||||
RefPtr<DOMSVGPoint> mPreviousTranslate;
|
|
||||||
RefPtr<DOMSVGPoint> mNewTranslate;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace dom
|
|
||||||
} // namespace mozilla
|
|
||||||
|
|
||||||
already_AddRefed<mozilla::dom::SVGZoomEvent>
|
|
||||||
NS_NewDOMSVGZoomEvent(mozilla::dom::EventTarget* aOwner,
|
|
||||||
nsPresContext* aPresContext,
|
|
||||||
mozilla::InternalSVGZoomEvent* aEvent);
|
|
||||||
|
|
||||||
#endif // mozilla_dom_SVGZoomEvent_h
|
|
||||||
|
|
@ -100,7 +100,6 @@ EXPORTS.mozilla.dom += [
|
||||||
'SVGTSpanElement.h',
|
'SVGTSpanElement.h',
|
||||||
'SVGUseElement.h',
|
'SVGUseElement.h',
|
||||||
'SVGViewElement.h',
|
'SVGViewElement.h',
|
||||||
'SVGZoomEvent.h',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
UNIFIED_SOURCES += [
|
UNIFIED_SOURCES += [
|
||||||
|
|
@ -247,7 +246,6 @@ UNIFIED_SOURCES += [
|
||||||
'SVGUseElement.cpp',
|
'SVGUseElement.cpp',
|
||||||
'SVGViewBoxSMILType.cpp',
|
'SVGViewBoxSMILType.cpp',
|
||||||
'SVGViewElement.cpp',
|
'SVGViewElement.cpp',
|
||||||
'SVGZoomEvent.cpp',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
include('/ipc/chromium/chromium-config.mozbuild')
|
include('/ipc/chromium/chromium-config.mozbuild')
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ support-files =
|
||||||
text-helper-selection.svg
|
text-helper-selection.svg
|
||||||
text-helper.svg
|
text-helper.svg
|
||||||
viewport-helper.svg
|
viewport-helper.svg
|
||||||
zoom-helper.svg
|
|
||||||
|
|
||||||
[test_a_href_01.xhtml]
|
[test_a_href_01.xhtml]
|
||||||
[test_a_href_02.xhtml]
|
[test_a_href_02.xhtml]
|
||||||
|
|
@ -105,5 +104,4 @@ support-files = use-with-hsts-helper.html use-with-hsts-helper.html^headers^
|
||||||
[test_valueAsString.xhtml]
|
[test_valueAsString.xhtml]
|
||||||
[test_valueLeaks.xhtml]
|
[test_valueLeaks.xhtml]
|
||||||
[test_viewport.html]
|
[test_viewport.html]
|
||||||
[test_zoom.xhtml]
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<!--
|
|
||||||
https://bugzilla.mozilla.org/show_bug.cgi?id=547596
|
|
||||||
-->
|
|
||||||
<head>
|
|
||||||
<title>Test for Bug 547596</title>
|
|
||||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
||||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=547596">Mozilla Bug 547596</a>
|
|
||||||
<p id="display"></p>
|
|
||||||
<div id="content" style="display: none"></div>
|
|
||||||
|
|
||||||
<iframe id="svg" src="zoom-helper.svg"></iframe>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
|
||||||
|
|
||||||
function runTests() {
|
|
||||||
var doc = $("svg").contentWindow.document;
|
|
||||||
var root = doc.getElementById("root");
|
|
||||||
root.currentScale *= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
function zoomHandler(evt) {
|
|
||||||
ok(true, "zoom handler should be called on zoom");
|
|
||||||
SimpleTest.finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("load", runTests, false);
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
<?xml version="1.0"?>
|
|
||||||
<svg id="root" version="1.1" xmlns="http://www.w3.org/2000/svg" onzoom="parent.zoomHandler(evt)">
|
|
||||||
<rect x="10" y="10" width="10" height="10" fill="green" />
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 188 B |
|
|
@ -1124,8 +1124,6 @@ var interfaceNamesInGlobalScope =
|
||||||
"SVGViewElement",
|
"SVGViewElement",
|
||||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||||
"SVGZoomAndPan",
|
"SVGZoomAndPan",
|
||||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
|
||||||
"SVGZoomEvent",
|
|
||||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||||
"Text",
|
"Text",
|
||||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||||
|
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
*
|
|
||||||
* The origin of this IDL file is
|
|
||||||
* http://www.w3.org/TR/SVG2/
|
|
||||||
*
|
|
||||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
|
||||||
* liability, trademark and document use rules apply.
|
|
||||||
*/
|
|
||||||
|
|
||||||
interface SVGZoomEvent : UIEvent {
|
|
||||||
// Not implemented
|
|
||||||
// readonly attribute SVGRect zoomRectScreen;
|
|
||||||
|
|
||||||
[Constant]
|
|
||||||
readonly attribute float previousScale;
|
|
||||||
[Constant]
|
|
||||||
readonly attribute SVGPoint? previousTranslate;
|
|
||||||
[Constant]
|
|
||||||
readonly attribute float newScale;
|
|
||||||
[Constant]
|
|
||||||
readonly attribute SVGPoint? newTranslate;
|
|
||||||
};
|
|
||||||
|
|
@ -529,7 +529,6 @@ WEBIDL_FILES = [
|
||||||
'SVGViewElement.webidl',
|
'SVGViewElement.webidl',
|
||||||
'SVGZoomAndPan.webidl',
|
'SVGZoomAndPan.webidl',
|
||||||
'SVGZoomAndPanValues.webidl',
|
'SVGZoomAndPanValues.webidl',
|
||||||
'SVGZoomEvent.webidl',
|
|
||||||
'SystemUpdate.webidl',
|
'SystemUpdate.webidl',
|
||||||
'TCPServerSocket.webidl',
|
'TCPServerSocket.webidl',
|
||||||
'TCPServerSocketEvent.webidl',
|
'TCPServerSocketEvent.webidl',
|
||||||
|
|
|
||||||
|
|
@ -9337,3 +9337,28 @@ nsLayoutUtils::ComputeGeometryBox(nsIFrame* aFrame,
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* static */ nsStyleContext*
|
||||||
|
nsLayoutUtils::GetNonAnonymousStyleContext(nsIFrame* aFrame)
|
||||||
|
{
|
||||||
|
nsIContent* node = aFrame->GetContent();
|
||||||
|
MOZ_ASSERT(node, "No content for the given frame?");
|
||||||
|
while (node && node->IsInNativeAnonymousSubtree()) {
|
||||||
|
node = node->GetParent();
|
||||||
|
}
|
||||||
|
MOZ_ASSERT(node, "Native anonymous element with no originating node?");
|
||||||
|
if (nsIFrame* primaryFrame = node->GetPrimaryFrame()) {
|
||||||
|
return primaryFrame->StyleContext();
|
||||||
|
}
|
||||||
|
// If the element doesn't have primary frame, get the computed style
|
||||||
|
// from the element directly.
|
||||||
|
nsPresContext* pc = aFrame->PresContext();
|
||||||
|
MOZ_ASSERT(node == pc->Document()->GetRootElement(),
|
||||||
|
"Root element is the only case for this fallback "
|
||||||
|
"path to be triggered");
|
||||||
|
RefPtr<nsStyleContext> styleContext =
|
||||||
|
pc->StyleSet()->ResolveStyleFor(node->AsElement(), nullptr);
|
||||||
|
// Dropping the strong reference is fine because the style should be
|
||||||
|
// held strongly by the element.
|
||||||
|
return styleContext.get();
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -2878,6 +2878,15 @@ public:
|
||||||
return ResolveToLength<true>(aGap, aPercentageBasis);
|
return ResolveToLength<true>(aGap, aPercentageBasis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the style context associated with the nearest non-native-anonymous
|
||||||
|
* ancestor of the given frame.
|
||||||
|
*
|
||||||
|
* @param aFrame The frame associated with native anonymous content.
|
||||||
|
* @return The resolved style context of the nearest non-anonymous DOM ancestor.
|
||||||
|
*/
|
||||||
|
static nsStyleContext* GetNonAnonymousStyleContext(nsIFrame* aFrame);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static uint32_t sFontSizeInflationEmPerLine;
|
static uint32_t sFontSizeInflationEmPerLine;
|
||||||
static uint32_t sFontSizeInflationMinTwips;
|
static uint32_t sFontSizeInflationMinTwips;
|
||||||
|
|
|
||||||
|
|
@ -1060,7 +1060,9 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
|
||||||
// This is only needed for root element because scrollbars of non-
|
// This is only needed for root element because scrollbars of non-
|
||||||
// root elements with "scrollbar-width: none" is already suppressed
|
// root elements with "scrollbar-width: none" is already suppressed
|
||||||
// in ScrollFrameHelper::CreateAnonymousContent.
|
// in ScrollFrameHelper::CreateAnonymousContent.
|
||||||
if (this->StyleUserInterface()->mScrollbarWidth == StyleScrollbarWidth::None) {
|
nsStyleContext* scrollbarStyle = nsLayoutUtils::GetNonAnonymousStyleContext(this);
|
||||||
|
auto scrollbarWidth = scrollbarStyle->StyleUIReset()->mScrollbarWidth;
|
||||||
|
if (scrollbarWidth == StyleScrollbarWidth::None) {
|
||||||
state.mVScrollbar = ShowScrollbar::Never;
|
state.mVScrollbar = ShowScrollbar::Never;
|
||||||
state.mHScrollbar = ShowScrollbar::Never;
|
state.mHScrollbar = ShowScrollbar::Never;
|
||||||
}
|
}
|
||||||
|
|
@ -4417,7 +4419,7 @@ ScrollFrameHelper::CreateAnonymousContent(
|
||||||
canHaveHorizontal = true;
|
canHaveHorizontal = true;
|
||||||
canHaveVertical = true;
|
canHaveVertical = true;
|
||||||
} else {
|
} else {
|
||||||
if (mOuter->StyleUserInterface()->mScrollbarWidth == StyleScrollbarWidth::None) {
|
if (mOuter->StyleUIReset()->mScrollbarWidth == StyleScrollbarWidth::None) {
|
||||||
// If scrollbar-width is none, don't generate scrollbars.
|
// If scrollbar-width is none, don't generate scrollbars.
|
||||||
canHaveHorizontal = false;
|
canHaveHorizontal = false;
|
||||||
canHaveVertical = false;
|
canHaveVertical = false;
|
||||||
|
|
@ -4450,7 +4452,7 @@ ScrollFrameHelper::CreateAnonymousContent(
|
||||||
kNameSpaceID_XUL,
|
kNameSpaceID_XUL,
|
||||||
nsIDOMNode::ELEMENT_NODE);
|
nsIDOMNode::ELEMENT_NODE);
|
||||||
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
|
||||||
StyleScrollbarWidth scrollWidth = mOuter->StyleUserInterface()->mScrollbarWidth;
|
StyleScrollbarWidth scrollWidth = mOuter->StyleUIReset()->mScrollbarWidth;
|
||||||
|
|
||||||
if (canHaveHorizontal) {
|
if (canHaveHorizontal) {
|
||||||
RefPtr<NodeInfo> ni = nodeInfo;
|
RefPtr<NodeInfo> ni = nodeInfo;
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ Declaration::Declaration(const Declaration& aCopy)
|
||||||
nullptr),
|
nullptr),
|
||||||
mImmutable(false)
|
mImmutable(false)
|
||||||
{
|
{
|
||||||
|
mContainer.mRaw = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Declaration::~Declaration()
|
Declaration::~Declaration()
|
||||||
|
|
|
||||||
|
|
@ -324,10 +324,18 @@ FontFaceSet::Load(JSContext* aCx,
|
||||||
|
|
||||||
nsTArray<RefPtr<Promise>> promises;
|
nsTArray<RefPtr<Promise>> promises;
|
||||||
|
|
||||||
nsTArray<FontFace*> faces;
|
nsTArray<RefPtr<FontFace>> faces;
|
||||||
FindMatchingFontFaces(aFont, aText, faces, aRv);
|
{
|
||||||
if (aRv.Failed()) {
|
nsTArray<FontFace*> weakFaces;
|
||||||
return nullptr;
|
FindMatchingFontFaces(aFont, aText, weakFaces, aRv);
|
||||||
|
if (aRv.Failed()) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
if (!faces.AppendElements(weakFaces, fallible) ||
|
||||||
|
!promises.SetCapacity(weakFaces.Length(), fallible)) {
|
||||||
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (FontFace* f : faces) {
|
for (FontFace* f : faces) {
|
||||||
|
|
@ -335,10 +343,7 @@ FontFaceSet::Load(JSContext* aCx,
|
||||||
if (aRv.Failed()) {
|
if (aRv.Failed()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
if (!promises.AppendElement(promise, fallible)) {
|
promises.AppendElement(promise);
|
||||||
aRv.Throw(NS_ERROR_FAILURE);
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise::All(aCx, promises, aRv);
|
return Promise::All(aCx, promises, aRv);
|
||||||
|
|
|
||||||
|
|
@ -3723,7 +3723,7 @@ CSS_PROP_DISPLAY(
|
||||||
kScrollSnapTypeKTable,
|
kScrollSnapTypeKTable,
|
||||||
CSS_PROP_NO_OFFSET,
|
CSS_PROP_NO_OFFSET,
|
||||||
eStyleAnimType_Discrete)
|
eStyleAnimType_Discrete)
|
||||||
CSS_PROP_USERINTERFACE(
|
CSS_PROP_UIRESET(
|
||||||
scrollbar-width,
|
scrollbar-width,
|
||||||
scrollbar_width,
|
scrollbar_width,
|
||||||
ScrollbarWidth,
|
ScrollbarWidth,
|
||||||
|
|
|
||||||
|
|
@ -3302,7 +3302,7 @@ nsComputedDOMStyle::DoGetScrollbarWidth()
|
||||||
{
|
{
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
val->SetIdent(
|
val->SetIdent(
|
||||||
nsCSSProps::ValueToKeywordEnum(StyleUserInterface()->mScrollbarWidth,
|
nsCSSProps::ValueToKeywordEnum(StyleUIReset()->mScrollbarWidth,
|
||||||
nsCSSProps::kScrollbarWidthKTable));
|
nsCSSProps::kScrollbarWidthKTable));
|
||||||
return val.forget();
|
return val.forget();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5377,14 +5377,6 @@ nsRuleNode::ComputeUserInterfaceData(void* aStartStruct,
|
||||||
// caret-color: auto, color, inherit
|
// caret-color: auto, color, inherit
|
||||||
setComplexColor(aRuleData->ValueForCaretColor(),
|
setComplexColor(aRuleData->ValueForCaretColor(),
|
||||||
&nsStyleUserInterface::mCaretColor);
|
&nsStyleUserInterface::mCaretColor);
|
||||||
|
|
||||||
// scrollbar-width: auto, thin, none
|
|
||||||
SetValue(*aRuleData->ValueForScrollbarWidth(),
|
|
||||||
ui->mScrollbarWidth,
|
|
||||||
conditions,
|
|
||||||
SETVAL_ENUMERATED,
|
|
||||||
parentUI->mScrollbarWidth,
|
|
||||||
StyleScrollbarWidth::Auto);
|
|
||||||
|
|
||||||
COMPUTE_END_INHERITED(UserInterface, ui)
|
COMPUTE_END_INHERITED(UserInterface, ui)
|
||||||
}
|
}
|
||||||
|
|
@ -5434,6 +5426,14 @@ nsRuleNode::ComputeUIResetData(void* aStartStruct,
|
||||||
parentUI->mWindowShadow,
|
parentUI->mWindowShadow,
|
||||||
NS_STYLE_WINDOW_SHADOW_DEFAULT);
|
NS_STYLE_WINDOW_SHADOW_DEFAULT);
|
||||||
|
|
||||||
|
// scrollbar-width: auto, thin, none
|
||||||
|
SetValue(*aRuleData->ValueForScrollbarWidth(),
|
||||||
|
ui->mScrollbarWidth,
|
||||||
|
conditions,
|
||||||
|
SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
|
||||||
|
parentUI->mScrollbarWidth,
|
||||||
|
StyleScrollbarWidth::Auto);
|
||||||
|
|
||||||
COMPUTE_END_RESET(UIReset, ui)
|
COMPUTE_END_RESET(UIReset, ui)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -547,6 +547,15 @@ nsStyleBorder::CalcDifference(const nsStyleBorder& aNewData) const
|
||||||
return nsChangeHint_NeutralChange;
|
return nsChangeHint_NeutralChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mBorderImage* fields are checked only when border-image is not 'none'.
|
||||||
|
if (mBorderImageSource != aNewData.mBorderImageSource ||
|
||||||
|
mBorderImageRepeatH != aNewData.mBorderImageRepeatH ||
|
||||||
|
mBorderImageRepeatV != aNewData.mBorderImageRepeatV ||
|
||||||
|
mBorderImageSlice != aNewData.mBorderImageSlice ||
|
||||||
|
mBorderImageWidth != aNewData.mBorderImageWidth) {
|
||||||
|
return nsChangeHint_NeutralChange;
|
||||||
|
}
|
||||||
|
|
||||||
return nsChangeHint(0);
|
return nsChangeHint(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3924,7 +3933,6 @@ nsStyleUserInterface::nsStyleUserInterface(nsPresContext* aContext)
|
||||||
, mPointerEvents(NS_STYLE_POINTER_EVENTS_AUTO)
|
, mPointerEvents(NS_STYLE_POINTER_EVENTS_AUTO)
|
||||||
, mCursor(NS_STYLE_CURSOR_AUTO)
|
, mCursor(NS_STYLE_CURSOR_AUTO)
|
||||||
, mCaretColor(StyleComplexColor::Auto())
|
, mCaretColor(StyleComplexColor::Auto())
|
||||||
, mScrollbarWidth(StyleScrollbarWidth::Auto)
|
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(nsStyleUserInterface);
|
MOZ_COUNT_CTOR(nsStyleUserInterface);
|
||||||
}
|
}
|
||||||
|
|
@ -3937,7 +3945,6 @@ nsStyleUserInterface::nsStyleUserInterface(const nsStyleUserInterface& aSource)
|
||||||
, mCursor(aSource.mCursor)
|
, mCursor(aSource.mCursor)
|
||||||
, mCursorImages(aSource.mCursorImages)
|
, mCursorImages(aSource.mCursorImages)
|
||||||
, mCaretColor(aSource.mCaretColor)
|
, mCaretColor(aSource.mCaretColor)
|
||||||
, mScrollbarWidth(aSource.mScrollbarWidth)
|
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(nsStyleUserInterface);
|
MOZ_COUNT_CTOR(nsStyleUserInterface);
|
||||||
}
|
}
|
||||||
|
|
@ -3989,13 +3996,6 @@ nsStyleUserInterface::CalcDifference(const nsStyleUserInterface& aNewData) const
|
||||||
if (mCaretColor != aNewData.mCaretColor) {
|
if (mCaretColor != aNewData.mCaretColor) {
|
||||||
hint |= nsChangeHint_RepaintFrame;
|
hint |= nsChangeHint_RepaintFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mScrollbarWidth != aNewData.mScrollbarWidth) {
|
|
||||||
// For scrollbar-width change, we need some special handling similar
|
|
||||||
// to overflow properties. Specifically, we may need to reconstruct
|
|
||||||
// the scrollbar or force reflow of the viewport scrollbar.
|
|
||||||
hint |= nsChangeHint_ScrollbarChange;
|
|
||||||
}
|
|
||||||
|
|
||||||
return hint;
|
return hint;
|
||||||
}
|
}
|
||||||
|
|
@ -4010,6 +4010,7 @@ nsStyleUIReset::nsStyleUIReset(nsPresContext* aContext)
|
||||||
, mIMEMode(NS_STYLE_IME_MODE_AUTO)
|
, mIMEMode(NS_STYLE_IME_MODE_AUTO)
|
||||||
, mWindowDragging(StyleWindowDragging::Default)
|
, mWindowDragging(StyleWindowDragging::Default)
|
||||||
, mWindowShadow(NS_STYLE_WINDOW_SHADOW_DEFAULT)
|
, mWindowShadow(NS_STYLE_WINDOW_SHADOW_DEFAULT)
|
||||||
|
, mScrollbarWidth(StyleScrollbarWidth::Auto)
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(nsStyleUIReset);
|
MOZ_COUNT_CTOR(nsStyleUIReset);
|
||||||
}
|
}
|
||||||
|
|
@ -4020,6 +4021,7 @@ nsStyleUIReset::nsStyleUIReset(const nsStyleUIReset& aSource)
|
||||||
, mIMEMode(aSource.mIMEMode)
|
, mIMEMode(aSource.mIMEMode)
|
||||||
, mWindowDragging(aSource.mWindowDragging)
|
, mWindowDragging(aSource.mWindowDragging)
|
||||||
, mWindowShadow(aSource.mWindowShadow)
|
, mWindowShadow(aSource.mWindowShadow)
|
||||||
|
, mScrollbarWidth(aSource.mScrollbarWidth)
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(nsStyleUIReset);
|
MOZ_COUNT_CTOR(nsStyleUIReset);
|
||||||
}
|
}
|
||||||
|
|
@ -4032,25 +4034,40 @@ nsStyleUIReset::~nsStyleUIReset()
|
||||||
nsChangeHint
|
nsChangeHint
|
||||||
nsStyleUIReset::CalcDifference(const nsStyleUIReset& aNewData) const
|
nsStyleUIReset::CalcDifference(const nsStyleUIReset& aNewData) const
|
||||||
{
|
{
|
||||||
|
nsChangeHint hint = nsChangeHint(0);
|
||||||
|
|
||||||
// ignore mIMEMode
|
// ignore mIMEMode
|
||||||
if (mForceBrokenImageIcon != aNewData.mForceBrokenImageIcon) {
|
if (mForceBrokenImageIcon != aNewData.mForceBrokenImageIcon) {
|
||||||
return nsChangeHint_ReconstructFrame;
|
hint |= nsChangeHint_ReconstructFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mWindowShadow != aNewData.mWindowShadow) {
|
if (mWindowShadow != aNewData.mWindowShadow) {
|
||||||
// We really need just an nsChangeHint_SyncFrameView, except
|
// We really need just an nsChangeHint_SyncFrameView, except
|
||||||
// on an ancestor of the frame, so we get that by doing a
|
// on an ancestor of the frame, so we get that by doing a
|
||||||
// reflow.
|
// reflow.
|
||||||
return NS_STYLE_HINT_REFLOW;
|
hint |= NS_STYLE_HINT_REFLOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mUserSelect != aNewData.mUserSelect) {
|
if (mUserSelect != aNewData.mUserSelect) {
|
||||||
return NS_STYLE_HINT_VISUAL;
|
hint |= NS_STYLE_HINT_VISUAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mWindowDragging != aNewData.mWindowDragging) {
|
if (mWindowDragging != aNewData.mWindowDragging) {
|
||||||
return nsChangeHint_SchedulePaint;
|
hint |= nsChangeHint_SchedulePaint;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsChangeHint(0);
|
if (mScrollbarWidth != aNewData.mScrollbarWidth) {
|
||||||
|
// For scrollbar-width change, we need some special handling similar
|
||||||
|
// to overflow properties. Specifically, we may need to reconstruct
|
||||||
|
// the scrollbar or force reflow of the viewport scrollbar.
|
||||||
|
hint |= nsChangeHint_ScrollbarChange;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hint && mIMEMode != aNewData.mIMEMode) {
|
||||||
|
hint |= nsChangeHint_NeutralChange;
|
||||||
|
}
|
||||||
|
|
||||||
|
return hint;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------
|
//-----------------------
|
||||||
|
|
|
||||||
|
|
@ -3252,7 +3252,8 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset
|
||||||
nsChangeHint CalcDifference(const nsStyleUIReset& aNewData) const;
|
nsChangeHint CalcDifference(const nsStyleUIReset& aNewData) const;
|
||||||
static nsChangeHint MaxDifference() {
|
static nsChangeHint MaxDifference() {
|
||||||
return nsChangeHint_ReconstructFrame |
|
return nsChangeHint_ReconstructFrame |
|
||||||
NS_STYLE_HINT_REFLOW;
|
NS_STYLE_HINT_REFLOW |
|
||||||
|
nsChangeHint_NeutralChange;
|
||||||
}
|
}
|
||||||
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
|
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
|
||||||
// CalcDifference never returns the reflow hints that are sometimes
|
// CalcDifference never returns the reflow hints that are sometimes
|
||||||
|
|
@ -3267,6 +3268,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset
|
||||||
uint8_t mIMEMode; // [reset]
|
uint8_t mIMEMode; // [reset]
|
||||||
mozilla::StyleWindowDragging mWindowDragging; // [reset]
|
mozilla::StyleWindowDragging mWindowDragging; // [reset]
|
||||||
uint8_t mWindowShadow; // [reset]
|
uint8_t mWindowShadow; // [reset]
|
||||||
|
mozilla::StyleScrollbarWidth mScrollbarWidth; // [reset]
|
||||||
};
|
};
|
||||||
|
|
||||||
struct nsCursorImage
|
struct nsCursorImage
|
||||||
|
|
@ -3344,7 +3346,6 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUserInterface
|
||||||
uint8_t mCursor; // [inherited] See nsStyleConsts.h
|
uint8_t mCursor; // [inherited] See nsStyleConsts.h
|
||||||
nsTArray<nsCursorImage> mCursorImages; // [inherited] images and coords
|
nsTArray<nsCursorImage> mCursorImages; // [inherited] images and coords
|
||||||
mozilla::StyleComplexColor mCaretColor; // [inherited]
|
mozilla::StyleComplexColor mCaretColor; // [inherited]
|
||||||
mozilla::StyleScrollbarWidth mScrollbarWidth;
|
|
||||||
|
|
||||||
inline uint8_t GetEffectivePointerEvents(nsIFrame* aFrame) const;
|
inline uint8_t GetEffectivePointerEvents(nsIFrame* aFrame) const;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -312,7 +312,6 @@ private:
|
||||||
break;
|
break;
|
||||||
case eTransitionEventClass:
|
case eTransitionEventClass:
|
||||||
case eAnimationEventClass:
|
case eAnimationEventClass:
|
||||||
case eSVGZoomEventClass:
|
|
||||||
mFlags.mCancelable = false;
|
mFlags.mCancelable = false;
|
||||||
mFlags.mBubbles = true;
|
mFlags.mBubbles = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -312,38 +312,6 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* mozilla::InternalSVGZoomEvent
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
class InternalSVGZoomEvent : public WidgetGUIEvent
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual InternalSVGZoomEvent* AsSVGZoomEvent() override { return this; }
|
|
||||||
|
|
||||||
InternalSVGZoomEvent(bool aIsTrusted, EventMessage aMessage)
|
|
||||||
: WidgetGUIEvent(aIsTrusted, aMessage, nullptr, eSVGZoomEventClass)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual WidgetEvent* Duplicate() const override
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(mClass == eSVGZoomEventClass,
|
|
||||||
"Duplicate() must be overridden by sub class");
|
|
||||||
// Not copying widget, it is a weak reference.
|
|
||||||
InternalSVGZoomEvent* result = new InternalSVGZoomEvent(false, mMessage);
|
|
||||||
result->AssignSVGZoomEventData(*this, true);
|
|
||||||
result->mFlags = mFlags;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AssignSVGZoomEventData(const InternalSVGZoomEvent& aEvent,
|
|
||||||
bool aCopyTargets)
|
|
||||||
{
|
|
||||||
AssignGUIEventData(aEvent, aCopyTargets);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* mozilla::InternalSMILTimeEvent
|
* mozilla::InternalSMILTimeEvent
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,6 @@ NS_EVENT_CLASS(Internal, ClipboardEvent)
|
||||||
NS_EVENT_CLASS(Internal, FocusEvent)
|
NS_EVENT_CLASS(Internal, FocusEvent)
|
||||||
NS_EVENT_CLASS(Internal, TransitionEvent)
|
NS_EVENT_CLASS(Internal, TransitionEvent)
|
||||||
NS_EVENT_CLASS(Internal, AnimationEvent)
|
NS_EVENT_CLASS(Internal, AnimationEvent)
|
||||||
NS_EVENT_CLASS(Internal, SVGZoomEvent)
|
|
||||||
NS_EVENT_CLASS(Internal, SMILTimeEvent)
|
NS_EVENT_CLASS(Internal, SMILTimeEvent)
|
||||||
|
|
||||||
// MiscEvents.h
|
// MiscEvents.h
|
||||||
|
|
|
||||||
|
|
@ -1572,7 +1572,9 @@ GetThemeDpiScaleFactor(nsIFrame* aFrame)
|
||||||
static bool
|
static bool
|
||||||
IsScrollbarWidthThin(nsIFrame* aFrame)
|
IsScrollbarWidthThin(nsIFrame* aFrame)
|
||||||
{
|
{
|
||||||
return aFrame->StyleUserInterface()->mScrollbarWidth == StyleScrollbarWidth::Thin;
|
nsStyleContext* styleContext = nsLayoutUtils::GetNonAnonymousStyleContext(aFrame);
|
||||||
|
auto scrollbarWidth = styleContext->StyleUIReset()->mScrollbarWidth;
|
||||||
|
return scrollbarWidth == StyleScrollbarWidth::Thin;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
|
|
||||||
|
|
@ -1516,6 +1516,22 @@ nsLocalFile::IsExecutable(bool* aResult)
|
||||||
|
|
||||||
// Search for any of the set of executable extensions.
|
// Search for any of the set of executable extensions.
|
||||||
static const char* const executableExts[] = {
|
static const char* const executableExts[] = {
|
||||||
|
#ifdef MOZ_WIDGET_COCOA
|
||||||
|
"afploc", // Can point to other files.
|
||||||
|
"atloc", // Can point to other files.
|
||||||
|
"fileloc", // File location files can be used to point to other
|
||||||
|
// files.
|
||||||
|
"ftploc", // Can point to other files.
|
||||||
|
"inetloc", // Shouldn't be able to do the same, but can, due to
|
||||||
|
// macOS vulnerabilities.
|
||||||
|
"atloc", // Can point to other files.
|
||||||
|
"fileloc", // File location files can be used to point to other
|
||||||
|
// files.
|
||||||
|
"ftploc", // Can point to other files.
|
||||||
|
"inetloc", // Shouldn't be able to do the same, but can, due to
|
||||||
|
// macOS vulnerabilities.
|
||||||
|
"terminal", // macOS Terminal app configuration files
|
||||||
|
#endif
|
||||||
"air", // Adobe AIR installer
|
"air", // Adobe AIR installer
|
||||||
"jar" // java application bundle
|
"jar" // java application bundle
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue