Merge the last PGO-green inbound changeset to m-c.

This commit is contained in:
Ryan VanderMeulen 2013-01-30 08:05:31 -05:00
commit 4b0eeb190c
230 changed files with 9483 additions and 2174 deletions

View File

@ -14,6 +14,13 @@ const Cr = Components.results;
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Cu.import('resource://gre/modules/Services.jsm');
#ifdef MOZ_WIDGET_GONK
XPCOMUtils.defineLazyGetter(this, "libcutils", function () {
Cu.import("resource://gre/modules/systemlibs.js");
return libcutils;
});
#endif
// Once Bug 731746 - Allow chrome JS object to implement nsIDOMEventTarget
// is resolved this helper could be removed.
var SettingsListener = {
@ -174,27 +181,10 @@ Components.utils.import('resource://gre/modules/ctypes.jsm');
// Get the hardware info and firmware revision from device properties.
let hardware_info = null;
let firmware_revision = null;
try {
let cutils = ctypes.open('libcutils.so');
let cbuf = ctypes.char.array(128)();
let c_property_get = cutils.declare('property_get', ctypes.default_abi,
ctypes.int, // return value: length
ctypes.char.ptr, // key
ctypes.char.ptr, // value
ctypes.char.ptr); // default
let property_get = function (key, defaultValue) {
if (defaultValue === undefined) {
defaultValue = null;
}
c_property_get(key, cbuf, defaultValue);
return cbuf.readString();
}
hardware_info = property_get('ro.hardware');
firmware_revision = property_get('ro.firmware_revision');
cutils.close();
} catch(e) {
// Error.
}
#ifdef MOZ_WIDGET_GONK
hardware_info = libcutils.property_get('ro.hardware');
firmware_revision = libcutils.property_get('ro.firmware_revision');
#endif
lock.set('deviceinfo.hardware', hardware_info, null, null);
lock.set('deviceinfo.firmware_revision', firmware_revision, null, null);
})();
@ -205,6 +195,19 @@ SettingsListener.observe('devtools.debugger.remote-enabled', false, function(val
// This preference is consulted during startup
Services.prefs.savePrefFile(null);
value ? RemoteDebugger.start() : RemoteDebugger.stop();
#ifdef MOZ_WIDGET_GONK
// Configure adb.
try {
let current = libcutils.property_get("persist.sys.usb.config");
let prefix = current.replace(/,adb/, "");
libcutils.property_set("persist.sys.usb.config",
prefix + (value ? ",adb" : ""));
current = libcutils.property_get("persist.sys.usb.config");
} catch(e) {
dump("Error configuring adb: " + e);
}
#endif
});
SettingsListener.observe('debug.log-animations.enabled', false, function(value) {

View File

@ -52,6 +52,14 @@ tabbrowser {
opacity 50ms ease-out 180ms /* hide the tab for the last 20ms of the max-width transition */;
}
.tabbrowser-tabs[dontresize] > .tabbrowser-tab[fadein]:not([pinned]) {
/* controlled in tabbrowser.xml */
}
.tabbrowser-tabs[dontanimate] > .tabbrowser-tab {
transition: none !important;
}
.tab-throbber:not([fadein]):not([pinned]),
.tab-label:not([fadein]):not([pinned]),
.tab-icon-image:not([fadein]):not([pinned]),

View File

@ -1265,7 +1265,7 @@ var gBrowserInit = {
gBrowser.addEventListener("pageshow", function(event) {
// Filter out events that are not about the document load we are interested in
if (content && event.target == content.document)
if (event.target == content.document)
setTimeout(pageShowEventHandlers, 0, event);
}, true);

View File

@ -47,11 +47,12 @@ tabpanels {
}
.closing-tabs-spacer {
min-width: 0;
pointer-events: none;
}
.tabbrowser-tabs:not(:hover) > .tabbrowser-arrowscrollbox > .closing-tabs-spacer {
transition: width .15s ease-out;
transition: min-width 150ms ease-out;
}
/**

View File

@ -1584,7 +1584,6 @@
aTab._animStartTime = Date.now();
this._blurTab(aTab);
aTab.style.maxWidth = ""; // ensure that fade-out transition happens
aTab.removeAttribute("fadein");
setTimeout(function (tab, tabbrowser) {
@ -1781,10 +1780,6 @@
// update tab close buttons state
this.tabContainer.adjustTabstrip();
setTimeout(function(tabs) {
tabs._lastTabClosedByMouse = false;
}, 0, this.tabContainer);
}
// update first-tab/last-tab/beforeselected/afterselected attributes
@ -2829,10 +2824,13 @@
return; // Ignore vertical events
var tabs = document.getBindingParent(this);
tabs.removeAttribute("overflow");
if (tabs._lastTabClosedByMouse)
tabs._expandSpacerBy(this._scrollButtonDown.clientWidth);
if (tabs.hasAttribute("dontresize") || tabs.hasAttribute("using-closing-tabs-spacer")) {
tabs.mTabstrip._scrollButtonUp.style.visibility = "hidden";
tabs.mTabstrip._scrollButtonDown.style.visibility = "hidden";
} else {
tabs.removeAttribute("overflow");
}
tabs.tabbrowser._removingTabs.forEach(tabs.tabbrowser.removeTab,
tabs.tabbrowser);
@ -2877,8 +2875,7 @@
command="cmd_newNavigatorTab"
onclick="checkForMiddleClick(this, event);"
tooltiptext="&newTabButton.tooltip;"/>
<xul:spacer class="closing-tabs-spacer" anonid="closing-tabs-spacer"
style="width: 0;"/>
<xul:spacer class="closing-tabs-spacer" anonid="closing-tabs-spacer"/>
</xul:arrowscrollbox>
</content>
@ -3075,9 +3072,16 @@
document.getAnonymousElementByAttribute(this, "anonid", "closing-tabs-spacer");
</field>
<field name="_tabDefaultMaxWidth">NaN</field>
<field name="_lastTabClosedByMouse">false</field>
<field name="_hasTabTempMaxWidth">false</field>
<field name="_delayResizingRule" readonly="true"><![CDATA[
const href = "chrome://browser/content/browser.css";
const selector = ".tabbrowser-tabs[dontresize] > .tabbrowser-tab[fadein]:not([pinned])";
// XXX: document.styleSheets is not iterable (see bug 738196)
for (let sheet of Array.slice(document.styleSheets))
if (sheet.href == href)
for (let rule of Array.slice(sheet.cssRules))
if (rule.selectorText == selector) { rule; break; }
]]></field>
<!-- Try to keep the active tab's close button under the mouse cursor -->
<method name="_lockTabSizing">
@ -3090,62 +3094,48 @@
var isEndTab = (aTab._tPos > tabs[tabs.length-1]._tPos);
var tabWidth = aTab.getBoundingClientRect().width;
if (!this._tabDefaultMaxWidth)
this._tabDefaultMaxWidth =
parseFloat(window.getComputedStyle(aTab).maxWidth);
this._lastTabClosedByMouse = true;
if (this.getAttribute("overflow") == "true") {
// Don't need to do anything if we're in overflow mode and aren't scrolled
// all the way to the right, or if we're closing the last tab.
if (isEndTab || !this.mTabstrip._scrollButtonDown.disabled)
return;
// If the tab has an owner that will become the active tab, the owner will
// be to the left of it, so we actually want the left tab to slide over.
// This can't be done as easily in non-overflow mode, so we don't bother.
if (aTab.owner)
return;
this._expandSpacerBy(tabWidth);
} else { // non-overflow mode
// Locking is neither in effect nor needed, so let tabs expand normally.
if (isEndTab && !this._hasTabTempMaxWidth)
if (isEndTab && !this.hasAttribute("dontresize"))
return;
let numPinned = this.tabbrowser._numPinnedTabs;
// Force tabs to stay the same width, unless we're closing the last tab,
// which case we need to let them expand just enough so that the overall
// tabbar width is the same.
// Let spacer grow to the maximum and lock it, then let tabs expand normally
if (isEndTab) {
let numNormalTabs = tabs.length - numPinned;
tabWidth = tabWidth * (numNormalTabs + 1) / numNormalTabs;
if (tabWidth > this._tabDefaultMaxWidth)
tabWidth = this._tabDefaultMaxWidth;
}
tabWidth += "px";
for (let i = numPinned; i < tabs.length; i++) {
let tab = tabs[i];
tab.style.setProperty("max-width", tabWidth, "important");
if (!isEndTab) { // keep tabs the same width
tab.style.transition = "none";
tab.clientTop; // flush styles to skip animation; see bug 649247
tab.style.transition = "";
}
}
this._hasTabTempMaxWidth = true;
this.tabbrowser.addEventListener("mousemove", this, false);
window.addEventListener("mouseout", this, false);
}
]]></body>
</method>
<method name="_expandSpacerBy">
<parameter name="pixels"/>
<body><![CDATA[
let spacer = this._closingTabsSpacer;
spacer.style.width = parseFloat(spacer.style.width) + pixels + "px";
spacer.style.MozBoxFlex = 1;
spacer.style.minWidth = getComputedStyle(spacer).width;
spacer.style.MozBoxFlex = "";
this.setAttribute("dontanimate", "true");
this.removeAttribute("dontresize");
this.clientTop;
this.removeAttribute("dontanimate");
return;
}
if (!this.hasAttribute("dontresize")) {
this._delayResizingRule.style.setProperty("max-width", tabWidth + "px", "important");
this.setAttribute("dontanimate", "true");
this.setAttribute("dontresize", "true");
this.clientTop; // flush styles to skip animation; see bug 649247
this.removeAttribute("dontanimate");
}
if (!this.mTabstrip._scrollButtonUp.disabled) {
let spacer = this._closingTabsSpacer;
let width = parseFloat(spacer.style.minWidth) || 0;
width += tabWidth;
if (!this.mTabstrip._scrollButtonDown.disabled) {
let scrollbox = this.mTabstrip._scrollbox;
width -= scrollbox.scrollLeftMax - scrollbox.scrollLeft;
}
if (width >= 0) {
spacer.style.minWidth = width + "px";
this.setAttribute("using-closing-tabs-spacer", "true");
}
}
this.tabbrowser.addEventListener("mousemove", this, false);
window.addEventListener("mouseout", this, false);
]]></body>
@ -3156,16 +3146,14 @@
this.tabbrowser.removeEventListener("mousemove", this, false);
window.removeEventListener("mouseout", this, false);
if (this._hasTabTempMaxWidth) {
this._hasTabTempMaxWidth = false;
let tabs = this.tabbrowser.visibleTabs;
for (let i = 0; i < tabs.length; i++)
tabs[i].style.maxWidth = "";
}
if (this.hasAttribute("using-closing-tabs-spacer")) {
this._closingTabsSpacer.style.minWidth = "";
this.removeAttribute("using-closing-tabs-spacer");
this._closingTabsSpacer.style.width = 0;
this.removeAttribute("dontresize");
if (this.hasAttribute("overflow") && this.mTabstrip._scrollbox.scrollWidth <= this.mTabstrip._scrollbox.clientWidth) {
this.mTabstrip._scrollButtonUp.style.visibility = "";
this.mTabstrip._scrollButtonDown.style.visibility = "";
this.removeAttribute("overflow");
}
]]></body>
</method>

View File

@ -460,7 +460,6 @@ PlacesController.prototype = {
break;
case Ci.nsINavHistoryResultNode.RESULT_TYPE_URI:
case Ci.nsINavHistoryResultNode.RESULT_TYPE_VISIT:
case Ci.nsINavHistoryResultNode.RESULT_TYPE_FULL_VISIT:
nodeData["link"] = true;
uri = NetUtil.newURI(node.uri);
if (PlacesUtils.nodeIsBookmark(node)) {

View File

@ -426,6 +426,8 @@ identity.loggedIn.signOut.accessKey = O
getUserMedia.shareCamera.message = Would you like to share your camera with %S?
getUserMedia.shareMicrophone.message = Would you like to share your microphone with %S?
getUserMedia.shareCameraAndMicrophone.message = Would you like to share your camera and microphone with %S?
getUserMedia.noVideo.label = No Video
getUserMedia.noAudio.label = No Audio
getUserMedia.shareSelectedDevices.label = Share Selected Device;Share Selected Devices
getUserMedia.shareSelectedDevices.accesskey = S
getUserMedia.denyRequest.label = Don't Share

View File

@ -118,19 +118,30 @@ function prompt(aBrowser, aCallID, aAudioRequested, aVideoRequested, aDevices) {
let deviceIndex = 0;
for (let device of devices) {
let menuitem = chromeDoc.createElement("menuitem");
menuitem.setAttribute("value", deviceIndex);
menuitem.setAttribute("label", device.name);
menuitem.setAttribute("tooltiptext", device.name);
menupopup.appendChild(menuitem);
addDeviceToList(menupopup, device.name, deviceIndex);
deviceIndex++;
}
}
function addDeviceToList(menupopup, deviceName, deviceIndex) {
let menuitem = chromeDoc.createElement("menuitem");
menuitem.setAttribute("value", deviceIndex);
menuitem.setAttribute("label", deviceName);
menuitem.setAttribute("tooltiptext", deviceName);
menupopup.appendChild(menuitem);
}
chromeDoc.getElementById("webRTC-selectCamera").hidden = !videoDevices.length;
chromeDoc.getElementById("webRTC-selectMicrophone").hidden = !audioDevices.length;
listDevices(chromeDoc.getElementById("webRTC-selectCamera-menupopup"), videoDevices);
listDevices(chromeDoc.getElementById("webRTC-selectMicrophone-menupopup"), audioDevices);
let camMenupopup = chromeDoc.getElementById("webRTC-selectCamera-menupopup");
let micMenupopup = chromeDoc.getElementById("webRTC-selectMicrophone-menupopup");
listDevices(camMenupopup, videoDevices);
listDevices(micMenupopup, audioDevices);
if (requestType == "CameraAndMicrophone") {
addDeviceToList(camMenupopup, stringBundle.getString("getUserMedia.noVideo.label"), "-1");
addDeviceToList(micMenupopup, stringBundle.getString("getUserMedia.noAudio.label"), "-1");
}
let mainAction = {
label: PluralForm.get(requestType == "CameraAndMicrophone" ? 2 : 1,
@ -141,12 +152,20 @@ function prompt(aBrowser, aCallID, aAudioRequested, aVideoRequested, aDevices) {
.createInstance(Ci.nsISupportsArray);
if (videoDevices.length) {
let videoDeviceIndex = chromeDoc.getElementById("webRTC-selectCamera-menulist").value;
if (videoDeviceIndex != "-1")
allowedDevices.AppendElement(videoDevices[videoDeviceIndex]);
}
if (audioDevices.length) {
let audioDeviceIndex = chromeDoc.getElementById("webRTC-selectMicrophone-menulist").value;
if (audioDeviceIndex != "-1")
allowedDevices.AppendElement(audioDevices[audioDeviceIndex]);
}
if (allowedDevices.Count() == 0) {
Services.obs.notifyObservers(null, "getUserMedia:response:deny", aCallID);
return;
}
Services.obs.notifyObservers(allowedDevices, "getUserMedia:response:allow", aCallID);
// Show browser-specific indicator for the active camera/mic access.

View File

@ -1436,6 +1436,7 @@ if test "$GNU_CC"; then
_DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
_USE_CPP_INCLUDE_FLAG=1
ASFLAGS="$ASFLAGS $_DEFINES_CFLAGS"
elif test "$SOLARIS_SUNPRO_CC"; then
DSO_CFLAGS=''
@ -6180,7 +6181,7 @@ if test "$OS_ARCH" = "WINNT"; then
if test -n "$MAKENSISU" -a "$MAKENSISU" != ":"; then
AC_MSG_RESULT([yes])
changequote(,)
MAKENSISU_VER=`"$MAKENSISU" -version 2>/dev/null | sed -e '/-Unicode/!s/.*//g' -e 's/^v\([0-9]\+\.[0-9]\+\)\-Unicode$/\1/g'`
MAKENSISU_VER=`"$MAKENSISU" -version 2>/dev/null | sed -e '/-Unicode/!s/.*//g' -e 's/^v\([0-9]\+\.[0-9]\+\).*\-Unicode$/\1/g'`
changequote([,])
if test ! "$MAKENSISU_VER" = ""; then
MAKENSISU_MAJOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $1 }'`

View File

@ -34,6 +34,7 @@ class nsDOMNavigationTiming;
class nsEventStates;
class nsFrameLoader;
class nsHTMLCSSStyleSheet;
class nsHTMLDocument;
class nsHTMLStyleSheet;
class nsIAtom;
class nsIBFCacheEntry;
@ -1974,6 +1975,8 @@ public:
already_AddRefed<nsIDOMTouchList>
CreateTouchList(const mozilla::dom::Sequence<nsRefPtr<nsIDOMTouch> >& aTouches);
nsHTMLDocument* AsHTMLDocument();
private:
uint64_t mWarnedAbout;

View File

@ -388,7 +388,6 @@ protected:
virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
bool *aTriedToWrap)
{
MOZ_ASSERT(!IsDOMBinding(), "Someone forgot to override WrapNode");
*aTriedToWrap = false;
return nullptr;
}
@ -1551,9 +1550,9 @@ public:
already_AddRefed<nsINode> CloneNode(bool aDeep, mozilla::ErrorResult& aError);
bool IsEqualNode(nsINode* aNode);
bool IsSupported(const nsAString& aFeature, const nsAString& aVersion);
void GetNamespaceURI(nsAString& aNamespaceURI, mozilla::ErrorResult& aError) const
void GetNamespaceURI(nsAString& aNamespaceURI) const
{
aError = mNodeInfo->GetNamespaceURI(aNamespaceURI);
mNodeInfo->GetNamespaceURI(aNamespaceURI);
}
#ifdef MOZILLA_INTERNAL_API
void GetPrefix(nsAString& aPrefix)
@ -2001,9 +2000,8 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsINode, NS_INODE_IID)
} \
NS_IMETHOD GetNamespaceURI(nsAString& aNamespaceURI) __VA_ARGS__ \
{ \
mozilla::ErrorResult rv; \
nsINode::GetNamespaceURI(aNamespaceURI, rv); \
return rv.ErrorCode(); \
nsINode::GetNamespaceURI(aNamespaceURI); \
return NS_OK; \
} \
NS_IMETHOD GetPrefix(nsAString& aPrefix) __VA_ARGS__ \
{ \

View File

@ -132,7 +132,7 @@ public:
/*
* Get the namespace URI for a node, if the node has a namespace URI.
*/
virtual nsresult GetNamespaceURI(nsAString& aNameSpaceURI) const = 0;
virtual void GetNamespaceURI(nsAString& aNameSpaceURI) const = 0;
/*
* Get the namespace ID for a node if the node has a namespace, if not this

View File

@ -1850,6 +1850,12 @@ nsDocument::Init()
return NS_OK;
}
nsHTMLDocument*
nsIDocument::AsHTMLDocument()
{
return IsHTML() ? static_cast<nsHTMLDocument*>(this) : nullptr;
}
void
nsIDocument::DeleteAllProperties()
{

View File

@ -208,19 +208,20 @@ NS_INTERFACE_MAP_END
// nsINodeInfo
nsresult
void
nsNodeInfo::GetNamespaceURI(nsAString& aNameSpaceURI) const
{
nsresult rv = NS_OK;
if (mInner.mNamespaceID > 0) {
rv = nsContentUtils::NameSpaceManager()->GetNameSpaceURI(mInner.mNamespaceID,
nsresult rv =
nsContentUtils::NameSpaceManager()->GetNameSpaceURI(mInner.mNamespaceID,
aNameSpaceURI);
// How can we possibly end up with a bogus namespace ID here?
if (NS_FAILED(rv)) {
MOZ_CRASH();
}
} else {
SetDOMStringToNull(aNameSpaceURI);
}
return rv;
}

View File

@ -29,7 +29,7 @@ public:
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_CLASS(nsNodeInfo)
// nsINodeInfo
virtual nsresult GetNamespaceURI(nsAString& aNameSpaceURI) const;
virtual void GetNamespaceURI(nsAString& aNameSpaceURI) const;
virtual bool NamespaceEquals(const nsAString& aNamespaceURI) const;
// nsNodeInfo

View File

@ -6,7 +6,7 @@
#include "base/basictypes.h"
#include "CanvasRenderingContext2D.h"
#include "nsXULElement.h"
#include "nsIDOMXULElement.h"
#include "prenv.h"
@ -3234,7 +3234,7 @@ CanvasRenderingContext2D::DrawWindow(nsIDOMWindow* window, double x,
}
void
CanvasRenderingContext2D::AsyncDrawXULElement(nsXULElement& elem,
CanvasRenderingContext2D::AsyncDrawXULElement(nsIDOMXULElement* elem,
double x, double y,
double w, double h,
const nsAString& bgColor,
@ -3255,7 +3255,7 @@ CanvasRenderingContext2D::AsyncDrawXULElement(nsXULElement& elem,
}
#if 0
nsCOMPtr<nsIFrameLoaderOwner> loaderOwner = do_QueryInterface(&elem);
nsCOMPtr<nsIFrameLoaderOwner> loaderOwner = do_QueryInterface(elem);
if (!loaderOwner) {
error.Throw(NS_ERROR_FAILURE);
return;

View File

@ -24,7 +24,7 @@
#define NS_CANVASPATTERNAZURE_PRIVATE_IID \
{0xc9bacc25, 0x28da, 0x421e, {0x9a, 0x4b, 0xbb, 0xd6, 0x93, 0x05, 0x12, 0xbc}}
class nsXULElement;
class nsIDOMXULElement;
namespace mozilla {
namespace gfx {
@ -438,7 +438,7 @@ public:
void DrawWindow(nsIDOMWindow* window, double x, double y, double w, double h,
const nsAString& bgColor, uint32_t flags,
mozilla::ErrorResult& error);
void AsyncDrawXULElement(nsXULElement& elem, double x, double y, double w,
void AsyncDrawXULElement(nsIDOMXULElement* elem, double x, double y, double w,
double h, const nsAString& bgColor, uint32_t flags,
mozilla::ErrorResult& error);

View File

@ -68,7 +68,6 @@ CPPSRCS += \
LOCAL_INCLUDES += \
-I$(topsrcdir)/js/xpconnect/wrappers \
-I$(topsrcdir)/content/xul/content/src \
$(NULL)
else

View File

@ -120,7 +120,6 @@ public:
virtual void MetadataLoaded(int aChannels,
int aRate,
bool aHasAudio,
bool aHasVideo,
const MetadataTags* aTags) MOZ_FINAL MOZ_OVERRIDE;
// Called by the video decoder object, on the main thread,
@ -476,12 +475,6 @@ protected:
*/
void QueueSelectResourceTask();
/**
* When loading a new source on an existing media element, make sure to reset
* everything that is accessible using the media element API.
*/
void ResetState();
/**
* The resource-fetch algorithm step of the load algorithm.
*/

View File

@ -123,7 +123,7 @@ nsHTMLAudioElement::MozSetup(uint32_t aChannels, uint32_t aRate)
return rv;
}
MetadataLoaded(aChannels, aRate, true, false, nullptr);
MetadataLoaded(aChannels, aRate, true, nullptr);
mAudioStream->SetVolume(mVolume);
return NS_OK;

View File

@ -733,20 +733,10 @@ NS_IMETHODIMP nsHTMLMediaElement::Load()
AbortExistingLoads();
SetPlaybackRate(mDefaultPlaybackRate);
QueueSelectResourceTask();
ResetState();
mIsRunningLoadMethod = false;
return NS_OK;
}
void nsHTMLMediaElement::ResetState()
{
mMediaSize = nsIntSize(-1, -1);
VideoFrameContainer* container = GetVideoFrameContainer();
if (container) {
container->Reset();
}
}
static bool HasSourceChildren(nsIContent *aElement)
{
for (nsIContent* child = aElement->GetFirstChild();
@ -2607,7 +2597,6 @@ void nsHTMLMediaElement::ProcessMediaFragmentURI()
void nsHTMLMediaElement::MetadataLoaded(int aChannels,
int aRate,
bool aHasAudio,
bool aHasVideo,
const MetadataTags* aTags)
{
mChannels = aChannels;
@ -2621,13 +2610,6 @@ void nsHTMLMediaElement::MetadataLoaded(int aChannels,
ProcessMediaFragmentURI();
mDecoder->SetFragmentEndTime(mFragmentEnd);
}
// If this element had a video track, but consists only of an audio track now,
// delete the VideoFrameContainer. This happens when the src is changed to an
// audio only file.
if (!aHasVideo) {
mVideoFrameContainer = nullptr;
}
}
void nsHTMLMediaElement::FirstFrameLoaded(bool aResourceFullyLoaded)
@ -2971,14 +2953,6 @@ void nsHTMLMediaElement::NotifyAutoplayDataReady()
VideoFrameContainer* nsHTMLMediaElement::GetVideoFrameContainer()
{
// If we have loaded the metadata, and the size of the video is still
// (-1, -1), the media has no video. Don't go a create a video frame
// container.
if (mReadyState >= nsIDOMHTMLMediaElement::HAVE_METADATA &&
mMediaSize == nsIntSize(-1, -1)) {
return nullptr;
}
if (mVideoFrameContainer)
return mVideoFrameContainer;

View File

@ -81,8 +81,8 @@ public:
// Return true if the transport layer supports seeking.
virtual bool IsMediaSeekable() = 0;
virtual void MetadataLoaded(int aChannels, int aRate, bool aHasAudio, bool aHasVideo, MetadataTags* aTags) = 0;
virtual void QueueMetadata(int64_t aTime, int aChannels, int aRate, bool aHasAudio, bool aHasVideo, MetadataTags* aTags) = 0;
virtual void MetadataLoaded(int aChannels, int aRate, bool aHasAudio, MetadataTags* aTags) = 0;
virtual void QueueMetadata(int64_t aTime, int aChannels, int aRate, bool aHasAudio, MetadataTags* aTags) = 0;
// Set the media end time in microseconds
virtual void SetMediaEndTime(int64_t aTime) = 0;
@ -119,25 +119,23 @@ class AudioMetadataEventRunner : public nsRunnable
private:
nsRefPtr<AbstractMediaDecoder> mDecoder;
public:
AudioMetadataEventRunner(AbstractMediaDecoder* aDecoder, int aChannels, int aRate, bool aHasAudio, bool aHasVideo, MetadataTags* aTags)
AudioMetadataEventRunner(AbstractMediaDecoder* aDecoder, int aChannels, int aRate, bool aHasAudio, MetadataTags* aTags)
: mDecoder(aDecoder),
mChannels(aChannels),
mRate(aRate),
mHasAudio(aHasAudio),
mHasVideo(aHasVideo),
mTags(aTags)
{}
NS_IMETHOD Run()
{
mDecoder->MetadataLoaded(mChannels, mRate, mHasAudio, mHasVideo, mTags);
mDecoder->MetadataLoaded(mChannels, mRate, mHasAudio, mTags);
return NS_OK;
}
int mChannels;
int mRate;
bool mHasAudio;
bool mHasVideo;
MetadataTags* mTags;
};

View File

@ -188,14 +188,18 @@ void MediaDecoder::DestroyDecodedStream()
// All streams are having their SourceMediaStream disconnected, so they
// need to be explicitly blocked again.
for (uint32_t i = 0; i < mOutputStreams.Length(); ++i) {
for (int32_t i = mOutputStreams.Length() - 1; i >= 0; --i) {
OutputStreamData& os = mOutputStreams[i];
// During cycle collection, nsDOMMediaStream can be destroyed and send
// its Destroy message before this decoder is destroyed. So we have to
// be careful not to send any messages after the Destroy().
if (!os.mStream->IsDestroyed()) {
os.mStream->ChangeExplicitBlockerCount(1);
if (os.mStream->IsDestroyed()) {
// Probably the DOM MediaStream was GCed. Clean up.
os.mPort->Destroy();
mOutputStreams.RemoveElementAt(i);
continue;
}
os.mStream->ChangeExplicitBlockerCount(1);
// Explicitly remove all existing ports. This is not strictly necessary but it's
// good form.
os.mPort->Destroy();
@ -220,8 +224,15 @@ void MediaDecoder::RecreateDecodedStream(int64_t aStartTimeUSecs)
// Note that the delay between removing ports in DestroyDecodedStream
// and adding new ones won't cause a glitch since all graph operations
// between main-thread stable states take effect atomically.
for (uint32_t i = 0; i < mOutputStreams.Length(); ++i) {
ConnectDecodedStreamToOutputStream(&mOutputStreams[i]);
for (int32_t i = mOutputStreams.Length() - 1; i >= 0; --i) {
OutputStreamData& os = mOutputStreams[i];
if (os.mStream->IsDestroyed()) {
// Probably the DOM MediaStream was GCed. Clean up.
// No need to destroy the port; all ports have been destroyed here.
mOutputStreams.RemoveElementAt(i);
continue;
}
ConnectDecodedStreamToOutputStream(&os);
}
mDecodedStream->mHaveBlockedForPlayState = mPlayState != PLAY_STATE_PLAYING;
@ -641,13 +652,12 @@ void MediaDecoder::QueueMetadata(int64_t aPublishTime,
int aChannels,
int aRate,
bool aHasAudio,
bool aHasVideo,
MetadataTags* aTags)
{
NS_ASSERTION(mDecoderStateMachine->OnDecodeThread(),
"Should be on decode thread.");
GetReentrantMonitor().AssertCurrentThreadIn();
mDecoderStateMachine->QueueMetadata(aPublishTime, aChannels, aRate, aHasAudio, aHasVideo, aTags);
mDecoderStateMachine->QueueMetadata(aPublishTime, aChannels, aRate, aHasAudio, aTags);
}
bool
@ -660,7 +670,7 @@ MediaDecoder::IsDataCachedToEndOfResource()
mResource->IsDataCachedToEndOfResource(mDecoderPosition));
}
void MediaDecoder::MetadataLoaded(int aChannels, int aRate, bool aHasAudio, bool aHasVideo, MetadataTags* aTags)
void MediaDecoder::MetadataLoaded(int aChannels, int aRate, bool aHasAudio, MetadataTags* aTags)
{
MOZ_ASSERT(NS_IsMainThread());
if (mShuttingDown) {
@ -682,7 +692,7 @@ void MediaDecoder::MetadataLoaded(int aChannels, int aRate, bool aHasAudio, bool
// Make sure the element and the frame (if any) are told about
// our new size.
Invalidate();
mOwner->MetadataLoaded(aChannels, aRate, aHasAudio, aHasVideo, aTags);
mOwner->MetadataLoaded(aChannels, aRate, aHasAudio, aTags);
}
if (!mCalledResourceLoaded) {
@ -811,12 +821,17 @@ void MediaDecoder::PlaybackEnded()
for (int32_t i = mOutputStreams.Length() - 1; i >= 0; --i) {
OutputStreamData& os = mOutputStreams[i];
if (os.mStream->IsDestroyed()) {
// Probably the DOM MediaStream was GCed. Clean up.
os.mPort->Destroy();
mOutputStreams.RemoveElementAt(i);
continue;
}
if (os.mFinishWhenEnded) {
// Shouldn't really be needed since mDecodedStream should already have
// finished, but doesn't hurt.
os.mStream->Finish();
os.mPort->Destroy();
os.mPort = nullptr;
// Not really needed but it keeps the invariant that a stream not
// connected to mDecodedStream is explicity blocked.
os.mStream->ChangeExplicitBlockerCount(1);

View File

@ -658,7 +658,6 @@ public:
int aChannels,
int aRate,
bool aHasAudio,
bool aHasVideo,
MetadataTags* aTags);
/******
@ -677,7 +676,7 @@ public:
// Called when the metadata from the media file has been loaded by the
// state machine. Call on the main thread only.
void MetadataLoaded(int aChannels, int aRate, bool aHasAudio, bool aHasVideo, MetadataTags* aTags);
void MetadataLoaded(int aChannels, int aRate, bool aHasAudio, MetadataTags* aTags);
// Called when the first frame has been loaded.
// Call on the main thread only.

View File

@ -56,7 +56,6 @@ public:
virtual void MetadataLoaded(int aChannels,
int aRate,
bool aHasAudio,
bool aHasVideo,
const MetadataTags* aTags) = 0;
// Called by the video decoder object, on the main thread,

View File

@ -506,7 +506,8 @@ void MediaDecoderStateMachine::SendStreamAudio(AudioData* aAudio,
DecodedStreamData* aStream,
AudioSegment* aOutput)
{
NS_ASSERTION(OnDecodeThread(), "Should be on decode thread.");
NS_ASSERTION(OnDecodeThread() ||
OnStateMachineThread(), "Should be on decode thread or state machine thread");
mDecoder->GetReentrantMonitor().AssertCurrentThreadIn();
if (aAudio->mTime <= aStream->mLastAudioPacketTime) {
@ -1218,7 +1219,6 @@ uint32_t MediaDecoderStateMachine::PlayFromAudioQueue(uint64_t aFrameOffset,
{
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
NS_WARN_IF_FALSE(IsPlaying(), "Should be playing");
NS_ASSERTION(!mAudioCaptured, "Audio cannot be captured here!");
// Awaken the decode loop if it's waiting for space to free up in the
// audio queue.
mDecoder->GetReentrantMonitor().NotifyAll();
@ -1861,7 +1861,6 @@ nsresult MediaDecoderStateMachine::DecodeMetadata()
mInfo.mAudioChannels,
mInfo.mAudioRate,
HasAudio(),
HasVideo(),
tags);
NS_DispatchToMainThread(metadataLoadedEvent, NS_DISPATCH_NORMAL);
@ -2787,12 +2786,7 @@ bool MediaDecoderStateMachine::IsShutdown()
return GetState() == DECODER_STATE_SHUTDOWN;
}
void MediaDecoderStateMachine::QueueMetadata(int64_t aPublishTime,
int aChannels,
int aRate,
bool aHasAudio,
bool aHasVideo,
MetadataTags* aTags)
void MediaDecoderStateMachine::QueueMetadata(int64_t aPublishTime, int aChannels, int aRate, bool aHasAudio, MetadataTags* aTags)
{
NS_ASSERTION(OnDecodeThread(), "Should be on decode thread.");
mDecoder->GetReentrantMonitor().AssertCurrentThreadIn();

View File

@ -319,7 +319,7 @@ public:
// shutting down. The decoder monitor must be held while calling this.
bool IsShutdown();
void QueueMetadata(int64_t aPublishTime, int aChannels, int aRate, bool aHasAudio, bool aHasVideo, MetadataTags* aTags);
void QueueMetadata(int64_t aPublishTime, int aChannels, int aRate, bool aHasAudio, MetadataTags* aTags);
protected:
virtual uint32_t GetAmpleVideoFrames() { return mAmpleVideoFrames; }

View File

@ -28,8 +28,6 @@ namespace mozilla {
int mChannels;
// True if this media has an audio track.
bool mHasAudio;
// True if this media has a video track.
bool mHasVideo;
};
// This class encapsulate the logic to give the metadata from the reader to
@ -55,7 +53,6 @@ namespace mozilla {
metadata->mChannels,
metadata->mRate,
metadata->mHasAudio,
metadata->mHasVideo,
metadata->mTags.forget());
NS_DispatchToMainThread(metadataUpdatedEvent, NS_DISPATCH_NORMAL);
mMetadataQueue.popFirst();

View File

@ -67,15 +67,7 @@ void VideoFrameContainer::SetCurrentFrame(const gfxIntSize& aIntrinsicSize,
mPaintTarget = aTargetTime;
}
void VideoFrameContainer::Reset()
{
ClearCurrentFrame(true);
Invalidate();
mPaintDelay = TimeDuration();
mImageContainer->ResetPaintCount();
}
void VideoFrameContainer::ClearCurrentFrame(bool aResetSize)
void VideoFrameContainer::ClearCurrentFrame()
{
MutexAutoLock lock(mMutex);
@ -84,7 +76,6 @@ void VideoFrameContainer::ClearCurrentFrame(bool aResetSize)
nsRefPtr<Image> kungFuDeathGrip;
kungFuDeathGrip = mImageContainer->LockCurrentImage();
mImageContainer->UnlockCurrentImage();
mImageSizeChanged = aResetSize;
mImageContainer->SetCurrentImage(nullptr);

View File

@ -46,9 +46,7 @@ public:
// Call on any thread
void SetCurrentFrame(const gfxIntSize& aIntrinsicSize, Image* aImage,
TimeStamp aTargetTime);
void ClearCurrentFrame(bool aResetSize = false);
// Reset the VideoFrameContainer
void Reset();
void ClearCurrentFrame();
// Time in seconds by which the last painted video frame was late by.
// E.g. if the last painted frame should have been painted at time t,
// but was actually painted at t+n, this returns n in seconds. Threadsafe.

View File

@ -732,7 +732,6 @@ bool OggReader::ReadOggChain()
channels,
rate,
HasAudio(),
HasVideo(),
tags);
}
return true;

View File

@ -133,7 +133,7 @@ MOCHITEST_FILES = \
test_media_sniffer.html \
contentType.sjs \
test_streams_srcObject.html \
test_reset_src.html \
test_streams_gc.html \
$(filter disabled-for-intermittent-failures--bug-608634, test_error_in_video_document.html) \
$(NULL)

View File

@ -1,81 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=804875
-->
<head>
<title>Test for bug 804875</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="manifest.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=804875">Mozilla Bug 804875</a>
<video style="border: 4px solid red" controls></video>
<canvas></canvas>
<pre id="test">
<script class="testbody" type="text/javascript">
function onLoadedMetadata_Audio(e) {
var t = e.target;
is(t.videoHeight, 0, "Audio should a zero for videoHeight.");
is(t.videoWidth, 0, "Audio should a zero for videoWidth.");
is(t.mozPaintedFrames, 0, "Audio should a zero for mozPaintedFrames.");
is(t.mozFrameDelay, 0, "Audio should a zero for mozFrameDelay.");
var c = document.getElementsByTagName("canvas")[0].getContext("2d");
try {
c.drawImage(t, 0, 0, t.videoHeight, t.videoWidth);
} catch (e) {
ok(true, "Trying to draw to a canvas should throw, since we don't have a frame anymore");
SimpleTest.finish();
return;
}
ok(false, "We should not succeed to draw a video frame on the canvas.");
}
function onTimeUpdate_Video(e) {
var t = e.target;
if (t.currentTime < t.duration / 4) {
return;
}
t.removeEventListener("timeupdate", onTimeUpdate_Video);
ok(t.mozPaintedFrames > 0, "mozPaintedFrames should be positive, is " + t.mozPaintedFrames + ".");
ok(t.mozFrameDelay >= 0, "mozFrameDelay should be positive, is " + t.mozFrameDelay + ".");
var source = getPlayableAudio(gPlayTests);
if (!source) {
todo("No audio file available.")
SimpleTest.finish();
} else {
t.removeEventListener("loadedmetadata", onLoadedMetadata_Video);
t.addEventListener("loadedmetadata", onLoadedMetadata_Audio);
t.src = source.name;
}
}
function onLoadedMetadata_Video(e) {
var t = e.target;
ok(t.videoHeight != 0, "We should have a videoHeight.");
ok(t.videoWidth != 0, "We should have a videoWidth.");
t.addEventListener("timeupdate", onTimeUpdate_Video);
t.play();
}
var v = document.getElementsByTagName("video")[0];
var source = getPlayableVideo(gPlayTests);
if (!source) {
todo("No video file available.");
} else {
v.addEventListener("loadedmetadata", onLoadedMetadata_Video);
v.src = source.name;
dump(source.name);
SimpleTest.waitForExplicitFinish();
}
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test garbage collection of captured stream (bug 806754)</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
</head>
<body onload="doTest()">
<audio id="a"></audio>
<pre id="test">
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
var a = document.getElementById('a');
a.src = getPlayableAudio(gSmallTests).name;
function forceGC() {
SpecialPowers.gc();
SpecialPowers.forceGC();
SpecialPowers.forceCC();
}
function doTest() {
a.mozCaptureStreamUntilEnded();
a.addEventListener("seeked", function() {
a.play();
a.addEventListener("play", function() {
a.addEventListener("ended", function() {
ok(true, "GC completed OK");
SimpleTest.finish();
}, false);
}, false);
}, false);
a.currentTime = a.duration;
setTimeout(forceGC, 0);
}
</script>
</pre>
</body>
</html>

View File

@ -89,6 +89,11 @@ public:
/* Stop the device and release the corresponding MediaStream */
virtual nsresult Stop(SourceMediaStream *aSource, TrackID aID) = 0;
/* Change device configuration. */
virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise) = 0;
/* Return false if device is currently allocated or started */
bool IsAvailable() {
if (mState == kAllocated || mState == kStarted) {

View File

@ -44,6 +44,9 @@ public:
virtual nsresult Start(SourceMediaStream*, TrackID);
virtual nsresult Stop(SourceMediaStream*, TrackID);
virtual nsresult Snapshot(uint32_t aDuration, nsIDOMFile** aFile);
virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise) { return NS_OK; };
virtual void NotifyPull(MediaStreamGraph* aGraph, StreamTime aDesiredTime);
virtual void NotifyPull(MediaStreamGraph* aGraph,
SourceMediaStream *aSource,
@ -86,6 +89,9 @@ public:
virtual nsresult Start(SourceMediaStream*, TrackID);
virtual nsresult Stop(SourceMediaStream*, TrackID);
virtual nsresult Snapshot(uint32_t aDuration, nsIDOMFile** aFile);
virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise) { return NS_OK; };
virtual void NotifyPull(MediaStreamGraph* aGraph, StreamTime aDesiredTime);
virtual void NotifyPull(MediaStreamGraph* aGraph,
SourceMediaStream *aSource,

View File

@ -35,6 +35,7 @@
#include "voice_engine/include/voe_audio_processing.h"
#include "voice_engine/include/voe_volume_control.h"
#include "voice_engine/include/voe_external_media.h"
#include "voice_engine/include/voe_audio_processing.h"
// Video Engine
#include "video_engine/include/vie_base.h"
@ -90,6 +91,9 @@ public:
virtual nsresult Start(SourceMediaStream*, TrackID);
virtual nsresult Stop(SourceMediaStream*, TrackID);
virtual nsresult Snapshot(uint32_t aDuration, nsIDOMFile** aFile);
virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise) { return NS_OK; };
virtual void NotifyPull(MediaStreamGraph* aGraph,
SourceMediaStream *aSource,
TrackID aId,
@ -177,6 +181,10 @@ public:
, mCapIndex(aIndex)
, mChannel(-1)
, mInitDone(false)
, mEchoOn(false), mAgcOn(false), mNoiseOn(false)
, mEchoCancel(webrtc::kEcDefault)
, mAGC(webrtc::kAgcDefault)
, mNoiseSuppress(webrtc::kNsDefault)
, mNullTransport(nullptr) {
MOZ_ASSERT(aVoiceEnginePtr);
mState = kReleased;
@ -194,6 +202,10 @@ public:
virtual nsresult Start(SourceMediaStream*, TrackID);
virtual nsresult Stop(SourceMediaStream*, TrackID);
virtual nsresult Snapshot(uint32_t aDuration, nsIDOMFile** aFile);
virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise);
virtual void NotifyPull(MediaStreamGraph* aGraph,
SourceMediaStream *aSource,
TrackID aId,
@ -218,6 +230,7 @@ private:
webrtc::VoEBase* mVoEBase;
webrtc::VoEExternalMedia* mVoERender;
webrtc::VoENetwork* mVoENetwork;
webrtc::VoEAudioProcessing *mVoEProcessing;
// mMonitor protects mSources[] access/changes, and transitions of mState
// from kStarted to kStopped (which are combined with EndTrack()).
@ -233,6 +246,11 @@ private:
nsString mDeviceName;
nsString mDeviceUUID;
bool mEchoOn, mAgcOn, mNoiseOn;
webrtc::EcModes mEchoCancel;
webrtc::AgcModes mAGC;
webrtc::NsModes mNoiseSuppress;
NullTransport *mNullTransport;
};

View File

@ -46,6 +46,60 @@ MediaEngineWebRTCAudioSource::GetUUID(nsAString& aUUID)
return;
}
nsresult
MediaEngineWebRTCAudioSource::Config(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise)
{
LOG(("Audio config: aec: %d, agc: %d, noise: %d",
aEchoOn ? aEcho : -1,
aAgcOn ? aAGC : -1,
aNoiseOn ? aNoise : -1));
bool update_agc = (mAgcOn == aAgcOn);
bool update_noise = (mNoiseOn == aNoiseOn);
mAgcOn = aAgcOn;
mNoiseOn = aNoiseOn;
if ((webrtc::AgcModes) aAGC != webrtc::kAgcUnchanged) {
if (mAGC != (webrtc::AgcModes) aAGC) {
update_agc = true;
mAGC = (webrtc::AgcModes) aAGC;
}
}
if ((webrtc::NsModes) aNoise != webrtc::kNsUnchanged) {
if (mNoiseSuppress != (webrtc::NsModes) aNoise) {
update_noise = true;
mNoiseSuppress = (webrtc::NsModes) aNoise;
}
}
if (mInitDone) {
int error;
#if 0
// Until we can support feeding our full output audio from the browser
// through the MediaStream, this won't work. Or we need to move AEC to
// below audio input and output, perhaps invoked from here.
mEchoOn = aEchoOn;
if ((webrtc::EcModes) aEcho != webrtc::kEcUnchanged)
mEchoCancel = (webrtc::EcModes) aEcho;
mVoEProcessing->SetEcStatus(mEchoOn, aEcho);
#else
(void) aEcho; (void) aEchoOn; // suppress warnings
#endif
if (update_agc &&
0 != (error = mVoEProcessing->SetAgcStatus(mAgcOn, (webrtc::AgcModes) aAGC))) {
LOG(("%s Error setting AGC Status: %d ",__FUNCTION__, error));
}
if (update_noise &&
0 != (error = mVoEProcessing->SetNsStatus(mNoiseOn, (webrtc::NsModes) aNoise))) {
LOG(("%s Error setting NoiseSuppression Status: %d ",__FUNCTION__, error));
}
}
return NS_OK;
}
nsresult
MediaEngineWebRTCAudioSource::Allocate()
{
@ -106,6 +160,11 @@ MediaEngineWebRTCAudioSource::Start(SourceMediaStream* aStream, TrackID aID)
}
mState = kStarted;
// Configure audio processing in webrtc code
Config(mEchoOn, webrtc::kEcUnchanged,
mAgcOn, webrtc::kAgcUnchanged,
mNoiseOn, webrtc::kNsUnchanged);
if (mVoEBase->StartReceive(mChannel)) {
return NS_ERROR_FAILURE;
}
@ -192,6 +251,11 @@ MediaEngineWebRTCAudioSource::Init()
return;
}
mVoEProcessing = webrtc::VoEAudioProcessing::GetInterface(mVoiceEngine);
if (!mVoEProcessing) {
return;
}
mChannel = mVoEBase->CreateChannel();
if (mChannel < 0) {
return;

View File

@ -13,7 +13,7 @@
using namespace mozilla;
NS_IMPL_ISUPPORTS1(DOMSVGTests, nsIDOMSVGTests)
NS_IMPL_ISUPPORTS0(DOMSVGTests)
nsIAtom** DOMSVGTests::sStringListNames[3] =
{
@ -27,14 +27,6 @@ DOMSVGTests::DOMSVGTests()
mStringListAttributes[LANGUAGE].SetIsCommaSeparated(true);
}
/* readonly attribute nsIDOMSVGStringList requiredFeatures; */
NS_IMETHODIMP
DOMSVGTests::GetRequiredFeatures(nsIDOMSVGStringList * *aRequiredFeatures)
{
*aRequiredFeatures = RequiredFeatures().get();
return NS_OK;
}
already_AddRefed<nsIDOMSVGStringList>
DOMSVGTests::RequiredFeatures()
{
@ -43,14 +35,6 @@ DOMSVGTests::RequiredFeatures()
&mStringListAttributes[FEATURES], element, true, FEATURES).get();
}
/* readonly attribute nsIDOMSVGStringList requiredExtensions; */
NS_IMETHODIMP
DOMSVGTests::GetRequiredExtensions(nsIDOMSVGStringList * *aRequiredExtensions)
{
*aRequiredExtensions = RequiredExtensions().get();
return NS_OK;
}
already_AddRefed<nsIDOMSVGStringList>
DOMSVGTests::RequiredExtensions()
{
@ -59,14 +43,6 @@ DOMSVGTests::RequiredExtensions()
&mStringListAttributes[EXTENSIONS], element, true, EXTENSIONS).get();
}
/* readonly attribute nsIDOMSVGStringList systemLanguage; */
NS_IMETHODIMP
DOMSVGTests::GetSystemLanguage(nsIDOMSVGStringList * *aSystemLanguage)
{
*aSystemLanguage = SystemLanguage().get();
return NS_OK;
}
already_AddRefed<nsIDOMSVGStringList>
DOMSVGTests::SystemLanguage()
{
@ -75,14 +51,6 @@ DOMSVGTests::SystemLanguage()
&mStringListAttributes[LANGUAGE], element, true, LANGUAGE).get();
}
/* boolean hasExtension (in DOMString extension); */
NS_IMETHODIMP
DOMSVGTests::HasExtension(const nsAString & extension, bool *_retval)
{
*_retval = HasExtension(extension);
return NS_OK;
}
bool
DOMSVGTests::HasExtension(const nsAString& aExtension)
{

View File

@ -6,24 +6,28 @@
#ifndef MOZILLA_DOMSVGTESTS_H__
#define MOZILLA_DOMSVGTESTS_H__
#include "nsIDOMSVGTests.h"
#include "nsStringFwd.h"
#include "SVGStringList.h"
#include "nsCOMPtr.h"
class nsAttrValue;
class nsIAtom;
class nsIDOMSVGStringList;
class nsString;
namespace mozilla {
class DOMSVGStringList;
}
class DOMSVGTests : public nsIDOMSVGTests
#define MOZILLA_DOMSVGTESTS_IID \
{ 0x92370da8, 0xda28, 0x4895, \
{0x9b, 0x1b, 0xe0, 0x06, 0x0d, 0xb7, 0x3f, 0xc3 } }
class DOMSVGTests : public nsISupports
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGTESTS_IID)
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMSVGTESTS
DOMSVGTests();
virtual ~DOMSVGTests() {}
@ -97,4 +101,6 @@ private:
static nsIAtom** sStringListNames[3];
};
NS_DEFINE_STATIC_IID_ACCESSOR(DOMSVGTests, MOZILLA_DOMSVGTESTS_IID)
#endif // MOZILLA_DOMSVGTESTS_H__

View File

@ -49,7 +49,6 @@ CPPSRCS = \
nsSVGInteger.cpp \
nsSVGIntegerPair.cpp \
nsSVGLength2.cpp \
nsSVGMarkerElement.cpp \
nsSVGNumber2.cpp \
nsSVGNumberPair.cpp \
nsSVGPathDataParser.cpp \
@ -94,6 +93,7 @@ CPPSRCS = \
SVGLengthListSMILType.cpp \
SVGLineElement.cpp \
SVGLocatableElement.cpp \
SVGMarkerElement.cpp \
SVGMaskElement.cpp \
SVGMatrix.cpp \
SVGMetadataElement.cpp \
@ -177,6 +177,7 @@ EXPORTS_mozilla/dom = \
SVGImageElement.h \
SVGLineElement.h \
SVGLocatableElement.h \
SVGMarkerElement.h \
SVGMaskElement.h \
SVGMatrix.h \
SVGMetadataElement.h \

View File

@ -30,16 +30,12 @@ SVGAnimatedAngle::WrapObject(JSContext* aCx, JSObject* aScope, bool* aTriedToWra
already_AddRefed<SVGAngle>
SVGAnimatedAngle::BaseVal()
{
nsRefPtr<SVGAngle> angle;
mVal->ToDOMBaseVal(getter_AddRefs(angle), mSVGElement);
return angle.forget();
return mVal->ToDOMBaseVal(mSVGElement);
}
already_AddRefed<SVGAngle>
SVGAnimatedAngle::AnimVal()
{
nsRefPtr<SVGAngle> angle;
mVal->ToDOMAnimVal(getter_AddRefs(angle), mSVGElement);
return angle.forget();
return mVal->ToDOMAnimVal(mSVGElement);
}

View File

@ -29,12 +29,6 @@ public:
}
~SVGAnimatedAngle();
NS_IMETHOD GetBaseVal(nsISupports **aBaseVal)
{ *aBaseVal = BaseVal().get(); return NS_OK; }
NS_IMETHOD GetAnimVal(nsISupports **aAnimVal)
{ *aAnimVal = AnimVal().get(); return NS_OK; }
// WebIDL
nsSVGElement* GetParentObject() { return mSVGElement; }
virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap);

View File

@ -23,7 +23,7 @@ NS_IMPL_RELEASE_INHERITED(SVGAnimationElement, SVGAnimationElementBase)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGAnimationElement)
NS_INTERFACE_MAP_ENTRY(nsISMILAnimationElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMElementTimeControl)
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGTests)
NS_INTERFACE_MAP_ENTRY(DOMSVGTests)
NS_INTERFACE_MAP_END_INHERITING(SVGAnimationElementBase)
// Cycle collection magic -- based on nsSVGUseElement

View File

@ -16,7 +16,7 @@ NS_IMPL_ADDREF_INHERITED(SVGGraphicsElement, SVGGraphicsElementBase)
NS_IMPL_RELEASE_INHERITED(SVGGraphicsElement, SVGGraphicsElementBase)
NS_INTERFACE_MAP_BEGIN(SVGGraphicsElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGTests)
NS_INTERFACE_MAP_ENTRY(DOMSVGTests)
NS_INTERFACE_MAP_END_INHERITING(SVGGraphicsElementBase)
//----------------------------------------------------------------------

View File

@ -9,16 +9,29 @@
#include "nsCOMPtr.h"
#include "SVGAnimatedPreserveAspectRatio.h"
#include "nsError.h"
#include "nsSVGMarkerElement.h"
#include "mozilla/dom/SVGAngle.h"
#include "mozilla/dom/SVGAnimatedAngle.h"
#include "mozilla/dom/SVGAnimatedLength.h"
#include "mozilla/dom/SVGMarkerElement.h"
#include "mozilla/dom/SVGMarkerElementBinding.h"
#include "gfxMatrix.h"
#include "nsContentUtils.h" // NS_ENSURE_FINITE
#include "SVGContentUtils.h"
#include "SVGAngle.h"
using namespace mozilla;
using namespace mozilla::dom;
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Marker)
nsSVGElement::LengthInfo nsSVGMarkerElement::sLengthInfo[4] =
DOMCI_NODE_DATA(SVGMarkerElement, mozilla::dom::SVGMarkerElement)
namespace mozilla {
namespace dom {
JSObject*
SVGMarkerElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
{
return SVGMarkerElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
nsSVGElement::LengthInfo SVGMarkerElement::sLengthInfo[4] =
{
{ &nsGkAtoms::refX, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X },
{ &nsGkAtoms::refY, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::Y },
@ -26,13 +39,13 @@ nsSVGElement::LengthInfo nsSVGMarkerElement::sLengthInfo[4] =
{ &nsGkAtoms::markerHeight, 3, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::Y },
};
nsSVGEnumMapping nsSVGMarkerElement::sUnitsMap[] = {
nsSVGEnumMapping SVGMarkerElement::sUnitsMap[] = {
{&nsGkAtoms::strokeWidth, nsIDOMSVGMarkerElement::SVG_MARKERUNITS_STROKEWIDTH},
{&nsGkAtoms::userSpaceOnUse, nsIDOMSVGMarkerElement::SVG_MARKERUNITS_USERSPACEONUSE},
{nullptr, 0}
};
nsSVGElement::EnumInfo nsSVGMarkerElement::sEnumInfo[1] =
nsSVGElement::EnumInfo SVGMarkerElement::sEnumInfo[1] =
{
{ &nsGkAtoms::markerUnits,
sUnitsMap,
@ -40,13 +53,11 @@ nsSVGElement::EnumInfo nsSVGMarkerElement::sEnumInfo[1] =
}
};
nsSVGElement::AngleInfo nsSVGMarkerElement::sAngleInfo[1] =
nsSVGElement::AngleInfo SVGMarkerElement::sAngleInfo[1] =
{
{ &nsGkAtoms::orient, 0, SVG_ANGLETYPE_UNSPECIFIED }
};
NS_IMPL_NS_NEW_SVG_ELEMENT(Marker)
//----------------------------------------------------------------------
// nsISupports methods
@ -61,17 +72,15 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGOrientType::DOMAnimatedEnum)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAnimatedEnumeration)
NS_INTERFACE_MAP_END
NS_IMPL_ADDREF_INHERITED(nsSVGMarkerElement,nsSVGMarkerElementBase)
NS_IMPL_RELEASE_INHERITED(nsSVGMarkerElement,nsSVGMarkerElementBase)
NS_IMPL_ADDREF_INHERITED(SVGMarkerElement,SVGMarkerElementBase)
NS_IMPL_RELEASE_INHERITED(SVGMarkerElement,SVGMarkerElementBase)
DOMCI_NODE_DATA(SVGMarkerElement, nsSVGMarkerElement)
NS_INTERFACE_TABLE_HEAD(nsSVGMarkerElement)
NS_NODE_INTERFACE_TABLE5(nsSVGMarkerElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement, nsIDOMSVGFitToViewBox,
NS_INTERFACE_TABLE_HEAD(SVGMarkerElement)
NS_NODE_INTERFACE_TABLE4(SVGMarkerElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
nsIDOMSVGMarkerElement)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGMarkerElement)
NS_INTERFACE_MAP_END_INHERITING(nsSVGMarkerElementBase)
NS_INTERFACE_MAP_END_INHERITING(SVGMarkerElementBase)
//----------------------------------------------------------------------
// Implementation
@ -93,95 +102,139 @@ nsSVGOrientType::SetBaseValue(uint16_t aValue,
return NS_ERROR_DOM_SYNTAX_ERR;
}
nsresult
nsSVGOrientType::ToDOMAnimatedEnum(nsIDOMSVGAnimatedEnumeration **aResult,
nsSVGElement *aSVGElement)
already_AddRefed<nsIDOMSVGAnimatedEnumeration>
nsSVGOrientType::ToDOMAnimatedEnum(nsSVGElement *aSVGElement)
{
*aResult = new DOMAnimatedEnum(this, aSVGElement);
if (!*aResult)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*aResult);
return NS_OK;
nsCOMPtr<nsIDOMSVGAnimatedEnumeration> toReturn =
new DOMAnimatedEnum(this, aSVGElement);
return toReturn.forget();
}
nsSVGMarkerElement::nsSVGMarkerElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsSVGMarkerElementBase(aNodeInfo), mCoordCtx(nullptr)
SVGMarkerElement::SVGMarkerElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: SVGMarkerElementBase(aNodeInfo), mCoordCtx(nullptr)
{
SetIsDOMBinding();
}
//----------------------------------------------------------------------
// nsIDOMNode methods
NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGMarkerElement)
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGMarkerElement)
//----------------------------------------------------------------------
// nsIDOMSVGFitToViewBox methods
/* readonly attribute nsIDOMSVGAnimatedRect viewBox; */
NS_IMETHODIMP nsSVGMarkerElement::GetViewBox(nsIDOMSVGAnimatedRect * *aViewBox)
already_AddRefed<nsIDOMSVGAnimatedRect>
SVGMarkerElement::ViewBox()
{
return mViewBox.ToDOMAnimatedRect(aViewBox, this);
nsCOMPtr<nsIDOMSVGAnimatedRect> rect;
mViewBox.ToDOMAnimatedRect(getter_AddRefs(rect), this);
return rect.forget();
}
/* readonly attribute SVGPreserveAspectRatio preserveAspectRatio; */
NS_IMETHODIMP
nsSVGMarkerElement::GetPreserveAspectRatio(nsISupports
**aPreserveAspectRatio)
already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
SVGMarkerElement::PreserveAspectRatio()
{
nsRefPtr<DOMSVGAnimatedPreserveAspectRatio> ratio;
mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(getter_AddRefs(ratio), this);
ratio.forget(aPreserveAspectRatio);
return NS_OK;
return ratio.forget();
}
//----------------------------------------------------------------------
// nsIDOMSVGMarkerElement methods
/* readonly attribute nsIDOMSVGAnimatedLength refX; */
NS_IMETHODIMP nsSVGMarkerElement::GetRefX(nsIDOMSVGAnimatedLength * *aRefX)
NS_IMETHODIMP SVGMarkerElement::GetRefX(nsIDOMSVGAnimatedLength * *aRefX)
{
return mLengthAttributes[REFX].ToDOMAnimatedLength(aRefX, this);
*aRefX = RefX().get();
return NS_OK;
}
already_AddRefed<SVGAnimatedLength>
SVGMarkerElement::RefX()
{
return mLengthAttributes[REFX].ToDOMAnimatedLength(this);
}
/* readonly attribute nsIDOMSVGAnimatedLength refY; */
NS_IMETHODIMP nsSVGMarkerElement::GetRefY(nsIDOMSVGAnimatedLength * *aRefY)
NS_IMETHODIMP SVGMarkerElement::GetRefY(nsIDOMSVGAnimatedLength * *aRefY)
{
return mLengthAttributes[REFY].ToDOMAnimatedLength(aRefY, this);
*aRefY = RefY().get();
return NS_OK;
}
already_AddRefed<SVGAnimatedLength>
SVGMarkerElement::RefY()
{
return mLengthAttributes[REFY].ToDOMAnimatedLength(this);
}
/* readonly attribute nsIDOMSVGAnimatedEnumeration markerUnits; */
NS_IMETHODIMP nsSVGMarkerElement::GetMarkerUnits(nsIDOMSVGAnimatedEnumeration * *aMarkerUnits)
NS_IMETHODIMP SVGMarkerElement::GetMarkerUnits(nsIDOMSVGAnimatedEnumeration * *aMarkerUnits)
{
return mEnumAttributes[MARKERUNITS].ToDOMAnimatedEnum(aMarkerUnits, this);
*aMarkerUnits = MarkerUnits().get();
return NS_OK;
}
already_AddRefed<nsIDOMSVGAnimatedEnumeration>
SVGMarkerElement::MarkerUnits()
{
return mEnumAttributes[MARKERUNITS].ToDOMAnimatedEnum(this);
}
/* readonly attribute nsIDOMSVGAnimatedLength markerWidth; */
NS_IMETHODIMP nsSVGMarkerElement::GetMarkerWidth(nsIDOMSVGAnimatedLength * *aMarkerWidth)
NS_IMETHODIMP SVGMarkerElement::GetMarkerWidth(nsIDOMSVGAnimatedLength * *aMarkerWidth)
{
return mLengthAttributes[MARKERWIDTH].ToDOMAnimatedLength(aMarkerWidth, this);
*aMarkerWidth = MarkerWidth().get();
return NS_OK;
}
already_AddRefed<SVGAnimatedLength>
SVGMarkerElement::MarkerWidth()
{
return mLengthAttributes[MARKERWIDTH].ToDOMAnimatedLength(this);
}
/* readonly attribute nsIDOMSVGAnimatedLength markerHeight; */
NS_IMETHODIMP nsSVGMarkerElement::GetMarkerHeight(nsIDOMSVGAnimatedLength * *aMarkerHeight)
NS_IMETHODIMP SVGMarkerElement::GetMarkerHeight(nsIDOMSVGAnimatedLength * *aMarkerHeight)
{
return mLengthAttributes[MARKERHEIGHT].ToDOMAnimatedLength(aMarkerHeight, this);
*aMarkerHeight = MarkerHeight().get();
return NS_OK;
}
already_AddRefed<SVGAnimatedLength>
SVGMarkerElement::MarkerHeight()
{
return mLengthAttributes[MARKERHEIGHT].ToDOMAnimatedLength(this);
}
/* readonly attribute nsIDOMSVGAnimatedEnumeration orientType; */
NS_IMETHODIMP nsSVGMarkerElement::GetOrientType(nsIDOMSVGAnimatedEnumeration * *aOrientType)
NS_IMETHODIMP SVGMarkerElement::GetOrientType(nsIDOMSVGAnimatedEnumeration * *aOrientType)
{
return mOrientType.ToDOMAnimatedEnum(aOrientType, this);
*aOrientType = OrientType().get();
return NS_OK;
}
already_AddRefed<nsIDOMSVGAnimatedEnumeration>
SVGMarkerElement::OrientType()
{
return mOrientType.ToDOMAnimatedEnum(this);
}
/* readonly attribute SVGAnimatedAngle orientAngle; */
NS_IMETHODIMP nsSVGMarkerElement::GetOrientAngle(nsISupports * *aOrientAngle)
NS_IMETHODIMP SVGMarkerElement::GetOrientAngle(nsISupports * *aOrientAngle)
{
return mAngleAttributes[ORIENT].ToDOMAnimatedAngle(aOrientAngle, this);
*aOrientAngle = OrientAngle().get();
return NS_OK;
}
already_AddRefed<SVGAnimatedAngle>
SVGMarkerElement::OrientAngle()
{
return mAngleAttributes[ORIENT].ToDOMAnimatedAngle(this);
}
/* void setOrientToAuto (); */
NS_IMETHODIMP nsSVGMarkerElement::SetOrientToAuto()
NS_IMETHODIMP SVGMarkerElement::SetOrientToAuto()
{
SetAttr(kNameSpaceID_None, nsGkAtoms::orient, nullptr,
NS_LITERAL_STRING("auto"), true);
@ -189,24 +242,33 @@ NS_IMETHODIMP nsSVGMarkerElement::SetOrientToAuto()
}
/* void setOrientToAngle (in SVGAngle angle); */
NS_IMETHODIMP nsSVGMarkerElement::SetOrientToAngle(nsISupports *aAngle)
NS_IMETHODIMP SVGMarkerElement::SetOrientToAngle(nsISupports *aAngle)
{
nsCOMPtr<dom::SVGAngle> angle = do_QueryInterface(aAngle);
if (!angle)
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
float f = angle->Value();
NS_ENSURE_FINITE(f, NS_ERROR_DOM_SVG_WRONG_TYPE_ERR);
mAngleAttributes[ORIENT].SetBaseValue(f, this, true);
ErrorResult rv;
SetOrientToAngle(*angle, rv);
return rv.ErrorCode();
}
return NS_OK;
void
SVGMarkerElement::SetOrientToAngle(SVGAngle& angle, ErrorResult& rv)
{
float f = angle.Value();
if (!NS_finite(f)) {
rv.Throw(NS_ERROR_DOM_SVG_WRONG_TYPE_ERR);
return;
}
mAngleAttributes[ORIENT].SetBaseValue(f, this, true);
}
//----------------------------------------------------------------------
// nsIContent methods
NS_IMETHODIMP_(bool)
nsSVGMarkerElement::IsAttributeMapped(const nsIAtom* name) const
SVGMarkerElement::IsAttributeMapped(const nsIAtom* name) const
{
static const MappedAttributeEntry* const map[] = {
sFEFloodMap,
@ -216,18 +278,21 @@ nsSVGMarkerElement::IsAttributeMapped(const nsIAtom* name) const
sLightingEffectsMap,
sMarkersMap,
sTextContentElementsMap,
sViewportsMap
sViewportsMap,
sColorMap,
sFillStrokeMap,
sGraphicsMap
};
return FindAttributeDependence(name, map) ||
nsSVGMarkerElementBase::IsAttributeMapped(name);
SVGMarkerElementBase::IsAttributeMapped(name);
}
//----------------------------------------------------------------------
// nsSVGElement methods
bool
nsSVGMarkerElement::GetAttr(int32_t aNameSpaceID, nsIAtom* aName,
SVGMarkerElement::GetAttr(int32_t aNameSpaceID, nsIAtom* aName,
nsAString &aResult) const
{
if (aNameSpaceID == kNameSpaceID_None &&
@ -236,11 +301,11 @@ nsSVGMarkerElement::GetAttr(int32_t aNameSpaceID, nsIAtom* aName,
aResult.AssignLiteral("auto");
return true;
}
return nsSVGMarkerElementBase::GetAttr(aNameSpaceID, aName, aResult);
return SVGMarkerElementBase::GetAttr(aNameSpaceID, aName, aResult);
}
bool
nsSVGMarkerElement::ParseAttribute(int32_t aNameSpaceID, nsIAtom* aName,
SVGMarkerElement::ParseAttribute(int32_t aNameSpaceID, nsIAtom* aName,
const nsAString& aValue,
nsAttrValue& aResult)
{
@ -252,12 +317,12 @@ nsSVGMarkerElement::ParseAttribute(int32_t aNameSpaceID, nsIAtom* aName,
}
mOrientType.SetBaseValue(SVG_MARKER_ORIENT_ANGLE);
}
return nsSVGMarkerElementBase::ParseAttribute(aNameSpaceID, aName,
return SVGMarkerElementBase::ParseAttribute(aNameSpaceID, aName,
aValue, aResult);
}
nsresult
nsSVGMarkerElement::UnsetAttr(int32_t aNamespaceID, nsIAtom* aName,
SVGMarkerElement::UnsetAttr(int32_t aNamespaceID, nsIAtom* aName,
bool aNotify)
{
if (aNamespaceID == kNameSpaceID_None) {
@ -273,14 +338,14 @@ nsSVGMarkerElement::UnsetAttr(int32_t aNamespaceID, nsIAtom* aName,
// nsSVGElement methods
void
nsSVGMarkerElement::SetParentCoordCtxProvider(SVGSVGElement *aContext)
SVGMarkerElement::SetParentCoordCtxProvider(SVGSVGElement *aContext)
{
mCoordCtx = aContext;
mViewBoxToViewportTransform = nullptr;
}
/* virtual */ bool
nsSVGMarkerElement::HasValidDimensions() const
SVGMarkerElement::HasValidDimensions() const
{
return (!mLengthAttributes[MARKERWIDTH].IsExplicitlySet() ||
mLengthAttributes[MARKERWIDTH].GetAnimValInSpecifiedUnits() > 0) &&
@ -289,34 +354,34 @@ nsSVGMarkerElement::HasValidDimensions() const
}
nsSVGElement::LengthAttributesInfo
nsSVGMarkerElement::GetLengthInfo()
SVGMarkerElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
ArrayLength(sLengthInfo));
}
nsSVGElement::AngleAttributesInfo
nsSVGMarkerElement::GetAngleInfo()
SVGMarkerElement::GetAngleInfo()
{
return AngleAttributesInfo(mAngleAttributes, sAngleInfo,
ArrayLength(sAngleInfo));
}
nsSVGElement::EnumAttributesInfo
nsSVGMarkerElement::GetEnumInfo()
SVGMarkerElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
ArrayLength(sEnumInfo));
}
nsSVGViewBox *
nsSVGMarkerElement::GetViewBox()
SVGMarkerElement::GetViewBox()
{
return &mViewBox;
}
SVGAnimatedPreserveAspectRatio *
nsSVGMarkerElement::GetPreserveAspectRatio()
SVGMarkerElement::GetPreserveAspectRatio()
{
return &mPreserveAspectRatio;
}
@ -325,7 +390,7 @@ nsSVGMarkerElement::GetPreserveAspectRatio()
// public helpers
gfxMatrix
nsSVGMarkerElement::GetMarkerTransform(float aStrokeWidth,
SVGMarkerElement::GetMarkerTransform(float aStrokeWidth,
float aX, float aY, float aAutoAngle)
{
gfxFloat scale = mEnumAttributes[MARKERUNITS].GetAnimValue() ==
@ -341,7 +406,7 @@ nsSVGMarkerElement::GetMarkerTransform(float aStrokeWidth,
}
nsSVGViewBoxRect
nsSVGMarkerElement::GetViewBoxRect()
SVGMarkerElement::GetViewBoxRect()
{
if (mViewBox.IsExplicitlySet()) {
return mViewBox.GetAnimValue();
@ -353,7 +418,7 @@ nsSVGMarkerElement::GetViewBoxRect()
}
gfxMatrix
nsSVGMarkerElement::GetViewBoxTransform()
SVGMarkerElement::GetViewBoxTransform()
{
if (!mViewBoxToViewportTransform) {
float viewportWidth =
@ -386,4 +451,5 @@ nsSVGMarkerElement::GetViewBoxTransform()
return *mViewBoxToViewportTransform;
}
} // namespace dom
} // namespace mozilla

View File

@ -3,20 +3,27 @@
* 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 __NS_SVGMARKERELEMENT_H__
#define __NS_SVGMARKERELEMENT_H__
#ifndef mozilla_dom_SVGMarkerElement_h
#define mozilla_dom_SVGMarkerElement_h
#include "gfxMatrix.h"
#include "nsIDOMSVGFitToViewBox.h"
#include "nsIDOMSVGMarkerElement.h"
#include "nsSVGAngle.h"
#include "nsSVGEnum.h"
#include "nsSVGLength2.h"
#include "nsSVGViewBox.h"
#include "SVGAnimatedPreserveAspectRatio.h"
#include "SVGGraphicsElement.h"
#include "nsSVGElement.h"
#include "mozilla/Attributes.h"
class nsSVGMarkerFrame;
nsresult NS_NewSVGMarkerElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
namespace mozilla {
namespace dom {
class nsSVGOrientType
{
public:
@ -40,8 +47,8 @@ public:
uint16_t GetAnimValue() const
{ return mAnimVal; }
nsresult ToDOMAnimatedEnum(nsIDOMSVGAnimatedEnumeration **aResult,
nsSVGElement* aSVGElement);
already_AddRefed<nsIDOMSVGAnimatedEnumeration>
ToDOMAnimatedEnum(nsSVGElement* aSVGElement);
private:
nsSVGEnumValue mAnimVal;
@ -68,27 +75,24 @@ private:
};
};
typedef mozilla::dom::SVGGraphicsElement nsSVGMarkerElementBase;
typedef nsSVGElement SVGMarkerElementBase;
class nsSVGMarkerElement : public nsSVGMarkerElementBase,
public nsIDOMSVGMarkerElement,
public nsIDOMSVGFitToViewBox
class SVGMarkerElement : public SVGMarkerElementBase,
public nsIDOMSVGMarkerElement
{
friend class nsSVGMarkerFrame;
friend class ::nsSVGMarkerFrame;
protected:
friend nsresult NS_NewSVGMarkerElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
nsSVGMarkerElement(already_AddRefed<nsINodeInfo> aNodeInfo);
friend nsresult (::NS_NewSVGMarkerElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo));
SVGMarkerElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual JSObject* WrapNode(JSContext *cx, JSObject *scope, bool *triedToWrap) MOZ_OVERRIDE;
public:
typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGMARKERELEMENT
NS_DECL_NSIDOMSVGFITTOVIEWBOX
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
@ -119,13 +123,27 @@ public:
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
// WebIDL
already_AddRefed<nsIDOMSVGAnimatedRect> ViewBox();
already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
already_AddRefed<SVGAnimatedLength> RefX();
already_AddRefed<SVGAnimatedLength> RefY();
already_AddRefed<nsIDOMSVGAnimatedEnumeration> MarkerUnits();
already_AddRefed<SVGAnimatedLength> MarkerWidth();
already_AddRefed<SVGAnimatedLength> MarkerHeight();
already_AddRefed<nsIDOMSVGAnimatedEnumeration> OrientType();
already_AddRefed<SVGAnimatedAngle> OrientAngle();
// We can use the XPIDL SetOrientToAuto
void SetOrientToAngle(SVGAngle& angle, ErrorResult& rv);
protected:
virtual bool ParseAttribute(int32_t aNameSpaceID, nsIAtom* aName,
const nsAString& aValue,
nsAttrValue& aResult);
void SetParentCoordCtxProvider(mozilla::dom::SVGSVGElement *aContext);
void SetParentCoordCtxProvider(SVGSVGElement *aContext);
virtual LengthAttributesInfo GetLengthInfo();
virtual AngleAttributesInfo GetAngleInfo();
@ -152,8 +170,11 @@ protected:
// derived properties (from 'orient') handled separately
nsSVGOrientType mOrientType;
mozilla::dom::SVGSVGElement *mCoordCtx;
SVGSVGElement *mCoordCtx;
nsAutoPtr<gfxMatrix> mViewBoxToViewportTransform;
};
#endif
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_SVGMarkerElement_h

View File

@ -60,9 +60,9 @@ NS_IMPL_ADDREF_INHERITED(SVGPatternElement,SVGPatternElementBase)
NS_IMPL_RELEASE_INHERITED(SVGPatternElement,SVGPatternElementBase)
NS_INTERFACE_TABLE_HEAD(SVGPatternElement)
NS_NODE_INTERFACE_TABLE7(SVGPatternElement, nsIDOMNode, nsIDOMElement,
NS_NODE_INTERFACE_TABLE6(SVGPatternElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
nsIDOMSVGFitToViewBox, nsIDOMSVGURIReference,
nsIDOMSVGURIReference,
nsIDOMSVGPatternElement, nsIDOMSVGUnitTypes)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGPatternElement)
NS_INTERFACE_MAP_END_INHERITING(SVGPatternElementBase)
@ -82,14 +82,6 @@ SVGPatternElement::SVGPatternElement(already_AddRefed<nsINodeInfo> aNodeInfo)
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPatternElement)
//----------------------------------------------------------------------
// nsIDOMSVGFitToViewBox methods
/* readonly attribute nsIDOMSVGAnimatedRect viewBox; */
NS_IMETHODIMP SVGPatternElement::GetViewBox(nsIDOMSVGAnimatedRect * *aViewBox)
{
*aViewBox = ViewBox().get();
return NS_OK;
}
already_AddRefed<nsIDOMSVGAnimatedRect>
SVGPatternElement::ViewBox()
@ -99,14 +91,6 @@ SVGPatternElement::ViewBox()
return rect.forget();
}
/* readonly attribute SVGPreserveAspectRatio preserveAspectRatio; */
NS_IMETHODIMP
SVGPatternElement::GetPreserveAspectRatio(nsISupports **aPreserveAspectRatio)
{
*aPreserveAspectRatio = PreserveAspectRatio().get();
return NS_OK;
}
already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
SVGPatternElement::PreserveAspectRatio()
{

View File

@ -6,7 +6,6 @@
#ifndef mozilla_dom_SVGPatternElement_h
#define mozilla_dom_SVGPatternElement_h
#include "nsIDOMSVGFitToViewBox.h"
#include "nsIDOMSVGPatternElement.h"
#include "nsIDOMSVGUnitTypes.h"
#include "nsIDOMSVGURIReference.h"
@ -33,7 +32,6 @@ typedef nsSVGElement SVGPatternElementBase;
class SVGPatternElement MOZ_FINAL : public SVGPatternElementBase,
public nsIDOMSVGPatternElement,
public nsIDOMSVGURIReference,
public nsIDOMSVGFitToViewBox,
public nsIDOMSVGUnitTypes
{
friend class ::nsSVGPatternFrame;
@ -56,9 +54,6 @@ public:
// URI Reference
NS_DECL_NSIDOMSVGURIREFERENCE
// FitToViewbox
NS_DECL_NSIDOMSVGFITTOVIEWBOX
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGElement::)
@ -117,7 +112,7 @@ protected:
nsSVGString mStringAttributes[1];
static StringInfo sStringInfo[1];
// nsIDOMSVGFitToViewbox properties
// SVGFitToViewbox properties
nsSVGViewBox mViewBox;
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
};

View File

@ -146,10 +146,9 @@ NS_IMPL_ADDREF_INHERITED(SVGSVGElement,SVGSVGElementBase)
NS_IMPL_RELEASE_INHERITED(SVGSVGElement,SVGSVGElementBase)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(SVGSVGElement)
NS_NODE_INTERFACE_TABLE5(SVGSVGElement, nsIDOMNode, nsIDOMElement,
NS_NODE_INTERFACE_TABLE4(SVGSVGElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
nsIDOMSVGSVGElement,
nsIDOMSVGFitToViewBox)
nsIDOMSVGSVGElement)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGSVGElement)
NS_INTERFACE_MAP_END_INHERITING(SVGSVGElementBase)
@ -675,15 +674,6 @@ SVGSVGElement::GetElementById(const nsAString& elementId, ErrorResult& rv)
}
//----------------------------------------------------------------------
// nsIDOMSVGFitToViewBox methods
/* readonly attribute nsIDOMSVGAnimatedRect viewBox; */
NS_IMETHODIMP
SVGSVGElement::GetViewBox(nsIDOMSVGAnimatedRect * *aViewBox)
{
*aViewBox = ViewBox().get();
return NS_OK;
}
already_AddRefed<nsIDOMSVGAnimatedRect>
SVGSVGElement::ViewBox()
@ -693,15 +683,6 @@ SVGSVGElement::ViewBox()
return rect.forget();
}
/* readonly attribute SVGPreserveAspectRatio preserveAspectRatio; */
NS_IMETHODIMP
SVGSVGElement::GetPreserveAspectRatio(nsISupports
**aPreserveAspectRatio)
{
*aPreserveAspectRatio = PreserveAspectRatio().get();
return NS_OK;
}
already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
SVGSVGElement::PreserveAspectRatio()
{

View File

@ -7,7 +7,6 @@
#define mozilla_dom_SVGSVGElement_h
#include "mozilla/dom/FromParser.h"
#include "nsIDOMSVGFitToViewBox.h"
#include "nsISVGPoint.h"
#include "nsIDOMSVGSVGElement.h"
#include "nsSVGEnum.h"
@ -80,8 +79,7 @@ public:
typedef SVGGraphicsElement SVGSVGElementBase;
class SVGSVGElement MOZ_FINAL : public SVGSVGElementBase,
public nsIDOMSVGSVGElement,
public nsIDOMSVGFitToViewBox
public nsIDOMSVGSVGElement
{
friend class ::nsSVGOuterSVGFrame;
friend class ::nsSVGInnerSVGFrame;
@ -101,7 +99,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(SVGSVGElement, SVGSVGElementBase)
NS_DECL_NSIDOMSVGSVGELEMENT
NS_DECL_NSIDOMSVGFITTOVIEWBOX
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE

View File

@ -26,9 +26,9 @@ NS_IMPL_ADDREF_INHERITED(SVGSymbolElement,SVGSymbolElementBase)
NS_IMPL_RELEASE_INHERITED(SVGSymbolElement,SVGSymbolElementBase)
NS_INTERFACE_TABLE_HEAD(SVGSymbolElement)
NS_NODE_INTERFACE_TABLE6(SVGSymbolElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement, nsIDOMSVGFitToViewBox,
nsIDOMSVGSymbolElement, nsIDOMSVGTests)
NS_NODE_INTERFACE_TABLE5(SVGSymbolElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
nsIDOMSVGSymbolElement, DOMSVGTests)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGSymbolElement)
NS_INTERFACE_MAP_END_INHERITING(SVGSymbolElementBase)
@ -48,14 +48,6 @@ SVGSymbolElement::SVGSymbolElement(already_AddRefed<nsINodeInfo> aNodeInfo)
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGSymbolElement)
//----------------------------------------------------------------------
// nsIDOMSVGFitToViewBox methods
/* readonly attribute nsIDOMSVGAnimatedRect viewBox; */
NS_IMETHODIMP SVGSymbolElement::GetViewBox(nsIDOMSVGAnimatedRect * *aViewBox)
{
*aViewBox = ViewBox().get();
return NS_OK;
}
already_AddRefed<nsIDOMSVGAnimatedRect>
SVGSymbolElement::ViewBox()
@ -65,15 +57,6 @@ SVGSymbolElement::ViewBox()
return rect.forget();
}
/* readonly attribute SVGPreserveAspectRatio preserveAspectRatio; */
NS_IMETHODIMP
SVGSymbolElement::GetPreserveAspectRatio(nsISupports
**aPreserveAspectRatio)
{
*aPreserveAspectRatio = PreserveAspectRatio().get();
return NS_OK;
}
already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
SVGSymbolElement::PreserveAspectRatio()
{

View File

@ -11,7 +11,6 @@
#include "nsSVGElement.h"
#include "nsSVGViewBox.h"
#include "SVGAnimatedPreserveAspectRatio.h"
#include "nsIDOMSVGFitToViewBox.h"
#include "nsGkAtoms.h"
nsresult NS_NewSVGSymbolElement(nsIContent **aResult,
@ -24,8 +23,7 @@ typedef nsSVGElement SVGSymbolElementBase;
class SVGSymbolElement MOZ_FINAL : public SVGSymbolElementBase,
public nsIDOMSVGSymbolElement,
public DOMSVGTests,
public nsIDOMSVGFitToViewBox
public DOMSVGTests
{
protected:
friend nsresult (::NS_NewSVGSymbolElement(nsIContent **aResult,
@ -38,7 +36,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGSYMBOLELEMENT
NS_DECL_NSIDOMSVGFITTOVIEWBOX
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE

View File

@ -46,9 +46,8 @@ NS_IMPL_ADDREF_INHERITED(SVGViewElement,SVGViewElementBase)
NS_IMPL_RELEASE_INHERITED(SVGViewElement,SVGViewElementBase)
NS_INTERFACE_TABLE_HEAD(SVGViewElement)
NS_NODE_INTERFACE_TABLE5(SVGViewElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement, nsIDOMSVGViewElement,
nsIDOMSVGFitToViewBox)
NS_NODE_INTERFACE_TABLE4(SVGViewElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement, nsIDOMSVGViewElement)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGViewElement)
NS_INTERFACE_MAP_END_INHERITING(SVGViewElementBase)
@ -78,15 +77,6 @@ SVGViewElement::SetZoomAndPan(uint16_t aZoomAndPan, ErrorResult& rv)
}
//----------------------------------------------------------------------
// nsIDOMSVGFitToViewBox methods
/* readonly attribute nsIDOMSVGAnimatedRect viewBox; */
NS_IMETHODIMP
SVGViewElement::GetViewBox(nsIDOMSVGAnimatedRect * *aViewBox)
{
*aViewBox = ViewBox().get();
return NS_OK;
}
already_AddRefed<nsIDOMSVGAnimatedRect>
SVGViewElement::ViewBox()
@ -96,15 +86,6 @@ SVGViewElement::ViewBox()
return box.forget();
}
/* readonly attribute SVGPreserveAspectRatio preserveAspectRatio; */
NS_IMETHODIMP
SVGViewElement::GetPreserveAspectRatio(nsISupports
**aPreserveAspectRatio)
{
*aPreserveAspectRatio = PreserveAspectRatio().get();
return NS_OK;
}
already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
SVGViewElement::PreserveAspectRatio()
{

View File

@ -7,7 +7,6 @@
#define mozilla_dom_SVGViewElement_h
#include "nsIDOMSVGViewElement.h"
#include "nsIDOMSVGFitToViewBox.h"
#include "nsSVGElement.h"
#include "nsSVGEnum.h"
#include "nsSVGViewBox.h"
@ -32,8 +31,7 @@ namespace dom {
class SVGSVGElement;
class SVGViewElement : public SVGViewElementBase,
public nsIDOMSVGViewElement,
public nsIDOMSVGFitToViewBox
public nsIDOMSVGViewElement
{
protected:
friend class mozilla::SVGFragmentIdentifier;
@ -49,7 +47,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGVIEWELEMENT
NS_DECL_NSIDOMSVGFITTOVIEWBOX
// xxx If xpcom allowed virtual inheritance we wouldn't need to
// forward here :-(

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<body>
<script>
var clipPath = document.createElementNS("http://www.w3.org/2000/svg",
"clipPath");
clipPath["hasExtension"].apply(clipPath,[]);
</script>
</body>
</html>

View File

@ -61,3 +61,4 @@ load zero-size-image.svg
load 723441-1.html
load 751515-1.svg
load 761507-1.svg
load 831561.html

View File

@ -9,7 +9,7 @@
#include "prdtoa.h"
#include "nsTextFormatter.h"
#include "nsSVGAttrTearoffTable.h"
#include "nsSVGMarkerElement.h"
#include "mozilla/dom/SVGMarkerElement.h"
#include "nsMathUtils.h"
#include "nsContentUtils.h" // NS_ENSURE_FINITE
#include "nsSMILValue.h"
@ -217,8 +217,8 @@ nsSVGAngle::NewValueSpecifiedUnits(uint16_t unitType,
return NS_OK;
}
nsresult
nsSVGAngle::ToDOMBaseVal(SVGAngle **aResult, nsSVGElement *aSVGElement)
already_AddRefed<SVGAngle>
nsSVGAngle::ToDOMBaseVal(nsSVGElement *aSVGElement)
{
nsRefPtr<SVGAngle> domBaseVal =
sBaseSVGAngleTearoffTable.GetTearoff(this);
@ -227,12 +227,11 @@ nsSVGAngle::ToDOMBaseVal(SVGAngle **aResult, nsSVGElement *aSVGElement)
sBaseSVGAngleTearoffTable.AddTearoff(this, domBaseVal);
}
domBaseVal.forget(aResult);
return NS_OK;
return domBaseVal.forget();
}
nsresult
nsSVGAngle::ToDOMAnimVal(SVGAngle **aResult, nsSVGElement *aSVGElement)
already_AddRefed<SVGAngle>
nsSVGAngle::ToDOMAnimVal(nsSVGElement *aSVGElement)
{
nsRefPtr<SVGAngle> domAnimVal =
sAnimSVGAngleTearoffTable.GetTearoff(this);
@ -241,8 +240,7 @@ nsSVGAngle::ToDOMAnimVal(SVGAngle **aResult, nsSVGElement *aSVGElement)
sAnimSVGAngleTearoffTable.AddTearoff(this, domAnimVal);
}
domAnimVal.forget(aResult);
return NS_OK;
return domAnimVal.forget();
}
SVGAngle::~SVGAngle()
@ -342,9 +340,8 @@ nsSVGAngle::SetAnimValue(float aValue, uint8_t aUnit, nsSVGElement *aSVGElement)
aSVGElement->DidAnimateAngle(mAttrEnum);
}
nsresult
nsSVGAngle::ToDOMAnimatedAngle(nsISupports **aResult,
nsSVGElement *aSVGElement)
already_AddRefed<SVGAnimatedAngle>
nsSVGAngle::ToDOMAnimatedAngle(nsSVGElement *aSVGElement)
{
nsRefPtr<SVGAnimatedAngle> domAnimatedAngle =
sSVGAnimatedAngleTearoffTable.GetTearoff(this);
@ -353,8 +350,7 @@ nsSVGAngle::ToDOMAnimatedAngle(nsISupports **aResult,
sSVGAnimatedAngleTearoffTable.AddTearoff(this, domAnimatedAngle);
}
domAnimatedAngle.forget(aResult);
return NS_OK;
return domAnimatedAngle.forget();
}
SVGAnimatedAngle::~SVGAnimatedAngle()
@ -366,7 +362,7 @@ nsISMILAttr*
nsSVGAngle::ToSMILAttr(nsSVGElement *aSVGElement)
{
if (aSVGElement->NodeInfo()->Equals(nsGkAtoms::marker, kNameSpaceID_SVG)) {
nsSVGMarkerElement *marker = static_cast<nsSVGMarkerElement*>(aSVGElement);
SVGMarkerElement *marker = static_cast<SVGMarkerElement*>(aSVGElement);
return new SMILOrient(marker->GetOrientType(), this, aSVGElement);
}
// SMILOrient would not be useful for general angle attributes (also,

View File

@ -16,7 +16,6 @@
class nsISMILAnimationElement;
class nsSMILValue;
class nsSVGOrientType;
namespace mozilla {
@ -28,6 +27,7 @@ static const unsigned short SVG_ANGLETYPE_RAD = 3;
static const unsigned short SVG_ANGLETYPE_GRAD = 4;
namespace dom {
class nsSVGOrientType;
class SVGAngle;
class SVGAnimatedAngle;
}
@ -68,8 +68,8 @@ public:
float GetAnimValInSpecifiedUnits() const { return mAnimVal; }
static nsresult ToDOMSVGAngle(nsISupports **aResult);
nsresult ToDOMAnimatedAngle(nsISupports **aResult,
nsSVGElement* aSVGElement);
already_AddRefed<mozilla::dom::SVGAnimatedAngle>
ToDOMAnimatedAngle(nsSVGElement* aSVGElement);
// Returns a new nsISMILAttr object that the caller must delete
nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement);
@ -88,8 +88,8 @@ private:
nsresult NewValueSpecifiedUnits(uint16_t aUnitType, float aValue,
nsSVGElement *aSVGElement);
nsresult ConvertToSpecifiedUnits(uint16_t aUnitType, nsSVGElement *aSVGElement);
nsresult ToDOMBaseVal(mozilla::dom::SVGAngle **aResult, nsSVGElement* aSVGElement);
nsresult ToDOMAnimVal(mozilla::dom::SVGAngle **aResult, nsSVGElement* aSVGElement);
already_AddRefed<mozilla::dom::SVGAngle> ToDOMBaseVal(nsSVGElement* aSVGElement);
already_AddRefed<mozilla::dom::SVGAngle> ToDOMAnimVal(nsSVGElement* aSVGElement);
public:
// We do not currently implemente a SMILAngle struct because in SVG 1.1 the
@ -100,7 +100,7 @@ public:
struct SMILOrient MOZ_FINAL : public nsISMILAttr
{
public:
SMILOrient(nsSVGOrientType* aOrientType,
SMILOrient(mozilla::dom::nsSVGOrientType* aOrientType,
nsSVGAngle* aAngle,
nsSVGElement* aSVGElement)
: mOrientType(aOrientType)
@ -111,7 +111,7 @@ public:
// These will stay alive because a nsISMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
nsSVGOrientType* mOrientType;
mozilla::dom::nsSVGOrientType* mOrientType;
nsSVGAngle* mAngle;
nsSVGElement* mSVGElement;

View File

@ -104,9 +104,8 @@
#include "nsCCUncollectableMarker.h"
#include "nsICSSDeclaration.h"
#include "mozilla/dom/XULElementBinding.h"
using namespace mozilla;
namespace css = mozilla::css;
namespace dom = mozilla::dom;
//----------------------------------------------------------------------
@ -167,8 +166,6 @@ nsXULElement::nsXULElement(already_AddRefed<nsINodeInfo> aNodeInfo)
{
XUL_PROTOTYPE_ATTRIBUTE_METER(gNumElements);
SetIsDOMBinding();
// We may be READWRITE by default; check.
if (IsReadWriteTextElement()) {
AddStatesSilently(NS_EVENT_STATE_MOZ_READWRITE);
@ -402,18 +399,12 @@ NS_IMETHODIMP
nsXULElement::GetElementsByAttribute(const nsAString& aAttribute,
const nsAString& aValue,
nsIDOMNodeList** aReturn)
{
*aReturn = GetElementsByAttribute(aAttribute, aValue).get();
return NS_OK;
}
already_AddRefed<nsINodeList>
nsXULElement::GetElementsByAttribute(const nsAString& aAttribute,
const nsAString& aValue)
{
nsCOMPtr<nsIAtom> attrAtom(do_GetAtom(aAttribute));
NS_ENSURE_TRUE(attrAtom, NS_ERROR_OUT_OF_MEMORY);
void* attrValue = new nsString(aValue);
nsRefPtr<nsContentList> list =
NS_ENSURE_TRUE(attrValue, NS_ERROR_OUT_OF_MEMORY);
nsContentList *list =
new nsContentList(this,
nsXULDocument::MatchAttribute,
nsContentUtils::DestroyMatchString,
@ -421,7 +412,10 @@ nsXULElement::GetElementsByAttribute(const nsAString& aAttribute,
true,
attrAtom,
kNameSpaceID_Unknown);
return list.forget();
NS_ENSURE_TRUE(list, NS_ERROR_OUT_OF_MEMORY);
NS_ADDREF(*aReturn = list);
return NS_OK;
}
NS_IMETHODIMP
@ -429,33 +423,22 @@ nsXULElement::GetElementsByAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aAttribute,
const nsAString& aValue,
nsIDOMNodeList** aReturn)
{
ErrorResult rv;
*aReturn =
GetElementsByAttributeNS(aNamespaceURI, aAttribute, aValue, rv).get();
return rv.ErrorCode();
}
already_AddRefed<nsINodeList>
nsXULElement::GetElementsByAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aAttribute,
const nsAString& aValue,
ErrorResult& rv)
{
nsCOMPtr<nsIAtom> attrAtom(do_GetAtom(aAttribute));
NS_ENSURE_TRUE(attrAtom, NS_ERROR_OUT_OF_MEMORY);
int32_t nameSpaceId = kNameSpaceID_Wildcard;
if (!aNamespaceURI.EqualsLiteral("*")) {
rv =
nsresult rv =
nsContentUtils::NameSpaceManager()->RegisterNameSpace(aNamespaceURI,
nameSpaceId);
if (rv.Failed()) {
return nullptr;
}
NS_ENSURE_SUCCESS(rv, rv);
}
void* attrValue = new nsString(aValue);
nsRefPtr<nsContentList> list =
NS_ENSURE_TRUE(attrValue, NS_ERROR_OUT_OF_MEMORY);
nsContentList *list =
new nsContentList(this,
nsXULDocument::MatchAttribute,
nsContentUtils::DestroyMatchString,
@ -463,8 +446,10 @@ nsXULElement::GetElementsByAttributeNS(const nsAString& aNamespaceURI,
true,
attrAtom,
nameSpaceId);
NS_ENSURE_TRUE(list, NS_ERROR_OUT_OF_MEMORY);
return list.forget();
NS_ADDREF(*aReturn = list);
return NS_OK;
}
nsEventListenerManager*
@ -1190,14 +1175,6 @@ nsXULElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
// XXX This _should_ be an implementation method, _not_ publicly exposed :-(
NS_IMETHODIMP
nsXULElement::GetResource(nsIRDFResource** aResource)
{
ErrorResult rv;
*aResource = GetResource(rv).get();
return rv.ErrorCode();
}
already_AddRefed<nsIRDFResource>
nsXULElement::GetResource(ErrorResult& rv)
{
nsAutoString id;
GetAttr(kNameSpaceID_None, nsGkAtoms::ref, id);
@ -1205,57 +1182,44 @@ nsXULElement::GetResource(ErrorResult& rv)
GetAttr(kNameSpaceID_None, nsGkAtoms::id, id);
}
if (id.IsEmpty()) {
return nullptr;
if (!id.IsEmpty()) {
return nsXULContentUtils::RDFService()->
GetUnicodeResource(id, aResource);
}
*aResource = nullptr;
return NS_OK;
}
nsCOMPtr<nsIRDFResource> resource;
rv = nsXULContentUtils::RDFService()->
GetUnicodeResource(id, getter_AddRefs(resource));
return resource.forget();
}
NS_IMETHODIMP
nsXULElement::GetDatabase(nsIRDFCompositeDataSource** aDatabase)
{
*aDatabase = GetDatabase().get();
nsCOMPtr<nsIXULTemplateBuilder> builder;
GetBuilder(getter_AddRefs(builder));
if (builder)
builder->GetDatabase(aDatabase);
else
*aDatabase = nullptr;
return NS_OK;
}
already_AddRefed<nsIRDFCompositeDataSource>
nsXULElement::GetDatabase()
{
nsCOMPtr<nsIXULTemplateBuilder> builder = GetBuilder();
if (!builder) {
return nullptr;
}
nsCOMPtr<nsIRDFCompositeDataSource> database;
builder->GetDatabase(getter_AddRefs(database));
return database.forget();
}
NS_IMETHODIMP
nsXULElement::GetBuilder(nsIXULTemplateBuilder** aBuilder)
{
*aBuilder = GetBuilder().get();
*aBuilder = nullptr;
// XXX sXBL/XBL2 issue! Owner or current document?
nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(GetCurrentDoc());
if (xuldoc)
xuldoc->GetTemplateBuilderFor(this, aBuilder);
return NS_OK;
}
already_AddRefed<nsIXULTemplateBuilder>
nsXULElement::GetBuilder()
{
// XXX sXBL/XBL2 issue! Owner or current document?
nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(GetCurrentDoc());
if (!xuldoc) {
return nullptr;
}
nsCOMPtr<nsIXULTemplateBuilder> builder;
xuldoc->GetTemplateBuilderFor(this, getter_AddRefs(builder));
return builder.forget();
}
//----------------------------------------------------------------------
// Implementation methods
@ -1304,46 +1268,30 @@ nsXULElement::IsAttributeMapped(const nsIAtom* aAttribute) const
// Controllers Methods
NS_IMETHODIMP
nsXULElement::GetControllers(nsIControllers** aResult)
{
ErrorResult rv;
NS_IF_ADDREF(*aResult = GetControllers(rv));
return rv.ErrorCode();
}
nsIControllers*
nsXULElement::GetControllers(ErrorResult& rv)
{
if (! Controllers()) {
nsDOMSlots* slots = DOMSlots();
nsresult rv;
rv = NS_NewXULControllers(nullptr, NS_GET_IID(nsIControllers),
reinterpret_cast<void**>(&slots->mControllers));
NS_ASSERTION(NS_SUCCEEDED(rv.ErrorCode()),
"unable to create a controllers");
if (rv.Failed()) {
return nullptr;
}
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to create a controllers");
if (NS_FAILED(rv)) return rv;
}
return Controllers();
*aResult = Controllers();
NS_IF_ADDREF(*aResult);
return NS_OK;
}
NS_IMETHODIMP
nsXULElement::GetBoxObject(nsIBoxObject** aResult)
{
ErrorResult rv;
*aResult = GetBoxObject(rv).get();
return rv.ErrorCode();
}
*aResult = nullptr;
already_AddRefed<nsIBoxObject>
nsXULElement::GetBoxObject(ErrorResult& rv)
{
nsCOMPtr<nsIBoxObject> boxObject;
// XXX sXBL/XBL2 issue! Owner or current document?
rv = OwnerDoc()->GetBoxObjectFor(this, getter_AddRefs(boxObject));
return boxObject.forget();
return OwnerDoc()->GetBoxObjectFor(this, aResult);
}
// Methods for setting/getting attributes from nsIDOMXULElement
@ -1365,17 +1313,24 @@ nsXULElement::GetBoxObject(ErrorResult& rv)
NS_IMETHODIMP \
nsXULElement::Get##_method(bool* aResult) \
{ \
*aResult = _method(); \
*aResult = BoolAttrIsTrue(nsGkAtoms::_atom); \
\
return NS_OK; \
} \
NS_IMETHODIMP \
nsXULElement::Set##_method(bool aValue) \
{ \
SetXULBoolAttr(nsGkAtoms::_atom, aValue); \
if (aValue) \
SetAttr(kNameSpaceID_None, nsGkAtoms::_atom, \
NS_LITERAL_STRING("true"), true); \
else \
UnsetAttr(kNameSpaceID_None, nsGkAtoms::_atom, true); \
\
return NS_OK; \
}
NS_IMPL_XUL_STRING_ATTR(Id, id)
NS_IMPL_XUL_STRING_ATTR(ClassName, _class)
NS_IMPL_XUL_STRING_ATTR(Align, align)
NS_IMPL_XUL_STRING_ATTR(Dir, dir)
@ -1463,30 +1418,22 @@ nsXULElement::SwapFrameLoaders(nsIFrameLoaderOwner* aOtherOwner)
nsXULElement* otherEl = FromContent(otherContent);
NS_ENSURE_TRUE(otherEl, NS_ERROR_NOT_IMPLEMENTED);
ErrorResult rv;
SwapFrameLoaders(*otherEl, rv);
return rv.ErrorCode();
}
void
nsXULElement::SwapFrameLoaders(nsXULElement& aOtherElement, ErrorResult& rv)
{
if (&aOtherElement == this) {
if (otherEl == this) {
// nothing to do
return;
return NS_OK;
}
nsXULSlots *ourSlots = static_cast<nsXULSlots*>(GetExistingDOMSlots());
nsXULSlots *otherSlots =
static_cast<nsXULSlots*>(aOtherElement.GetExistingDOMSlots());
static_cast<nsXULSlots*>(otherEl->GetExistingDOMSlots());
if (!ourSlots || !ourSlots->mFrameLoader ||
!otherSlots || !otherSlots->mFrameLoader) {
// Can't handle swapping when there is nothing to swap... yet.
rv.Throw(NS_ERROR_NOT_IMPLEMENTED);
return;
return NS_ERROR_NOT_IMPLEMENTED;
}
rv = ourSlots->mFrameLoader->SwapWithOtherLoader(otherSlots->mFrameLoader,
return
ourSlots->mFrameLoader->SwapWithOtherLoader(otherSlots->mFrameLoader,
ourSlots->mFrameLoader,
otherSlots->mFrameLoader);
}
@ -1511,45 +1458,27 @@ nsXULElement::GetParentTree(nsIDOMXULMultiSelectControlElement** aTreeElement)
NS_IMETHODIMP
nsXULElement::Focus()
{
ErrorResult rv;
Focus(rv);
return rv.ErrorCode();
}
void
nsXULElement::Focus(ErrorResult& rv)
{
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
nsCOMPtr<nsIDOMElement> elem = do_QueryObject(this);
if (fm) {
rv = fm->SetFocus(this, 0);
}
return fm ? fm->SetFocus(this, 0) : NS_OK;
}
NS_IMETHODIMP
nsXULElement::Blur()
{
ErrorResult rv;
Blur(rv);
return rv.ErrorCode();
}
void
nsXULElement::Blur(ErrorResult& rv)
{
if (!ShouldBlur(this))
return;
return NS_OK;
nsIDocument* doc = GetCurrentDoc();
if (!doc)
return;
return NS_OK;
nsIDOMWindow* win = doc->GetWindow();
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (win && fm) {
rv = fm->ClearFocus(win);
}
if (win && fm)
return fm->ClearFocus(win);
return NS_OK;
}
NS_IMETHODIMP
@ -1558,12 +1487,6 @@ nsXULElement::Click()
return ClickWithInputSource(nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN);
}
void
nsXULElement::Click(ErrorResult& rv)
{
rv = Click();
}
nsresult
nsXULElement::ClickWithInputSource(uint16_t aInputSource)
{
@ -1869,7 +1792,7 @@ nsXULElement::ResetChromeMargins()
}
bool
nsXULElement::BoolAttrIsTrue(nsIAtom* aName) const
nsXULElement::BoolAttrIsTrue(nsIAtom* aName)
{
const nsAttrValue* attr =
GetAttrInfo(kNameSpaceID_None, aName).mValue;
@ -1907,12 +1830,6 @@ nsXULElement::IsEventAttributeName(nsIAtom *aName)
return nsContentUtils::IsEventAttributeName(aName, EventNameType_XUL);
}
JSObject*
nsXULElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
{
return dom::XULElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsXULPrototypeNode)
if (tmp->mType == nsXULPrototypeNode::eType_Element) {
static_cast<nsXULPrototypeElement*>(tmp)->Unlink();

View File

@ -37,8 +37,6 @@
#include "nsDOMScriptObjectHolder.h"
#include "nsIFrameLoader.h"
#include "jspubtd.h"
#include "nsGenericHTMLElement.h"
#include "nsFrameLoader.h"
class nsIDocument;
class nsString;
@ -395,9 +393,6 @@ public:
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// And since that shadowed GetParentElement with the XPCOM
// signature, pull in the one we care about.
using nsStyledElement::GetParentElement;
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
@ -409,6 +404,7 @@ public:
virtual nsEventStates IntrinsicState() const;
nsresult GetFrameLoader(nsIFrameLoader** aFrameLoader);
already_AddRefed<nsFrameLoader> GetFrameLoader();
nsresult SwapFrameLoaders(nsIFrameLoaderOwner* aOtherOwner);
virtual void RecompileScriptEventListeners();
@ -427,169 +423,6 @@ public:
virtual bool IsEventAttributeName(nsIAtom* aName) MOZ_OVERRIDE;
void SetXULAttr(nsIAtom* aName, const nsAString& aValue,
mozilla::ErrorResult& aError)
{
aError = SetAttr(kNameSpaceID_None, aName, aValue, true);
}
void SetXULBoolAttr(nsIAtom* aName, bool aValue)
{
if (aValue) {
SetAttr(kNameSpaceID_None, aName, NS_LITERAL_STRING("true"), true);
} else {
UnsetAttr(kNameSpaceID_None, aName, true);
}
}
// WebIDL API
// The XPCOM getter is fine for our string attributes.
// The XPCOM setter is fine for our bool attributes.
void SetClassName(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::_class, aValue, rv);
}
void SetAlign(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::align, aValue, rv);
}
void SetDir(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::dir, aValue, rv);
}
void SetFlex(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::flex, aValue, rv);
}
void SetFlexGroup(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::flexgroup, aValue, rv);
}
void SetOrdinal(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::ordinal, aValue, rv);
}
void SetOrient(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::orient, aValue, rv);
}
void SetPack(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::pack, aValue, rv);
}
bool Hidden() const
{
return BoolAttrIsTrue(nsGkAtoms::hidden);
}
bool Collapsed() const
{
return BoolAttrIsTrue(nsGkAtoms::collapsed);
}
void SetObserves(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::observes, aValue, rv);
}
void SetMenu(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::menu, aValue, rv);
}
void SetContextMenu(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::contextmenu, aValue, rv);
}
void SetTooltip(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::tooltip, aValue, rv);
}
void SetWidth(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::width, aValue, rv);
}
void SetHeight(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::height, aValue, rv);
}
void SetMinWidth(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::minwidth, aValue, rv);
}
void SetMinHeight(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::minheight, aValue, rv);
}
void SetMaxWidth(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::maxwidth, aValue, rv);
}
void SetMaxHeight(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::maxheight, aValue, rv);
}
void SetPersist(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::persist, aValue, rv);
}
void SetLeft(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::left, aValue, rv);
}
void SetTop(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::top, aValue, rv);
}
void SetDatasources(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::datasources, aValue, rv);
}
void SetRef(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::ref, aValue, rv);
}
void SetTooltipText(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::tooltiptext, aValue, rv);
}
void SetStatusText(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetXULAttr(nsGkAtoms::statustext, aValue, rv);
}
bool AllowEvents() const
{
return BoolAttrIsTrue(nsGkAtoms::allowevents);
}
already_AddRefed<nsIRDFCompositeDataSource> GetDatabase();
already_AddRefed<nsIXULTemplateBuilder> GetBuilder();
already_AddRefed<nsIRDFResource> GetResource(mozilla::ErrorResult& rv);
nsIControllers* GetControllers(mozilla::ErrorResult& rv);
already_AddRefed<nsIBoxObject> GetBoxObject(mozilla::ErrorResult& rv);
void Focus(mozilla::ErrorResult& rv);
void Blur(mozilla::ErrorResult& rv);
void Click(mozilla::ErrorResult& rv);
// The XPCOM DoCommand never fails, so it's OK for us.
already_AddRefed<nsINodeList>
GetElementsByAttribute(const nsAString& aAttribute,
const nsAString& aValue);
already_AddRefed<nsINodeList>
GetElementsByAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aAttribute,
const nsAString& aValue,
mozilla::ErrorResult& rv);
// Style() inherited from nsStyledElement
already_AddRefed<nsFrameLoader> GetFrameLoader();
void SwapFrameLoaders(nsXULElement& aOtherOwner, mozilla::ErrorResult& rv);
// For XUL, the parent is the parent element, if any
nsINode* GetParentObject() const
{
Element* parent = GetParentElement();
if (parent) {
return parent;
}
return nsStyledElement::GetParentObject();
}
static bool PrefEnabled()
{
return nsGenericHTMLElement::PrefEnabled();
}
protected:
// This can be removed if EnsureContentsGenerated dies.
@ -678,7 +511,7 @@ protected:
}
void UnregisterAccessKey(const nsAString& aOldValue);
bool BoolAttrIsTrue(nsIAtom* aName) const;
bool BoolAttrIsTrue(nsIAtom* aName);
friend nsresult
NS_NewXULElement(nsIContent** aResult, nsINodeInfo *aNodeInfo);
@ -697,9 +530,6 @@ protected:
(tag == nsGkAtoms::textbox || tag == nsGkAtoms::textarea) &&
!HasAttr(kNameSpaceID_None, nsGkAtoms::readonly);
}
virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
bool *aTriedToWrap) MOZ_OVERRIDE;
};
#endif // nsXULElement_h__

View File

@ -478,10 +478,7 @@ nsXULPrototypeDocument::Write(nsIObjectOutputStream* aStream)
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
nsAutoString namespaceURI;
tmp = nodeInfo->GetNamespaceURI(namespaceURI);
if (NS_FAILED(tmp)) {
rv = tmp;
}
nodeInfo->GetNamespaceURI(namespaceURI);
tmp = aStream->WriteWStringZ(namespaceURI.get());
if (NS_FAILED(tmp)) {
rv = tmp;

View File

@ -44,13 +44,13 @@ this.FreeSpaceWatcher = {
try {
let deviceStorage = Services.wm.getMostRecentWindow("navigator:browser")
.navigator.getDeviceStorage("apps");
let req = deviceStorage.stat();
let req = deviceStorage.freeSpace();
req.onsuccess = req.onerror = function statResult(e) {
if (!e.target.result) {
return;
}
let freeBytes = e.target.result.freeBytes;
let freeBytes = e.target.result;
debug("Free bytes: " + freeBytes);
let newStatus = freeBytes > aThreshold;
if (newStatus != callback.currentStatus) {

View File

@ -2265,7 +2265,7 @@ this.DOMApplicationRegistry = {
let deviceStorage = Services.wm.getMostRecentWindow("navigator:browser")
.navigator.getDeviceStorage("apps");
let req = deviceStorage.stat();
let req = deviceStorage.freeSpace();
req.onsuccess = req.onerror = function statResult(e) {
// Even if we could not retrieve the device storage free space, we try
// to download the package.
@ -2274,7 +2274,7 @@ this.DOMApplicationRegistry = {
return;
}
let freeBytes = e.target.result.freeBytes;
let freeBytes = e.target.result;
if (freeBytes) {
debug("Free storage: " + freeBytes + ". Download size: " +
aApp.downloadSize);
@ -2298,8 +2298,10 @@ this.DOMApplicationRegistry = {
dump("-- webapps.js uninstall " + app.manifestURL + "\n");
if (!app.removable)
return;
if (!app.removable) {
debug("Error: cannot unintall a non-removable app.");
break;
}
// Check if we are downloading something for this app, and cancel the
// download if needed.
@ -2343,6 +2345,9 @@ this.DOMApplicationRegistry = {
return;
}
// Fall-through, fails to uninstall the desired app because:
// - we cannot find the app to be uninstalled.
// - the app to be uninstalled is not removable.
aMm.sendAsyncMessage("Webapps:Uninstall:Return:KO", aData);
},

View File

@ -335,7 +335,6 @@
#include "nsIDOMSVGEvent.h"
#include "nsIDOMSVGFilterElement.h"
#include "nsIDOMSVGFilters.h"
#include "nsIDOMSVGFitToViewBox.h"
#include "nsIDOMSVGForeignObjectElem.h"
#include "nsIDOMSVGGElement.h"
#include "nsIDOMSVGGradientElement.h"
@ -358,7 +357,6 @@
#include "nsIDOMSVGSVGElement.h"
#include "nsIDOMSVGSwitchElement.h"
#include "nsIDOMSVGSymbolElement.h"
#include "nsIDOMSVGTests.h"
#include "nsIDOMSVGTextElement.h"
#include "nsIDOMSVGTextPathElement.h"
#include "nsIDOMSVGTitleElement.h"
@ -2947,7 +2945,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(XULTreeBuilder, nsIXULTreeBuilder)
DOM_CLASSINFO_MAP_ENTRY(nsIXULTreeBuilder)
DOM_CLASSINFO_MAP_ENTRY(nsIXULTemplateBuilder)
DOM_CLASSINFO_MAP_ENTRY(nsITreeView)
DOM_CLASSINFO_MAP_END
#endif
@ -2992,7 +2989,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
#define DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests) \
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
// XXX - the proto chain stuff is sort of hackish, because of the MI in
@ -3026,7 +3022,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(SVGAnimateElement, nsIDOMSVGAnimateElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimationElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimateElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMElementTimeControl)
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
@ -3035,7 +3030,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(SVGAnimateTransformElement,
nsIDOMSVGAnimateTransformElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimationElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimateTransformElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMElementTimeControl)
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
@ -3044,7 +3038,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(SVGAnimateMotionElement,
nsIDOMSVGAnimateMotionElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimationElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimateMotionElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMElementTimeControl)
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
@ -3053,7 +3046,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(SVGSetElement,
nsIDOMSVGSetElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimationElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGSetElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMElementTimeControl)
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
@ -3271,7 +3263,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(SVGMarkerElement, nsIDOMSVGMarkerElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGMarkerElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox)
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
@ -3293,7 +3284,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(SVGPatternElement, nsIDOMSVGPatternElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPatternElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes)
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
@ -3341,7 +3331,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(SVGSVGElement, nsIDOMSVGSVGElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGSVGElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox)
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
@ -3353,8 +3342,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(SVGSymbolElement, nsIDOMSVGSymbolElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGSymbolElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox)
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
@ -3390,7 +3377,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(SVGViewElement, nsIDOMSVGViewElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox)
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END

View File

@ -7,7 +7,6 @@
#define nsWrapperCache_h___
#include "nsCycleCollectionParticipant.h"
#include "mozilla/Assertions.h"
class JSObject;
struct JSContext;
@ -162,7 +161,6 @@ public:
virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
bool *triedToWrap)
{
MOZ_ASSERT(!IsDOMBinding(), "Someone forgot to override WrapObject");
*triedToWrap = false;
return nullptr;
}

View File

@ -575,9 +575,9 @@ QueryInterface(JSContext* cx, unsigned argc, JS::Value* vp)
return Throw<true>(cx, NS_ERROR_XPC_BAD_CONVERT_JS);
}
nsIJSID* iid;
nsIJSIID* iid;
xpc_qsSelfRef iidRef;
if (NS_FAILED(xpc_qsUnwrapArg<nsIJSID>(cx, argv[0], &iid, &iidRef.ptr,
if (NS_FAILED(xpc_qsUnwrapArg<nsIJSIID>(cx, argv[0], &iid, &iidRef.ptr,
&argv[0]))) {
return Throw<true>(cx, NS_ERROR_XPC_BAD_CONVERT_JS);
}

View File

@ -562,6 +562,7 @@ DOMInterfaces = {
'PaintRequest': {
'nativeType': 'nsPaintRequest',
'prefable': True
},
'PaintRequestList': {
@ -612,6 +613,7 @@ DOMInterfaces = {
'Screen': {
'nativeType': 'nsScreen',
'prefable': True,
},
'SVGAElement': {
@ -1011,12 +1013,6 @@ DOMInterfaces = {
'wrapperCache': False
},
'XULElement': {
'nativeType': 'nsXULElement',
'resultNotAddRefed': [ 'controllers', 'style' ],
'hasInstanceInterface': 'nsIDOMXULElement',
},
####################################
# Test Interfaces of various sorts #
####################################
@ -1220,13 +1216,6 @@ addExternalIface('imgINotificationObserver', nativeType='imgINotificationObserve
addExternalIface('imgIRequest', nativeType='imgIRequest', notflattened=True)
addExternalIface('LockedFile')
addExternalIface('MediaStream')
addExternalIface('MozBoxObject', nativeType='nsIBoxObject')
addExternalIface('MozControllers', nativeType='nsIControllers')
addExternalIface('MozFrameLoader', nativeType='nsIFrameLoader', notflattened=True)
addExternalIface('MozRDFCompositeDataSource', nativeType='nsIRDFCompositeDataSource',
notflattened=True)
addExternalIface('MozRDFResource', nativeType='nsIRDFResource', notflattened=True)
addExternalIface('MozXULTemplateBuilder', nativeType='nsIXULTemplateBuilder')
addExternalIface('NamedNodeMap')
addExternalIface('NodeIterator')
addExternalIface('nsIStreamListener', nativeType='nsIStreamListener', notflattened=True)
@ -1255,3 +1244,4 @@ addExternalIface('WindowProxy', nativeType='nsIDOMWindow')
addExternalIface('XPathResult', nativeType='nsISupports')
addExternalIface('XPathExpression')
addExternalIface('XPathNSResolver')
addExternalIface('XULElement')

View File

@ -1825,13 +1825,18 @@ builtinNames = {
IDLType.Tags.double: 'double'
}
numericTags = [
IDLType.Tags.int8, IDLType.Tags.uint8,
IDLType.Tags.int16, IDLType.Tags.uint16,
IDLType.Tags.int32, IDLType.Tags.uint32,
IDLType.Tags.int64, IDLType.Tags.uint64,
IDLType.Tags.float, IDLType.Tags.double
]
numericSuffixes = {
IDLType.Tags.int8: '',
IDLType.Tags.uint8: '',
IDLType.Tags.int16: '',
IDLType.Tags.uint16: '',
IDLType.Tags.int32: '',
IDLType.Tags.uint32: 'U',
IDLType.Tags.int64: 'LL',
IDLType.Tags.uint64: 'ULL',
IDLType.Tags.float: 'F',
IDLType.Tags.double: 'D'
}
class CastableObjectUnwrapper():
"""
@ -2987,8 +2992,9 @@ for (uint32_t i = 0; i < length; ++i) {
# We already handled IDLNullValue, so just deal with the other ones
not isinstance(defaultValue, IDLNullValue)):
tag = defaultValue.type.tag()
if tag in numericTags:
defaultStr = defaultValue.value
if tag in numericSuffixes:
# Some numeric literals require a suffix to compile without warnings
defaultStr = "%s%s" % (defaultValue.value, numericSuffixes[tag])
else:
assert(tag == IDLType.Tags.bool)
defaultStr = toStringBool(defaultValue.value)
@ -3093,9 +3099,9 @@ def convertConstIDLValueToJSVal(value):
IDLType.Tags.uint16, IDLType.Tags.int32]:
return "INT_TO_JSVAL(%s)" % (value.value)
if tag == IDLType.Tags.uint32:
return "UINT_TO_JSVAL(%s)" % (value.value)
return "UINT_TO_JSVAL(%sU)" % (value.value)
if tag in [IDLType.Tags.int64, IDLType.Tags.uint64]:
return "DOUBLE_TO_JSVAL(%s)" % (value.value)
return "DOUBLE_TO_JSVAL(%s%s)" % (value.value, numericSuffixes[tag])
if tag == IDLType.Tags.bool:
return "JSVAL_TRUE" if value.value else "JSVAL_FALSE"
if tag in [IDLType.Tags.float, IDLType.Tags.double]:
@ -4547,11 +4553,13 @@ class CGMemberJITInfo(CGThing):
return ""
def defineJitInfo(self, infoName, opName, opType, infallible, constant,
returnTypes):
pure, returnTypes):
assert(not constant or pure) # constants are always pure
protoID = "prototypes::id::%s" % self.descriptor.name
depth = "PrototypeTraits<%s>::Depth" % protoID
failstr = toStringBool(infallible)
conststr = toStringBool(constant)
purestr = toStringBool(pure)
returnType = reduce(CGMemberJITInfo.getSingleReturnType, returnTypes,
"")
return ("\n"
@ -4562,26 +4570,30 @@ class CGMemberJITInfo(CGThing):
" JSJitInfo::%s,\n"
" %s, /* isInfallible. False in setters. */\n"
" %s, /* isConstant. Only relevant for getters. */\n"
" %s, /* isPure. Only relevant for getters. */\n"
" %s /* returnType. Only relevant for getters/methods. */\n"
"};\n" % (infoName, opName, protoID, depth, opType, failstr,
conststr, returnType))
conststr, purestr, returnType))
def define(self):
if self.member.isAttr():
getterinfo = ("%s_getterinfo" % self.member.identifier.name)
getter = ("(JSJitPropertyOp)get_%s" % self.member.identifier.name)
getterinfal = "infallible" in self.descriptor.getExtendedAttributes(self.member, getter=True)
getterinfal = getterinfal and infallibleForMember(self.member, self.member.type, self.descriptor)
getterconst = self.member.getExtendedAttribute("Constant")
getterpure = getterconst or self.member.getExtendedAttribute("Pure")
assert (getterinfal or (not getterconst and not getterpure))
getterinfal = getterinfal and infallibleForMember(self.member, self.member.type, self.descriptor)
result = self.defineJitInfo(getterinfo, getter, "Getter",
getterinfal, getterconst,
getterinfal, getterconst, getterpure,
[self.member.type])
if not self.member.readonly or self.member.getExtendedAttribute("PutForwards") is not None:
setterinfo = ("%s_setterinfo" % self.member.identifier.name)
setter = ("(JSJitPropertyOp)set_%s" % self.member.identifier.name)
# Setters are always fallible, since they have to do a typed unwrap.
result += self.defineJitInfo(setterinfo, setter, "Setter",
False, False,
False, False, False,
[BuiltinTypes[IDLBuiltinType.Types.void]])
return result
if self.member.isMethod():
@ -4593,18 +4605,22 @@ class CGMemberJITInfo(CGThing):
# Methods are infallible if they are infallible, have no arguments
# to unwrap, and have a return type that's infallible to wrap up for
# return.
methodInfal = False
sigs = self.member.signatures()
if len(sigs) == 1:
if len(sigs) != 1:
# Don't handle overloading. If there's more than one signature,
# one of them must take arguments.
methodInfal = False
else:
sig = sigs[0]
if len(sig[1]) == 0 and infallibleForMember(self.member, sig[0], self.descriptor):
# No arguments and infallible return boxing
methodInfal = True
if (len(sig[1]) != 0 or
not infallibleForMember(self.member, sig[0], self.descriptor)):
# We have arguments or our return-value boxing can fail
methodInfal = False
else:
methodInfal = "infallible" in self.descriptor.getExtendedAttributes(self.member)
result = self.defineJitInfo(methodinfo, method, "Method",
methodInfal, False,
methodInfal, False, False,
[s[0] for s in sigs])
return result
raise TypeError("Illegal member type to CGPropertyJITInfo")

View File

@ -12,6 +12,7 @@ LIBRARY_NAME = dombindings_s
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
EXPORT_LIBRARY = 1
FAIL_ON_WARNINGS := 1
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
@ -86,7 +87,6 @@ LOCAL_INCLUDES += -I$(topsrcdir)/js/xpconnect/src \
-I$(topsrcdir)/content/xslt/src/base \
-I$(topsrcdir)/content/xslt/src/xpath \
-I$(topsrcdir)/content/xml/content/src \
-I$(topsrcdir)/content/xul/content/src \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -2194,6 +2194,14 @@ class IDLAttribute(IDLInterfaceMember):
raise WebIDLError("Readonly attributes must not be flagged as "
"[SetterThrows]",
[self.location])
elif (((identifier == "Throws" or identifier == "GetterThrows") and
(self.getExtendedAttribute("Pure") or
self.getExtendedAttribute("Constant"))) or
((identifier == "Pure" or identifier == "Constant") and
(self.getExtendedAttribute("Throws") or
self.getExtendedAttribute("GetterThrows")))):
raise WebIDLError("Throwing things can't be [Pure] or [Constant]",
[attr.location])
elif identifier == "LenientThis":
if not attr.noArguments():
raise WebIDLError("[LenientThis] must take no arguments",
@ -2736,8 +2744,11 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
"[Unforgeable]",
[attr.location, self.location])
elif identifier == "Constant":
raise WebIDLError("Methods must not be flagged as "
"[Constant]",
raise WebIDLError("Methods must not be flagged as [Constant]",
[attr.location, self.location]);
elif identifier == "Pure":
raise WebIDLError("Methods must not be flagged as [Pure] and if "
"that changes, don't forget to check for [Throws]",
[attr.location, self.location]);
elif identifier == "PutForwards":
raise WebIDLError("Only attributes support [PutForwards]",

View File

@ -671,7 +671,7 @@ BluetoothHfpManager::ReceiveSocketData(UnixSocketRawData* aMessage)
{
MOZ_ASSERT(NS_IsMainThread());
nsAutoCString msg((const char*)aMessage->mData.get());
nsAutoCString msg((const char*)aMessage->mData.get(), aMessage->mSize);
msg.StripWhitespace();
nsTArray<nsCString> atCommandValues;
@ -679,7 +679,7 @@ BluetoothHfpManager::ReceiveSocketData(UnixSocketRawData* aMessage)
// For more information, please refer to 4.34.1 "Bluetooth Defined AT
// Capabilities" in Bluetooth hands-free profile 1.6
if (msg.Find("AT+BRSF=") != -1) {
SendCommand("+BRSF: ", 33);
SendCommand("+BRSF: ", 97);
} else if (msg.Find("AT+CIND=?") != -1) {
// Asking for CIND range
SendCommand("+CIND: ", 0);

View File

@ -48,7 +48,7 @@ SetJsObject(JSContext* aContext,
JS_NewStringCopyN(aContext,
NS_ConvertUTF16toUTF8(v.get_nsString()).get(),
v.get_nsString().Length());
NS_ENSURE_TRUE(JsData, NS_ERROR_FAILURE);
NS_ENSURE_TRUE(JsData, false);
val = STRING_TO_JSVAL(JsData);
break;
case BluetoothValue::Tuint32_t:
@ -66,7 +66,7 @@ SetJsObject(JSContext* aContext,
NS_ConvertUTF16toUTF8(arr[i].name()).get(),
&val)) {
NS_WARNING("Failed to set property");
return NS_ERROR_FAILURE;
return false;
}
}
} else {

View File

@ -592,14 +592,31 @@ dictionary MozStkLocalInfo
DOMString language;
};
dictionary MozStkLanguageSelectionEvent
{
/**
* The type of this event.
* It shall be nsIDOMMozIccManager.STK_EVENT_TYPE_LANGUAGE_SELECTION.
*/
unsigned short eventType;
/**
* Language Information
*
* @see ISO 639-1, Alpha-2 code
* "de" for German, "en" for English, "zh" for Chinese, etc.
*/
DOMString language;
};
dictionary MozStkGeneralEvent
{
/**
* The type of this event, MozStkGeneralEvent can be used for all Stk Event
* requires no more parameter than event type, including
* nsIDOMMozIccManager.STK_EVENT_TYPE_USER_ACTIVITY
* nsIDOMMozIccManager.STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE
* HCI Connectivity Event(Not defined in interface yet)
* nsIDOMMozIccManager.STK_EVENT_TYPE_USER_ACTIVITY.
* nsIDOMMozIccManager.STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE.
* HCI Connectivity Event(Not defined in interface yet).
*/
unsigned short eventType;
};

View File

@ -256,6 +256,8 @@ interface nsIDOMMozIccManager : nsIDOMEventTarget
* one of events below:
* - MozStkLocationEvent
* - MozStkCallEvent
* - MozStkLanguageSelectionEvent
* - MozStkGeneralEvent
*/
void sendStkEventDownload(in jsval event);

View File

@ -39,7 +39,6 @@ XPIDLSRCS = \
nsIDOMSVGEvent.idl \
nsIDOMSVGFilterElement.idl \
nsIDOMSVGFilters.idl \
nsIDOMSVGFitToViewBox.idl \
nsIDOMSVGForeignObjectElem.idl \
nsIDOMSVGGElement.idl \
nsIDOMSVGGradientElement.idl \
@ -65,7 +64,6 @@ XPIDLSRCS = \
nsIDOMSVGStyleElement.idl \
nsIDOMSVGSwitchElement.idl \
nsIDOMSVGSymbolElement.idl \
nsIDOMSVGTests.idl \
nsIDOMSVGTextContentElement.idl \
nsIDOMSVGTextElement.idl \
nsIDOMSVGTextPathElement.idl \

View File

@ -1,15 +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/. */
#include "domstubs.idl"
interface nsIDOMSVGAnimatedRect;
[scriptable, uuid(089410F3-9777-44f1-A882-AB4225696434)]
interface nsIDOMSVGFitToViewBox : nsISupports
{
readonly attribute nsIDOMSVGAnimatedRect viewBox;
readonly attribute nsISupports preserveAspectRatio;
};

View File

@ -1,17 +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/. */
#include "nsIDOMSVGStringList.idl"
[scriptable, uuid(b6186ed0-0861-11e1-be50-0800200c9a66)]
interface nsIDOMSVGTests : nsISupports
{
readonly attribute nsIDOMSVGStringList requiredFeatures;
readonly attribute nsIDOMSVGStringList requiredExtensions;
readonly attribute nsIDOMSVGStringList systemLanguage;
boolean hasExtension(in DOMString extension);
};

View File

@ -12,9 +12,10 @@ interface nsIControllers;
interface nsIBoxObject;
[scriptable, uuid(bece5b0b-6e59-4de5-98d0-088adfd1cadc)]
[scriptable, uuid(3a07dead-39e5-4dad-bc68-6ef369994126)]
interface nsIDOMXULElement : nsIDOMElement
{
attribute DOMString id;
attribute DOMString className;
// Layout properties

View File

@ -11,6 +11,8 @@
#include "nsIScriptGlobalObject.h"
#include "nsIPopupWindowManager.h"
#include "nsISupportsArray.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
// For PR_snprintf
#include "prprf.h"
@ -382,6 +384,33 @@ public:
mAudioSource, mVideoSource, false));
mediaThread->Dispatch(runnable, NS_DISPATCH_NORMAL);
#ifdef MOZ_WEBRTC
// Right now these configs are only of use if webrtc is available
nsresult rv;
nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIPrefBranch> branch = do_QueryInterface(prefs);
if (branch) {
int32_t aec = (int32_t) webrtc::kEcUnchanged;
int32_t agc = (int32_t) webrtc::kAgcUnchanged;
int32_t noise = (int32_t) webrtc::kNsUnchanged;
bool aec_on = false, agc_on = false, noise_on = false;
branch->GetBoolPref("media.peerconnection.aec_enabled", &aec_on);
branch->GetIntPref("media.peerconnection.aec", &aec);
branch->GetBoolPref("media.peerconnection.agc_enabled", &agc_on);
branch->GetIntPref("media.peerconnection.agc", &agc);
branch->GetBoolPref("media.peerconnection.noise_enabled", &noise_on);
branch->GetIntPref("media.peerconnection.noise", &noise);
mListener->AudioConfig(aec_on, (uint32_t) aec,
agc_on, (uint32_t) agc,
noise_on, (uint32_t) noise);
}
}
#endif
// We're in the main thread, so no worries here either.
nsCOMPtr<nsIDOMGetUserMediaSuccessCallback> success(mSuccess);
nsCOMPtr<nsIDOMGetUserMediaErrorCallback> error(mError);

View File

@ -21,6 +21,10 @@
#include "mozilla/StaticPtr.h"
#include "prlog.h"
#ifdef MOZ_WEBRTC
#include "mtransport/runnable_utils.h"
#endif
namespace mozilla {
#ifdef PR_LOGGING
@ -128,6 +132,23 @@ public:
// Can be invoked from EITHER MainThread or MSG thread
void Invalidate();
void
AudioConfig(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise)
{
if (mAudioSource) {
#ifdef MOZ_WEBRTC
// Right now these configs are only of use if webrtc is available
RUN_ON_THREAD(mMediaThread,
WrapRunnable(nsRefPtr<MediaEngineSource>(mAudioSource), // threadsafe
&MediaEngineSource::Config,
aEchoOn, aEcho, aAgcOn, aAGC, aNoiseOn, aNoise),
NS_DISPATCH_NORMAL);
#endif
}
}
void
Remove()
{

View File

@ -1237,8 +1237,12 @@ RadioInterfaceLayer.prototype = {
call.isActive = false;
if (this._activeCall &&
this._activeCall.callIndex == call.callIndex) {
// Previously active call is not active now. Disable audio.
// Previously active call is not active now.
this._activeCall = null;
}
if (!this._activeCall) {
// No active call. Disable the audio.
gAudioManager.phoneState = nsIAudioManager.PHONE_STATE_NORMAL;
debug("No active call, put audio system into PHONE_STATE_NORMAL: "
+ gAudioManager.phoneState);

View File

@ -907,6 +907,11 @@ this.STK_TERMINAL_SUPPORT_EVENT_USER_ACTIVITY = 0;
this.STK_TERMINAL_SUPPORT_EVENT_IDLE_SCREEN_AVAILABLE = 1;
this.STK_TERMINAL_SUPPORT_EVENT_CARD_READER_STATUS = 0;
this.STK_TERMINAL_SUPPORT_EVENT_LANGUAGE_SELECTION = 1;
this.STK_TERMINAL_SUPPORT_EVENT_BROWSER_TERMINATION = 0;
this.STK_TERMINAL_SUPPORT_EVENT_DATA_AVAILABLE = 0;
this.STK_TERMINAL_SUPPORT_EVENT_CHANNEL_STATUS = 0;
this.STK_TERMINAL_SUPPORT_PROACTIVE_TIMER_START_STOP = 1;
this.STK_TERMINAL_SUPPORT_PROACTIVE_TIMER_GET_CURRENT = 1;
this.STK_TERMINAL_SUPPORT_PROACTIVE_LOCAL_INFO_DATE = 1;
@ -925,6 +930,11 @@ this.STK_TERMINAL_SUPPORT_PROACTIVE_LANGUAGE_NOTIFICATION = 0;
this.STK_TERMINAL_SUPPORT_PROACTIVE_LAUNCH_BROWSER = 1;
this.STK_TERMINAL_SUPPORT_PROACTIVE_LOCAL_INFO_ACCESS_TECH = 0;
/**
* SAT profile
*
* @see ETSI TS 101.267, section 5.2.
*/
this.STK_TERMINAL_PROFILE_DOWNLOAD =
(STK_TERMINAL_SUPPORT_PROFILE_DOWNLOAD << 0) |
(STK_TERMINAL_SUPPORT_SMS_PP_DOWNLOAD << 1) |
@ -975,6 +985,12 @@ this.STK_TERMINAL_PROFILE_EVENT =
(STK_TERMINAL_SUPPORT_EVENT_IDLE_SCREEN_AVAILABLE << 6) |
(STK_TERMINAL_SUPPORT_EVENT_CARD_READER_STATUS << 7);
this.STK_TERMINAL_PROFILE_EVENT_EXT =
(STK_TERMINAL_SUPPORT_EVENT_LANGUAGE_SELECTION << 0) |
(STK_TERMINAL_SUPPORT_EVENT_BROWSER_TERMINATION << 1) |
(STK_TERMINAL_SUPPORT_EVENT_DATA_AVAILABLE << 2) |
(STK_TERMINAL_SUPPORT_EVENT_CHANNEL_STATUS << 3);
this.STK_TERMINAL_PROFILE_PROACTIVE_3 =
(STK_TERMINAL_SUPPORT_PROACTIVE_TIMER_START_STOP << 0) |
(STK_TERMINAL_SUPPORT_PROACTIVE_TIMER_GET_CURRENT << 1) |
@ -1001,7 +1017,7 @@ this.STK_SUPPORTED_TERMINAL_PROFILE = [
STK_TERMINAL_PROFILE_PROACTIVE_1,
STK_TERMINAL_PROFILE_PROACTIVE_2,
STK_TERMINAL_PROFILE_EVENT,
0x00, // Event extension
STK_TERMINAL_PROFILE_EVENT_EXT, // Event extension
0x00, // Multiple card proactive commands
STK_TERMINAL_PROFILE_PROACTIVE_3,
STK_TERMINAL_PROFILE_PROACTIVE_4,

View File

@ -2608,6 +2608,13 @@ let RIL = {
destinationId: STK_DEVICE_ID_SIM
};
break;
case STK_EVENT_TYPE_LANGUAGE_SELECTION:
command.deviceId = {
sourceId: STK_DEVICE_ID_ME,
destinationId: STK_DEVICE_ID_SIM
};
command.language = command.event.language;
break;
}
this.sendICCEnvelopeCommand(command);
},
@ -2729,6 +2736,11 @@ let RIL = {
ComprehensionTlvHelper.writeTimerValueTlv(options.timerValue, true);
}
// Language
if (options.language) {
ComprehensionTlvHelper.writeLanguageTlv(options.language);
}
// Calculate and write BER length to 2nd mark
Buf.stopCalOutgoingSize();

View File

@ -1514,6 +1514,64 @@ add_test(function test_stk_terminal_response() {
worker.RIL.sendStkTerminalResponse(response);
});
/**
* Verify Event Download Command : Language Selection
*/
add_test(function test_stk_event_download_language_selection() {
let worker = newUint8SupportOutgoingIndexWorker();
let buf = worker.Buf;
let pduHelper = worker.GsmPDUHelper;
buf.sendParcel = function () {
// Type
do_check_eq(this.readUint32(), REQUEST_STK_SEND_ENVELOPE_COMMAND)
// Token : we don't care
this.readUint32();
// Data Size, 26 = 2 * (2 + TLV_DEVICE_ID_SIZE(4) +
// TLV_EVENT_LIST_SIZE(3) +
// TLV_LANGUAGE(4))
do_check_eq(this.readUint32(), 26);
// BER tag
do_check_eq(pduHelper.readHexOctet(), BER_EVENT_DOWNLOAD_TAG);
// BER length, 19 = TLV_DEVICE_ID_SIZE(4) +
// TLV_EVENT_LIST_SIZE(3) +
// TLV_LANGUAGE(4)
do_check_eq(pduHelper.readHexOctet(), 11);
// Device Identifies, Type-Length-Value(Source ID-Destination ID)
do_check_eq(pduHelper.readHexOctet(), COMPREHENSIONTLV_TAG_DEVICE_ID |
COMPREHENSIONTLV_FLAG_CR);
do_check_eq(pduHelper.readHexOctet(), 2);
do_check_eq(pduHelper.readHexOctet(), STK_DEVICE_ID_ME);
do_check_eq(pduHelper.readHexOctet(), STK_DEVICE_ID_SIM);
// Event List, Type-Length-Value
do_check_eq(pduHelper.readHexOctet(), COMPREHENSIONTLV_TAG_EVENT_LIST |
COMPREHENSIONTLV_FLAG_CR);
do_check_eq(pduHelper.readHexOctet(), 1);
do_check_eq(pduHelper.readHexOctet(), STK_EVENT_TYPE_LANGUAGE_SELECTION);
// Language, Type-Length-Value
do_check_eq(pduHelper.readHexOctet(), COMPREHENSIONTLV_TAG_LANGUAGE);
do_check_eq(pduHelper.readHexOctet(), 2);
do_check_eq(pduHelper.read8BitUnpackedToString(2), "zh");
run_next_test();
};
let event = {
eventType: STK_EVENT_TYPE_LANGUAGE_SELECTION,
language: "zh"
};
worker.RIL.sendStkEventDownload({
event: event
});
});
/**
* Verify Event Download Command : Idle Screen Available
*/

View File

@ -28,6 +28,7 @@ MOCHITEST_CHROME_FILES = \
test_install_receipts.xul \
test_getNotInstalled.xul \
test_launch_paths.xul \
test_uninstall_errors.xul \
$(NULL)
MOCHITEST_FILES = \

View File

@ -0,0 +1,82 @@
<?xml version="1.0"?>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="Mozilla Bug 830258">
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<script type="application/javascript" src="head.js"/>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml">
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=830258"
target="_blank">Mozilla Bug 830258</a>
</body>
<script>
var url1 = "http://test1.example.com/chrome/dom/tests/mochitest/webapps/apps/basic.webapp";
var url2 = "http://test2.example.com/chrome/dom/tests/mochitest/webapps/apps/basic.webapp";
var app1, app2;
var steps = [
installTwoApps,
uninstallApp1,
uninstallApp1Again,
uninstallApp2
];
runAll(steps);
function installTwoApps(next) {
confirmNextInstall();
navigator.mozApps.install(url1, null).onsuccess = function onInstallApp1(evt) {
app1 = evt.target.result;
confirmNextInstall();
navigator.mozApps.install(url2, null).onsuccess = function onInstallApp2(evt) {
app2 = evt.target.result;
next();
};
};
}
function uninstallApp1(next) {
var request = navigator.mozApps.mgmt.uninstall(app1);
request.onsuccess = function onUninstallApp1Success() {
ok(true, "Succeed to uninstall the app1 as expected");
next();
};
request.onerror = function onUninstallApp1Error() {
ok(false, "Fail to uninstall the app1");
next();
};
}
function uninstallApp1Again(next) {
var request = navigator.mozApps.mgmt.uninstall(app1);
request.onsuccess = function onUninstallApp1AgainSuccess() {
ok(false, "Shouldn't be able to uninstall the app1 again");
next();
};
request.onerror = function onUninstallApp1AgainError() {
is(this.error.name, "NOT_INSTALLED", "Error name should be 'NOT_INSTALLED'");
next();
};
}
function uninstallApp2(next) {
var request = navigator.mozApps.mgmt.uninstall(app2);
request.onsuccess = function onUninstallApp2Success() {
ok(true, "Succeed to uninstall the app2 as expected");
next();
};
request.onerror = function onUninstallApp2Error() {
ok(false, "Fail to uninstall the app2");
next();
};
}
</script>
</window>

View File

@ -18,6 +18,7 @@ interface HTMLCanvasElement;
interface HTMLVideoElement;
interface TextMetrics;
interface Window;
interface XULElement;
enum CanvasWindingRule { "nonzero", "evenodd" };

View File

@ -31,7 +31,7 @@ enum VisibilityState { "hidden", "visible" };
/* http://dom.spec.whatwg.org/#interface-document */
[Constructor]
interface Document : Node {
[Throws, Constant]
[Throws]
readonly attribute DOMImplementation implementation;
readonly attribute DOMString URL;
readonly attribute DOMString documentURI;

View File

@ -26,8 +26,10 @@ interface Element : Node {
readonly attribute DOMString localName;
*/
// Not [Constant] because it depends on which document we're in
[Pure]
readonly attribute DOMString tagName;
[Pure]
attribute DOMString id;
/*
FIXME Bug 810677 Move className from HTMLElement to Element
@ -57,10 +59,15 @@ interface Element : Node {
[Constant]
readonly attribute HTMLCollection children;
[Pure]
readonly attribute Element? firstElementChild;
[Pure]
readonly attribute Element? lastElementChild;
[Pure]
readonly attribute Element? previousElementSibling;
[Pure]
readonly attribute Element? nextElementSibling;
[Pure]
readonly attribute unsigned long childElementCount;
// NEW
@ -148,6 +155,7 @@ partial interface Element {
// scrolling
void scrollIntoView(optional boolean top = true);
// None of the CSSOM attributes are [Pure], because they flush
attribute long scrollTop; // scroll on setting
attribute long scrollLeft; // scroll on setting
readonly attribute long scrollWidth;

View File

@ -15,23 +15,22 @@
interface DOMStringMap;
interface HTMLMenuElement;
// Hack to make sure that we initialize the touch prefs properly
[PrefControlled]
interface HTMLElement : Element {
// metadata attributes
attribute DOMString title;
attribute DOMString lang;
// attribute boolean translate;
[SetterThrows]
[SetterThrows, Pure]
attribute DOMString dir;
[Constant]
readonly attribute DOMStringMap dataset;
// microdata
[SetterThrows]
[SetterThrows, Pure]
attribute boolean itemScope;
[PutForwards=value,Constant] readonly attribute DOMSettableTokenList itemType;
[SetterThrows]
[SetterThrows, Pure]
attribute DOMString itemId;
[PutForwards=value,Constant] readonly attribute DOMSettableTokenList itemRef;
[PutForwards=value,Constant] readonly attribute DOMSettableTokenList itemProp;
@ -41,28 +40,31 @@ interface HTMLElement : Element {
attribute any itemValue;
// user interaction
[SetterThrows]
[SetterThrows, Pure]
attribute boolean hidden;
void click();
[SetterThrows]
[SetterThrows, Pure]
attribute long tabIndex;
[Throws]
void focus();
[Throws]
void blur();
[SetterThrows]
[SetterThrows, Pure]
attribute DOMString accessKey;
[Pure]
readonly attribute DOMString accessKeyLabel;
[SetterThrows]
[SetterThrows, Pure]
attribute boolean draggable;
//[PutForwards=value] readonly attribute DOMSettableTokenList dropzone;
[SetterThrows]
[SetterThrows, Pure]
attribute DOMString contentEditable;
[Pure]
readonly attribute boolean isContentEditable;
[Pure]
readonly attribute HTMLMenuElement? contextMenu;
//[SetterThrows]
// attribute HTMLMenuElement? contextMenu;
[SetterThrows]
[SetterThrows, Pure]
attribute boolean spellcheck;
// command API
@ -81,25 +83,6 @@ interface HTMLElement : Element {
// FIXME Bug 810677 Move className from HTMLElement to Element
attribute DOMString className;
[SetterThrows]
attribute EventHandler oncopy;
[SetterThrows]
attribute EventHandler oncut;
[SetterThrows]
attribute EventHandler onpaste;
};
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-htmlelement-interface
partial interface HTMLElement {
readonly attribute Element? offsetParent;
readonly attribute long offsetTop;
readonly attribute long offsetLeft;
readonly attribute long offsetWidth;
readonly attribute long offsetHeight;
};
[NoInterfaceObject]
interface TouchEventHandlers {
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
attribute EventHandler ontouchstart;
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
@ -112,10 +95,26 @@ interface TouchEventHandlers {
attribute EventHandler ontouchleave;
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
attribute EventHandler ontouchcancel;
[SetterThrows]
attribute EventHandler oncopy;
[SetterThrows]
attribute EventHandler oncut;
[SetterThrows]
attribute EventHandler onpaste;
};
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-htmlelement-interface
partial interface HTMLElement {
// CSSOM things are not [Pure] because they can flush
readonly attribute Element? offsetParent;
readonly attribute long offsetTop;
readonly attribute long offsetLeft;
readonly attribute long offsetWidth;
readonly attribute long offsetHeight;
};
HTMLElement implements GlobalEventHandlers;
HTMLElement implements NodeEventHandlers;
HTMLElement implements TouchEventHandlers;
interface HTMLUnknownElement : HTMLElement {};

View File

@ -30,24 +30,33 @@ interface Node : EventTarget {
const unsigned short NOTATION_NODE = 12; // historical
[Constant]
readonly attribute unsigned short nodeType;
[Pure]
readonly attribute DOMString nodeName;
[Pure]
readonly attribute DOMString? baseURI;
[Pure]
readonly attribute Document? ownerDocument;
[Pure]
readonly attribute Node? parentNode;
[Pure]
readonly attribute Element? parentElement;
boolean hasChildNodes();
[Constant]
readonly attribute NodeList childNodes;
[Pure]
readonly attribute Node? firstChild;
[Pure]
readonly attribute Node? lastChild;
[Pure]
readonly attribute Node? previousSibling;
[Pure]
readonly attribute Node? nextSibling;
[SetterThrows]
[SetterThrows, Pure]
attribute DOMString? nodeValue;
[SetterThrows]
[SetterThrows, Pure]
attribute DOMString? textContent;
[Throws]
Node insertBefore(Node node, Node? child);
@ -82,7 +91,7 @@ interface Node : EventTarget {
readonly attribute NamedNodeMap? attributes;
// If we move namespaceURI, prefix and localName to Element they should return
// a non-nullable type.
[Throws, Constant]
[Constant]
readonly attribute DOMString? namespaceURI;
[Constant]
readonly attribute DOMString? prefix;

View File

@ -12,8 +12,9 @@
interface SVGAnimatedEnumeration;
interface SVGClipPathElement : SVGTransformableElement {
interface SVGClipPathElement : SVGElement {
readonly attribute SVGAnimatedEnumeration clipPathUnits;
readonly attribute SVGAnimatedTransformList transform;
};
SVGClipPathElement implements SVGUnitTypes;

View File

@ -34,6 +34,19 @@ interface SVGElement : Element {
readonly attribute SVGSVGElement? ownerSVGElement;
readonly attribute SVGElement? viewportElement;
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
attribute EventHandler ontouchstart;
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
attribute EventHandler ontouchend;
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
attribute EventHandler ontouchmove;
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
attribute EventHandler ontouchenter;
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
attribute EventHandler ontouchleave;
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
attribute EventHandler ontouchcancel;
[SetterThrows]
attribute EventHandler oncopy;
[SetterThrows]
@ -44,4 +57,3 @@ interface SVGElement : Element {
SVGElement implements GlobalEventHandlers;
SVGElement implements NodeEventHandlers;
SVGElement implements TouchEventHandlers;

View File

@ -0,0 +1,41 @@
/* -*- 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 SVGAnimatedEnumeration;
interface SVGMarkerElement : SVGElement {
// Marker Unit Types
const unsigned short SVG_MARKERUNITS_UNKNOWN = 0;
const unsigned short SVG_MARKERUNITS_USERSPACEONUSE = 1;
const unsigned short SVG_MARKERUNITS_STROKEWIDTH = 2;
// Marker Orientation Types
const unsigned short SVG_MARKER_ORIENT_UNKNOWN = 0;
const unsigned short SVG_MARKER_ORIENT_AUTO = 1;
const unsigned short SVG_MARKER_ORIENT_ANGLE = 2;
readonly attribute SVGAnimatedLength refX;
readonly attribute SVGAnimatedLength refY;
readonly attribute SVGAnimatedEnumeration markerUnits;
readonly attribute SVGAnimatedLength markerWidth;
readonly attribute SVGAnimatedLength markerHeight;
readonly attribute SVGAnimatedEnumeration orientType;
readonly attribute SVGAnimatedAngle orientAngle;
void setOrientToAuto();
[Throws]
void setOrientToAngle(SVGAngle angle);
};
SVGMarkerElement implements SVGFitToViewBox;

View File

@ -133,6 +133,7 @@ webidl_files = \
SVGLinearGradientElement.webidl \
SVGLineElement.webidl \
SVGLocatableElement.webidl \
SVGMarkerElement.webidl \
SVGMaskElement.webidl \
SVGMatrix.webidl \
SVGMetadataElement.webidl \
@ -184,7 +185,6 @@ webidl_files = \
XMLHttpRequestUpload.webidl \
XMLSerializer.webidl \
XPathEvaluator.webidl \
XULElement.webidl \
$(NULL)
ifdef MOZ_WEBGL

View File

@ -1,134 +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/.
*/
interface MozBoxObject;
interface MozControllers;
interface MozFrameLoader;
interface MozRDFCompositeDataSource;
interface MozRDFResource;
interface MozXULTemplateBuilder;
// Hack to make sure that we initialize the touch prefs properly
[PrefControlled]
interface XULElement : Element {
[SetterThrows]
attribute DOMString className;
// Layout properties
[SetterThrows]
attribute DOMString align;
[SetterThrows]
attribute DOMString dir;
[SetterThrows]
attribute DOMString flex;
[SetterThrows]
attribute DOMString flexGroup;
[SetterThrows]
attribute DOMString ordinal;
[SetterThrows]
attribute DOMString orient;
[SetterThrows]
attribute DOMString pack;
// Properties for hiding elements.
attribute boolean hidden;
attribute boolean collapsed;
// Property for hooking up to broadcasters
[SetterThrows]
attribute DOMString observes;
// Properties for hooking up to popups
[SetterThrows]
attribute DOMString menu;
[SetterThrows]
attribute DOMString contextMenu;
[SetterThrows]
attribute DOMString tooltip;
// Width/height properties
[SetterThrows]
attribute DOMString width;
[SetterThrows]
attribute DOMString height;
[SetterThrows]
attribute DOMString minWidth;
[SetterThrows]
attribute DOMString minHeight;
[SetterThrows]
attribute DOMString maxWidth;
[SetterThrows]
attribute DOMString maxHeight;
// Persistence
[SetterThrows]
attribute DOMString persist;
// Position properties for
// * popups - these are screen coordinates
// * other elements - these are client coordinates relative to parent stack.
[SetterThrows]
attribute DOMString left;
[SetterThrows]
attribute DOMString top;
// XUL Template Builder
[SetterThrows]
attribute DOMString datasources;
[SetterThrows]
attribute DOMString ref;
// Tooltip and status info
[SetterThrows]
attribute DOMString tooltipText;
[SetterThrows]
attribute DOMString statusText;
attribute boolean allowEvents;
readonly attribute MozRDFCompositeDataSource? database;
readonly attribute MozXULTemplateBuilder? builder;
[Throws]
readonly attribute MozRDFResource? resource;
[Throws]
readonly attribute MozControllers controllers;
[Throws]
readonly attribute MozBoxObject? boxObject;
[Throws]
void focus();
[Throws]
void blur();
[Throws]
void click();
void doCommand();
// XXXbz this isn't really a nodelist! See bug 818548
NodeList getElementsByAttribute(DOMString name,
DOMString value);
// XXXbz this isn't really a nodelist! See bug 818548
[Throws]
NodeList getElementsByAttributeNS(DOMString namespaceURI,
DOMString name,
DOMString value);
[Constant]
readonly attribute CSSStyleDeclaration style;
};
// And the things from nsIFrameLoaderOwner
[NoInterfaceObject]
interface MozFrameLoaderOwner {
[ChromeOnly]
readonly attribute MozFrameLoader? frameLoader;
[ChromeOnly, Throws]
void swapFrameLoaders(XULElement aOtherOwner);
};
XULElement implements GlobalEventHandlers;
XULElement implements NodeEventHandlers;
XULElement implements TouchEventHandlers;
XULElement implements MozFrameLoaderOwner;

View File

@ -83,29 +83,34 @@ endif
CSRCS = \
pixman-access.c \
pixman-access-accessors.c \
pixman-arm.c \
pixman-bits-image.c \
pixman.c \
pixman-combine16.c \
pixman-combine32.c \
pixman-combine64.c \
pixman-conical-gradient.c \
pixman-cpu.c \
pixman-edge.c \
pixman-edge-accessors.c \
pixman-fast-path.c \
pixman-general.c \
pixman-gradient-walker.c \
pixman-glyph.c \
pixman-image.c \
pixman-implementation.c \
pixman-linear-gradient.c \
pixman-matrix.c \
pixman-mips.c \
pixman-noop.c \
pixman-ppc.c \
pixman-radial-gradient.c \
pixman-region16.c \
pixman-region32.c \
pixman-solid-fill.c \
pixman-srgb.c \
pixman-trap.c \
pixman-utils.c \
pixman-x86.c \
$(NULL)
ifdef USE_MMX

View File

@ -32,8 +32,8 @@
#include <string.h>
#include <assert.h>
#include "pixman-private.h"
#include "pixman-accessor.h"
#include "pixman-private.h"
#define CONVERT_RGB24_TO_Y15(s) \
(((((s) >> 16) & 0xff) * 153 + \
@ -210,6 +210,7 @@ get_shifts (pixman_format_code_t format,
break;
case PIXMAN_TYPE_ARGB:
case PIXMAN_TYPE_ARGB_SRGB:
*b = 0;
*g = *b + PIXMAN_FORMAT_B (format);
*r = *g + PIXMAN_FORMAT_G (format);
@ -1065,6 +1066,130 @@ fetch_pixel_generic_64 (bits_image_t *image,
return result;
}
/* The 32_sRGB paths should be deleted after narrow processing
* is no longer invoked for formats that are considered wide.
* (Also see fetch_pixel_generic_lossy_32) */
static void
fetch_scanline_a8r8g8b8_32_sRGB (pixman_image_t *image,
int x,
int y,
int width,
uint32_t *buffer,
const uint32_t *mask)
{
const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
const uint32_t *pixel = (uint32_t *)bits + x;
const uint32_t *end = pixel + width;
uint32_t tmp;
while (pixel < end)
{
tmp = READ (image, pixel++);
*buffer++ = (tmp >> 24) << 24
| (srgb_to_linear[(tmp >> 16) & 0xff] >> 8) << 16
| (srgb_to_linear[(tmp >> 8) & 0xff] >> 8) << 8
| (srgb_to_linear[(tmp >> 0) & 0xff] >> 8) << 0;
}
}
static void
fetch_scanline_a8r8g8b8_64_sRGB (pixman_image_t *image,
int x,
int y,
int width,
uint32_t *b,
const uint32_t *mask)
{
const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
const uint32_t *pixel = (uint32_t *)bits + x;
const uint32_t *end = pixel + width;
uint64_t *buffer = (uint64_t *)b;
uint32_t tmp;
while (pixel < end)
{
tmp = READ (image, pixel++);
*buffer++ = (uint64_t) ((tmp >> 24) * 257) << 48
| (uint64_t) srgb_to_linear[(tmp >> 16) & 0xff] << 32
| (uint64_t) srgb_to_linear[(tmp >> 8) & 0xff] << 16
| (uint64_t) srgb_to_linear[(tmp >> 0) & 0xff] << 0;
}
}
static uint32_t
fetch_pixel_a8r8g8b8_32_sRGB (bits_image_t *image,
int offset,
int line)
{
uint32_t *bits = image->bits + line * image->rowstride;
uint32_t tmp = READ (image, bits + offset);
return (tmp >> 24) << 24
| (srgb_to_linear[(tmp >> 16) & 0xff] >> 8) << 16
| (srgb_to_linear[(tmp >> 8) & 0xff] >> 8) << 8
| (srgb_to_linear[(tmp >> 0) & 0xff] >> 8) << 0;
}
static uint64_t
fetch_pixel_a8r8g8b8_64_sRGB (bits_image_t *image,
int offset,
int line)
{
uint32_t *bits = image->bits + line * image->rowstride;
uint32_t tmp = READ (image, bits + offset);
return (uint64_t) ((tmp >> 24) * 257) << 48
| (uint64_t) srgb_to_linear[(tmp >> 16) & 0xff] << 32
| (uint64_t) srgb_to_linear[(tmp >> 8) & 0xff] << 16
| (uint64_t) srgb_to_linear[(tmp >> 0) & 0xff] << 0;
}
static void
store_scanline_a8r8g8b8_32_sRGB (bits_image_t *image,
int x,
int y,
int width,
const uint32_t *v)
{
uint32_t *bits = image->bits + image->rowstride * y;
uint64_t *values = (uint64_t *)v;
uint32_t *pixel = bits + x;
uint64_t tmp;
int i;
for (i = 0; i < width; ++i)
{
tmp = values[i];
WRITE (image, pixel++,
((uint32_t) (tmp >> 24 ) << 24)
| (linear_to_srgb[(tmp >> 16 << 4) & 0xfff] << 16)
| (linear_to_srgb[(tmp >> 8 << 4) & 0xfff] << 8)
| (linear_to_srgb[(tmp >> 0 << 4) & 0xfff] << 0));
}
}
static void
store_scanline_a8r8g8b8_64_sRGB (bits_image_t *image,
int x,
int y,
int width,
const uint32_t *v)
{
uint32_t *bits = image->bits + image->rowstride * y;
uint64_t *values = (uint64_t *)v;
uint32_t *pixel = bits + x;
uint64_t tmp;
int i;
for (i = 0; i < width; ++i)
{
tmp = values[i];
WRITE (image, pixel++,
((uint32_t) (tmp >> 56) << 24)
| (linear_to_srgb[(tmp >> 36) & 0xfff] << 16)
| (linear_to_srgb[(tmp >> 20) & 0xfff] << 8)
| (linear_to_srgb[(tmp >> 4) & 0xfff] << 0));
}
}
/*
* XXX: The transformed fetch path only works at 32-bpp so far. When all
* paths have wide versions, this can be removed.
@ -1132,6 +1257,13 @@ static const format_info_t accessors[] =
FORMAT_INFO (r8g8b8x8),
FORMAT_INFO (x14r6g6b6),
/* sRGB formats */
{ PIXMAN_a8r8g8b8_sRGB,
fetch_scanline_a8r8g8b8_32_sRGB,
fetch_scanline_a8r8g8b8_64_sRGB,
fetch_pixel_a8r8g8b8_32_sRGB, fetch_pixel_a8r8g8b8_64_sRGB,
store_scanline_a8r8g8b8_32_sRGB, store_scanline_a8r8g8b8_64_sRGB },
/* 24bpp formats */
FORMAT_INFO (r8g8b8),
FORMAT_INFO (b8g8r8),

View File

@ -64,6 +64,7 @@
.altmacro
.p2align 2
#include "pixman-private.h"
#include "pixman-arm-neon-asm.h"
/*
@ -488,12 +489,12 @@ fname:
vmull.u8 q1, d0, d28
vmlal.u8 q1, d1, d29
/* 5 cycles bubble */
vshll.u16 q0, d2, #8
vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q0, d2, d30
vmlal.u16 q0, d3, d30
/* 5 cycles bubble */
bilinear_duplicate_mask mask_fmt, 1, d4
vshrn.u32 d0, q0, #16
vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
/* 3 cycles bubble */
vmovn.u16 d0, q0
/* 1 cycle bubble */
@ -514,16 +515,16 @@ fname:
q1, q11, d0, d1, d20, d21, d22, d23
bilinear_load_mask mask_fmt, 2, d4
bilinear_load_dst dst_fmt, op, 2, d18, d19, q9
vshll.u16 q0, d2, #8
vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q0, d2, d30
vmlal.u16 q0, d3, d30
vshll.u16 q10, d22, #8
vshll.u16 q10, d22, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q10, d22, d31
vmlal.u16 q10, d23, d31
vshrn.u32 d0, q0, #16
vshrn.u32 d1, q10, #16
vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d1, q10, #(2 * BILINEAR_INTERPOLATION_BITS)
bilinear_duplicate_mask mask_fmt, 2, d4
vshr.u16 q15, q12, #8
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13
vmovn.u16 d0, q0
bilinear_interleave_src_dst \
@ -544,29 +545,29 @@ fname:
q3, q9, d4, d5, d16, d17, d18, d19
pld [TMP1, PF_OFFS]
sub TMP1, TMP1, STRIDE
vshll.u16 q0, d2, #8
vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q0, d2, d30
vmlal.u16 q0, d3, d30
vshll.u16 q10, d22, #8
vshll.u16 q10, d22, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q10, d22, d31
vmlal.u16 q10, d23, d31
vshr.u16 q15, q12, #8
vshll.u16 q2, d6, #8
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vshll.u16 q2, d6, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q2, d6, d30
vmlal.u16 q2, d7, d30
vshll.u16 q8, d18, #8
vshll.u16 q8, d18, #BILINEAR_INTERPOLATION_BITS
bilinear_load_mask mask_fmt, 4, d22
bilinear_load_dst dst_fmt, op, 4, d2, d3, q1
pld [TMP1, PF_OFFS]
vmlsl.u16 q8, d18, d31
vmlal.u16 q8, d19, d31
vadd.u16 q12, q12, q13
vshrn.u32 d0, q0, #16
vshrn.u32 d1, q10, #16
vshrn.u32 d4, q2, #16
vshrn.u32 d5, q8, #16
vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d1, q10, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d5, q8, #(2 * BILINEAR_INTERPOLATION_BITS)
bilinear_duplicate_mask mask_fmt, 4, d22
vshr.u16 q15, q12, #8
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vmovn.u16 d0, q0
vmovn.u16 d1, q2
vadd.u16 q12, q12, q13
@ -694,13 +695,13 @@ pixman_asm_function fname
blt 0f
tst OUT, #(1 << dst_bpp_shift)
beq 0f
vshr.u16 q15, q12, #8
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13
bilinear_process_last_pixel
sub WIDTH, WIDTH, #1
0:
vadd.u16 q13, q13, q13
vshr.u16 q15, q12, #8
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13
cmp WIDTH, #2
@ -921,7 +922,7 @@ pixman_asm_function fname
vmull.u8 q10, d22, d28
vmlal.u8 q10, d23, d29
vshll.u16 q0, d16, #8
vshll.u16 q0, d16, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q0, d16, d30
vmlal.u16 q0, d17, d30
@ -932,27 +933,27 @@ pixman_asm_function fname
vmull.u8 q11, d16, d28
vmlal.u8 q11, d17, d29
vshll.u16 q1, d18, #8
vshll.u16 q1, d18, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q1, d18, d31
vmlal.u16 q1, d19, d31
vshr.u16 q15, q12, #8
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13
.endm
.macro bilinear_over_8888_8888_process_pixblock_tail
vshll.u16 q2, d20, #8
vshll.u16 q2, d20, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q2, d20, d30
vmlal.u16 q2, d21, d30
vshll.u16 q3, d22, #8
vshll.u16 q3, d22, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q3, d22, d31
vmlal.u16 q3, d23, d31
vshrn.u32 d0, q0, #16
vshrn.u32 d1, q1, #16
vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d1, q1, #(2 * BILINEAR_INTERPOLATION_BITS)
vld1.32 {d2, d3}, [OUT, :128]
pld [OUT, #(prefetch_offset * 4)]
vshrn.u32 d4, q2, #16
vshr.u16 q15, q12, #8
vshrn.u32 d5, q3, #16
vshrn.u32 d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d5, q3, #(2 * BILINEAR_INTERPOLATION_BITS)
vmovn.u16 d6, q0
vmovn.u16 d7, q2
vuzp.8 d6, d7
@ -975,7 +976,7 @@ pixman_asm_function fname
.endm
.macro bilinear_over_8888_8888_process_pixblock_tail_head
vshll.u16 q2, d20, #8
vshll.u16 q2, d20, #BILINEAR_INTERPOLATION_BITS
mov TMP1, X, asr #16
add X, X, UX
add TMP1, TOP, TMP1, asl #2
@ -984,21 +985,21 @@ pixman_asm_function fname
add X, X, UX
add TMP2, TOP, TMP2, asl #2
vmlal.u16 q2, d21, d30
vshll.u16 q3, d22, #8
vshll.u16 q3, d22, #BILINEAR_INTERPOLATION_BITS
vld1.32 {d20}, [TMP1], STRIDE
vmlsl.u16 q3, d22, d31
vmlal.u16 q3, d23, d31
vld1.32 {d21}, [TMP1]
vmull.u8 q8, d20, d28
vmlal.u8 q8, d21, d29
vshrn.u32 d0, q0, #16
vshrn.u32 d1, q1, #16
vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d1, q1, #(2 * BILINEAR_INTERPOLATION_BITS)
vld1.32 {d2, d3}, [OUT, :128]
pld [OUT, PF_OFFS]
vshrn.u32 d4, q2, #16
vshr.u16 q15, q12, #8
vshrn.u32 d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vld1.32 {d22}, [TMP2], STRIDE
vshrn.u32 d5, q3, #16
vshrn.u32 d5, q3, #(2 * BILINEAR_INTERPOLATION_BITS)
vmovn.u16 d6, q0
vld1.32 {d23}, [TMP2]
vmull.u8 q9, d22, d28
@ -1022,7 +1023,7 @@ pixman_asm_function fname
vmlal.u8 q10, d23, d29
vmull.u8 q11, d2, d4
vmull.u8 q2, d3, d4
vshll.u16 q0, d16, #8
vshll.u16 q0, d16, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q0, d16, d30
vrshr.u16 q1, q11, #8
vmlal.u16 q0, d17, d30
@ -1037,12 +1038,12 @@ pixman_asm_function fname
vmull.u8 q11, d16, d28
vmlal.u8 q11, d17, d29
vuzp.8 d6, d7
vshll.u16 q1, d18, #8
vshll.u16 q1, d18, #BILINEAR_INTERPOLATION_BITS
vuzp.8 d6, d7
vmlsl.u16 q1, d18, d31
vadd.u16 q12, q12, q13
vmlal.u16 q1, d19, d31
vshr.u16 q15, q12, #8
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13
vst1.32 {d6, d7}, [OUT, :128]!
.endm
@ -1081,14 +1082,14 @@ pixman_asm_function fname
vmull.u8 q3, d2, d28
vmlal.u8 q2, d1, d29
vmlal.u8 q3, d3, d29
vshll.u16 q0, d4, #8
vshll.u16 q1, d6, #8
vshll.u16 q0, d4, #BILINEAR_INTERPOLATION_BITS
vshll.u16 q1, d6, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q0, d4, d30
vmlsl.u16 q1, d6, d31
vmlal.u16 q0, d5, d30
vmlal.u16 q1, d7, d31
vshrn.u32 d0, q0, #16
vshrn.u32 d1, q1, #16
vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d1, q1, #(2 * BILINEAR_INTERPOLATION_BITS)
vld1.32 {d2}, [TMP3], STRIDE
vld1.32 {d3}, [TMP3]
pld [TMP4, PF_OFFS]
@ -1099,7 +1100,7 @@ pixman_asm_function fname
vmlal.u8 q3, d3, d29
vmull.u8 q1, d4, d28
vmlal.u8 q1, d5, d29
vshr.u16 q15, q12, #8
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vld1.32 {d22[0]}, [MASK]!
pld [MASK, #prefetch_offset]
vadd.u16 q12, q12, q13
@ -1107,17 +1108,17 @@ pixman_asm_function fname
.endm
.macro bilinear_over_8888_8_8888_process_pixblock_tail
vshll.u16 q9, d6, #8
vshll.u16 q10, d2, #8
vshll.u16 q9, d6, #BILINEAR_INTERPOLATION_BITS
vshll.u16 q10, d2, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q9, d6, d30
vmlsl.u16 q10, d2, d31
vmlal.u16 q9, d7, d30
vmlal.u16 q10, d3, d31
vshr.u16 q15, q12, #8
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13
vdup.32 d22, d22[0]
vshrn.u32 d18, q9, #16
vshrn.u32 d19, q10, #16
vshrn.u32 d18, q9, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d19, q10, #(2 * BILINEAR_INTERPOLATION_BITS)
vmovn.u16 d17, q9
vld1.32 {d18, d19}, [OUT, :128]
pld [OUT, PF_OFFS]
@ -1146,11 +1147,11 @@ pixman_asm_function fname
.endm
.macro bilinear_over_8888_8_8888_process_pixblock_tail_head
vshll.u16 q9, d6, #8
vshll.u16 q9, d6, #BILINEAR_INTERPOLATION_BITS
mov TMP1, X, asr #16
add X, X, UX
add TMP1, TOP, TMP1, asl #2
vshll.u16 q10, d2, #8
vshll.u16 q10, d2, #BILINEAR_INTERPOLATION_BITS
vld1.32 {d0}, [TMP1], STRIDE
mov TMP2, X, asr #16
add X, X, UX
@ -1167,12 +1168,12 @@ pixman_asm_function fname
mov TMP4, X, asr #16
add X, X, UX
add TMP4, TOP, TMP4, asl #2
vshr.u16 q15, q12, #8
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13
vld1.32 {d3}, [TMP2]
vdup.32 d22, d22[0]
vshrn.u32 d18, q9, #16
vshrn.u32 d19, q10, #16
vshrn.u32 d18, q9, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d19, q10, #(2 * BILINEAR_INTERPOLATION_BITS)
vmull.u8 q2, d0, d28
vmull.u8 q3, d2, d28
vmovn.u16 d17, q9
@ -1182,8 +1183,8 @@ pixman_asm_function fname
vmlal.u8 q3, d3, d29
vuzp.8 d16, d17
vuzp.8 d18, d19
vshll.u16 q0, d4, #8
vshll.u16 q1, d6, #8
vshll.u16 q0, d4, #BILINEAR_INTERPOLATION_BITS
vshll.u16 q1, d6, #BILINEAR_INTERPOLATION_BITS
vuzp.8 d16, d17
vuzp.8 d18, d19
vmlsl.u16 q0, d4, d30
@ -1194,8 +1195,8 @@ pixman_asm_function fname
vmlal.u16 q1, d7, d31
vrsra.u16 q10, q10, #8
vrsra.u16 q11, q11, #8
vshrn.u32 d0, q0, #16
vshrn.u32 d1, q1, #16
vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d1, q1, #(2 * BILINEAR_INTERPOLATION_BITS)
vrshrn.u16 d16, q10, #8
vrshrn.u16 d17, q11, #8
vld1.32 {d2}, [TMP3], STRIDE
@ -1216,7 +1217,7 @@ pixman_asm_function fname
vraddhn.u16 d18, q9, q10
vraddhn.u16 d19, q15, q11
vmlal.u8 q1, d5, d29
vshr.u16 q15, q12, #8
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vqadd.u8 q9, q8, q9
vld1.32 {d22[0]}, [MASK]!
vuzp.8 d18, d19

Some files were not shown because too many files have changed in this diff Show More