зеркало из https://github.com/mozilla/pjs.git
Merge last green changeset of m-c to m-i
This commit is contained in:
Коммит
614e8bdc51
|
@ -713,7 +713,6 @@ let UI = {
|
|||
if (data == "enter" || data == "exit") {
|
||||
hideSearch();
|
||||
self._privateBrowsing.transitionMode = data;
|
||||
self.storageBusy();
|
||||
}
|
||||
} else if (topic == "private-browsing-transition-complete") {
|
||||
// We use .transitionMode here, as aData is empty.
|
||||
|
@ -722,7 +721,6 @@ let UI = {
|
|||
self.showTabView(false);
|
||||
|
||||
self._privateBrowsing.transitionMode = "";
|
||||
self.storageReady();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -869,8 +867,12 @@ let UI = {
|
|||
this._currentTab = tab;
|
||||
|
||||
if (this.isTabViewVisible()) {
|
||||
if (!this.restoredClosedTab && this._lastOpenedTab == tab &&
|
||||
tab._tabViewTabItem) {
|
||||
// We want to zoom in if:
|
||||
// 1) we didn't just restore a tab via Ctrl+Shift+T
|
||||
// 2) we're not in the middle of switching from/to private browsing
|
||||
// 3) the currently selected tab is the last created tab and has a tabItem
|
||||
if (!this.restoredClosedTab && !this._privateBrowsing.transitionMode &&
|
||||
this._lastOpenedTab == tab && tab._tabViewTabItem) {
|
||||
tab._tabViewTabItem.zoomIn(true);
|
||||
this._lastOpenedTab = null;
|
||||
return;
|
||||
|
@ -1130,18 +1132,26 @@ let UI = {
|
|||
function getClosestTabBy(norm) {
|
||||
if (!self.getActiveTab())
|
||||
return null;
|
||||
let centers =
|
||||
[[item.bounds.center(), item]
|
||||
for each(item in TabItems.getItems()) if (!item.parent || !item.parent.hidden)];
|
||||
let myCenter = self.getActiveTab().bounds.center();
|
||||
let matches = centers
|
||||
.filter(function(item){return norm(item[0], myCenter)})
|
||||
.sort(function(a,b){
|
||||
return myCenter.distance(a[0]) - myCenter.distance(b[0]);
|
||||
});
|
||||
if (matches.length > 0)
|
||||
return matches[0][1];
|
||||
return null;
|
||||
|
||||
let activeTab = self.getActiveTab();
|
||||
let activeTabGroup = activeTab.parent;
|
||||
let myCenter = activeTab.bounds.center();
|
||||
let match;
|
||||
|
||||
TabItems.getItems().forEach(function (item) {
|
||||
if (!item.parent.hidden &&
|
||||
(!activeTabGroup.expanded || activeTabGroup.id == item.parent.id)) {
|
||||
let itemCenter = item.bounds.center();
|
||||
|
||||
if (norm(itemCenter, myCenter)) {
|
||||
let itemDist = myCenter.distance(itemCenter);
|
||||
if (!match || match[0] > itemDist)
|
||||
match = [itemDist, item];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return match && match[1];
|
||||
}
|
||||
|
||||
let preventDefault = true;
|
||||
|
@ -1613,11 +1623,15 @@ let UI = {
|
|||
getFavIconUrlForTab: function UI_getFavIconUrlForTab(tab) {
|
||||
let url;
|
||||
|
||||
// use the tab image if it doesn't start with http e.g. data:image/png, chrome://
|
||||
if (tab.image && !(/^https?:/.test(tab.image)))
|
||||
url = tab.image;
|
||||
else
|
||||
if (tab.image) {
|
||||
// if starts with http/https, fetch icon from favicon service via the moz-anno protocal
|
||||
if (/^https?:/.test(tab.image))
|
||||
url = gFavIconService.getFaviconLinkForIcon(gWindow.makeURI(tab.image)).spec;
|
||||
else
|
||||
url = tab.image;
|
||||
} else {
|
||||
url = gFavIconService.getFaviconImageForPage(tab.linkedBrowser.currentURI).spec;
|
||||
}
|
||||
|
||||
return url;
|
||||
},
|
||||
|
|
|
@ -120,6 +120,7 @@ _BROWSER_FILES = \
|
|||
browser_tabview_bug628061.js \
|
||||
browser_tabview_bug628165.js \
|
||||
browser_tabview_bug628270.js \
|
||||
browser_tabview_bug628887.js \
|
||||
browser_tabview_bug629189.js \
|
||||
browser_tabview_bug629195.js \
|
||||
browser_tabview_bug630102.js \
|
||||
|
@ -154,6 +155,7 @@ _BROWSER_FILES = \
|
|||
browser_tabview_bug669694.js \
|
||||
browser_tabview_bug673196.js \
|
||||
browser_tabview_bug673729.js \
|
||||
browser_tabview_bug679853.js \
|
||||
browser_tabview_bug681599.js \
|
||||
browser_tabview_click_group.js \
|
||||
browser_tabview_dragdrop.js \
|
||||
|
|
|
@ -40,8 +40,18 @@ function onTabViewWindowLoaded() {
|
|||
// fired, a delay is used here to avoid the test code run before the browser
|
||||
// code.
|
||||
executeSoon(function() {
|
||||
is($icon.attr("src"), fi.defaultFavicon.spec,
|
||||
"The icon is showing the default fav icon");
|
||||
let iconSrc = $icon.attr("src");
|
||||
let hasData = true;
|
||||
try {
|
||||
fi.getFaviconDataAsDataURL(iconSrc);
|
||||
} catch(e) {
|
||||
hasData = false;
|
||||
}
|
||||
ok(!hasData, "The icon src doesn't return any data");
|
||||
// with moz-anno:favicon automatically redirects to the default favIcon
|
||||
// if the given url is invalid
|
||||
ok(/^moz-anno:favicon:/.test(iconSrc),
|
||||
"The icon url starts with moz-anno:favicon so the default fav icon would be displayed");
|
||||
|
||||
// clean up
|
||||
gBrowser.removeTab(newTab);
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
newWindowWithTabView(function(win) {
|
||||
registerCleanupFunction(function() win.close());
|
||||
|
||||
let cw = win.TabView.getContentWindow();
|
||||
let groupItemOne = cw.GroupItems.groupItems[0];
|
||||
|
||||
let groupItemTwo = createGroupItemWithBlankTabs(win, 100, 100, 40, 2);
|
||||
ok(groupItemTwo.isStacked(), "groupItem is now stacked");
|
||||
|
||||
is(win.gBrowser.tabs.length, 3, "There are three tabs");
|
||||
|
||||
// the focus should remain within the group after it's expanded
|
||||
groupItemTwo.addSubscriber("expanded", function onExpanded() {
|
||||
groupItemTwo.removeSubscriber("expanded", onExpanded);
|
||||
|
||||
ok(groupItemTwo.expanded, "groupItemTwo is expanded");
|
||||
is(cw.UI.getActiveTab(), groupItemTwo.getChild(0),
|
||||
"The first tab item in group item two is active in expanded mode");
|
||||
|
||||
EventUtils.synthesizeKey("VK_DOWN", {}, cw);
|
||||
is(cw.UI.getActiveTab(), groupItemTwo.getChild(0),
|
||||
"The first tab item is still active after pressing down key");
|
||||
|
||||
// the focus should goes to other group if the down arrow is pressed
|
||||
groupItemTwo.addSubscriber("collapsed", function onExpanded() {
|
||||
groupItemTwo.removeSubscriber("collapsed", onExpanded);
|
||||
|
||||
ok(!groupItemTwo.expanded, "groupItemTwo is not expanded");
|
||||
is(cw.UI.getActiveTab(), groupItemTwo.getChild(0),
|
||||
"The first tab item is active in group item two in collapsed mode");
|
||||
|
||||
EventUtils.synthesizeKey("VK_DOWN", {}, cw);
|
||||
is(cw.UI.getActiveTab(), groupItemOne.getChild(0),
|
||||
"The first tab item in group item one is active after pressing down key");
|
||||
|
||||
finish();
|
||||
});
|
||||
|
||||
groupItemTwo.collapse();
|
||||
});
|
||||
|
||||
groupItemTwo.expand();
|
||||
});
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
// clean up after ourselves
|
||||
registerCleanupFunction(function () {
|
||||
while (gBrowser.tabs.length > 1)
|
||||
gBrowser.removeTab(gBrowser.tabs[1]);
|
||||
|
||||
hideTabView();
|
||||
});
|
||||
|
||||
// select the new tab
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
|
||||
showTabView(function () {
|
||||
// enter private browsing mode
|
||||
togglePrivateBrowsing(function () {
|
||||
ok(!TabView.isVisible(), "tabview is hidden");
|
||||
|
||||
showTabView(function () {
|
||||
// leave private browsing mode
|
||||
togglePrivateBrowsing(function () {
|
||||
ok(TabView.isVisible(), "tabview is visible");
|
||||
hideTabView(finish);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
10
configure.in
10
configure.in
|
@ -4797,9 +4797,7 @@ MOZ_ARG_ENABLE_STRING(application,
|
|||
xulrunner
|
||||
content/xslt (Standalone Transformiix XSLT)
|
||||
netwerk (Standalone Necko)
|
||||
tools/update-packaging (AUS-related packaging tools)
|
||||
standalone (use this for standalone
|
||||
xpcom/xpconnect or to manually drive a build)],
|
||||
tools/update-packaging (AUS-related packaging tools)],
|
||||
[ MOZ_BUILD_APP=$enableval ] )
|
||||
|
||||
MOZ_ARG_WITH_STRING(xulrunner-stub-name,
|
||||
|
@ -4877,12 +4875,6 @@ content/xslt)
|
|||
AC_DEFINE(TX_EXE)
|
||||
;;
|
||||
|
||||
standalone)
|
||||
MOZ_APP_NAME=mozilla
|
||||
MOZ_APP_DISPLAYNAME=Mozilla
|
||||
MOZ_APP_VERSION=$MOZILLA_VERSION
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
AC_SUBST(MOZ_BUILD_APP)
|
||||
|
|
|
@ -1230,23 +1230,20 @@ nsXMLHttpRequest::GetResponseHeader(const nsACString& header,
|
|||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsXMLHttpRequest::GetLoadGroup(nsILoadGroup **aLoadGroup)
|
||||
already_AddRefed<nsILoadGroup>
|
||||
nsXMLHttpRequest::GetLoadGroup() const
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aLoadGroup);
|
||||
*aLoadGroup = nsnull;
|
||||
|
||||
if (mState & XML_HTTP_REQUEST_BACKGROUND) {
|
||||
return NS_OK;
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocument> doc =
|
||||
nsContentUtils::GetDocumentFromScriptContext(mScriptContext);
|
||||
if (doc) {
|
||||
*aLoadGroup = doc->GetDocumentLoadGroup().get(); // already_AddRefed
|
||||
return doc->GetDocumentLoadGroup();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -1493,8 +1490,7 @@ nsXMLHttpRequest::Open(const nsACString& method, const nsACString& url,
|
|||
// When we are called from JS we can find the load group for the page,
|
||||
// and add ourselves to it. This way any pending requests
|
||||
// will be automatically aborted if the user leaves the page.
|
||||
nsCOMPtr<nsILoadGroup> loadGroup;
|
||||
GetLoadGroup(getter_AddRefs(loadGroup));
|
||||
nsCOMPtr<nsILoadGroup> loadGroup = GetLoadGroup();
|
||||
|
||||
// get Content Security Policy from principal to pass into channel
|
||||
nsCOMPtr<nsIChannelPolicy> channelPolicy;
|
||||
|
@ -1728,6 +1724,7 @@ nsXMLHttpRequest::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
|
|||
mResponseBody.Truncate();
|
||||
mResponseBodyUnicode.SetIsVoid(PR_TRUE);
|
||||
mResponseBlob = nsnull;
|
||||
mResultArrayBuffer = nsnull;
|
||||
|
||||
// Set up responseXML
|
||||
PRBool parseBody = mResponseType == XML_HTTP_RESPONSE_TYPE_DEFAULT ||
|
||||
|
@ -2075,7 +2072,7 @@ GetRequestBody(nsIVariant* aBody, nsIInputStream** aResult,
|
|||
// nsIInputStream?
|
||||
nsCOMPtr<nsIInputStream> stream = do_QueryInterface(supports);
|
||||
if (stream) {
|
||||
*aResult = stream.forget().get();
|
||||
stream.forget(aResult);
|
||||
aCharset.Truncate();
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -214,7 +214,7 @@ protected:
|
|||
// Change the state of the object with this. The broadcast argument
|
||||
// determines if the onreadystatechange listener should be called.
|
||||
nsresult ChangeState(PRUint32 aState, PRBool aBroadcast = PR_TRUE);
|
||||
nsresult GetLoadGroup(nsILoadGroup **aLoadGroup);
|
||||
already_AddRefed<nsILoadGroup> GetLoadGroup() const;
|
||||
nsIURI *GetBaseURI();
|
||||
|
||||
nsresult RemoveAddEventListener(const nsAString& aType,
|
||||
|
|
|
@ -121,6 +121,17 @@ ab = xhr.response;
|
|||
ok(ab != null, "should have a non-null arraybuffer");
|
||||
arraybuffer_equals_to(ab, "hello pass\n");
|
||||
|
||||
// test reusing the same XHR (Bug 680816)
|
||||
xhr.open("GET", 'file_XHR_binary1.bin', false);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.send(null);
|
||||
is(xhr.status, 200, "wrong status");
|
||||
ab2 = xhr.response;
|
||||
ok(ab2 != null, "should have a non-null arraybuffer");
|
||||
ok(ab2 != ab, "arraybuffer on XHR reuse should be distinct");
|
||||
arraybuffer_equals_to(ab, "hello pass\n");
|
||||
arraybuffer_equals_to(ab2, "\xaa\xee\0\x03\xff\xff\xff\xff\xbb\xbb\xbb\xbb");
|
||||
|
||||
// with a binary file
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", 'file_XHR_binary1.bin', false);
|
||||
|
|
|
@ -197,8 +197,6 @@ _TEST_FILES = \
|
|||
test_bug573969.html \
|
||||
test_bug549475.html \
|
||||
test_bug585508.html \
|
||||
test_bug345624-1.html \
|
||||
test_bug345624-2.html \
|
||||
test_bug561640.html \
|
||||
test_bug566064.html \
|
||||
test_bug582412-1.html \
|
||||
|
@ -213,7 +211,6 @@ _TEST_FILES = \
|
|||
test_bug590353-1.html \
|
||||
test_bug590353-2.html \
|
||||
test_bug593689.html \
|
||||
test_bug555840.html \
|
||||
test_bug561636.html \
|
||||
test_bug590363.html \
|
||||
test_bug557628.html \
|
||||
|
@ -221,7 +218,6 @@ _TEST_FILES = \
|
|||
test_bug595429.html \
|
||||
test_bug595447.html \
|
||||
test_bug595449.html \
|
||||
test_bug595457.html \
|
||||
test_bug557087-1.html \
|
||||
test_bug557087-2.html \
|
||||
test_bug557087-3.html \
|
||||
|
@ -234,7 +230,6 @@ _TEST_FILES = \
|
|||
test_bug596350.html \
|
||||
test_bug598833-1.html \
|
||||
test_bug600155.html \
|
||||
test_bug556007.html \
|
||||
test_bug606817.html \
|
||||
test_bug297761.html \
|
||||
file_bug297761.html \
|
||||
|
|
|
@ -48,6 +48,7 @@ _TEST_FILES = \
|
|||
test_save_restore_radio_groups.html \
|
||||
test_mozistextfield.html \
|
||||
test_input_attributes_reflection.html \
|
||||
test_input_list_attribute.html \
|
||||
test_input_email.html \
|
||||
test_input_url.html \
|
||||
test_pattern_attribute.html \
|
||||
|
@ -59,6 +60,9 @@ _TEST_FILES = \
|
|||
test_output_element.html \
|
||||
test_button_attributes_reflection.html \
|
||||
test_textarea_attributes_reflection.html \
|
||||
test_validation.html \
|
||||
test_maxlength_attribute.html \
|
||||
test_datalist_element.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=555840
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 555840</title>
|
||||
<title>Test for the datalist element</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=555840">Mozilla Bug 555840</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<datalist>
|
||||
|
@ -55,26 +51,62 @@ function checkOptions()
|
|||
[['option', 'option'], function(d) { d.childNodes[0].value = 'value'; }, 2],
|
||||
[['option', 'option'], function(d) { d.childNodes[0].label = 'label'; }, 2],
|
||||
[['option', 'option'], function(d) { d.childNodes[0].value = 'value'; d.childNodes[0].label = 'label'; }, 2],
|
||||
[['select'],
|
||||
function(d) {
|
||||
var s = d.childNodes[0];
|
||||
s.appendChild(new Option("foo"));
|
||||
s.appendChild(new Option("bar"));
|
||||
},
|
||||
2],
|
||||
[['select'],
|
||||
function(d) {
|
||||
var s = d.childNodes[0];
|
||||
s.appendChild(new Option("foo"));
|
||||
s.appendChild(new Option("bar"));
|
||||
var label = document.createElement("label");
|
||||
d.appendChild(label);
|
||||
label.appendChild(new Option("foobar"));
|
||||
},
|
||||
3],
|
||||
[['select'],
|
||||
function(d) {
|
||||
var s = d.childNodes[0];
|
||||
s.appendChild(new Option("foo"));
|
||||
s.appendChild(new Option("bar"));
|
||||
var label = document.createElement("label");
|
||||
d.appendChild(label);
|
||||
label.appendChild(new Option("foobar"));
|
||||
s.appendChild(new Option())
|
||||
},
|
||||
4],
|
||||
[[], function(d) { d.appendChild(document.createElementNS("foo", "option")); }, 0]
|
||||
];
|
||||
|
||||
var d = document.getElementsByTagName('datalist')[0];
|
||||
var cachedOptions = d.options;
|
||||
|
||||
for each (data in testData) {
|
||||
for each (e in data[0]) {
|
||||
testData.forEach(function(data) {
|
||||
data[0].forEach(function(e) {
|
||||
d.appendChild(document.createElement(e));
|
||||
}
|
||||
})
|
||||
|
||||
/* Modify children. */
|
||||
if (data[1]) {
|
||||
data[1](d);
|
||||
}
|
||||
|
||||
is(d.options, cachedOptions, "Should get the same object")
|
||||
is(d.options.length, data[2],
|
||||
"The number of recognized options should be " + data[2])
|
||||
|
||||
for (var i = 0; i < d.options.length; ++i) {
|
||||
is(d.options[i].localName, "option",
|
||||
"Should get an option for d.options[" + i + "]")
|
||||
}
|
||||
|
||||
/* Cleaning-up. */
|
||||
for (; d.firstChild; d.removeChild(d.firstChild));
|
||||
}
|
||||
d.textContent = "";
|
||||
})
|
||||
}
|
||||
|
||||
checkClassesAndAttributes();
|
|
@ -61,9 +61,9 @@ function checkTooLongValidity(element)
|
|||
todo(!element.validity.valid,
|
||||
"Element should not be valid when it is too long");
|
||||
|
||||
todo(element.validationMessage,
|
||||
"Please shorten this text to 2 characters or less (you are currently using 3 characters).",
|
||||
"The validation message text is not correct");
|
||||
todo_is(element.validationMessage,
|
||||
"Please shorten this text to 2 characters or less (you are currently using 3 characters).",
|
||||
"The validation message text is not correct");
|
||||
todo(!element.checkValidity(), "The element should not be valid");
|
||||
element.setCustomValidity("custom message");
|
||||
is(window.getComputedStyle(element, null).getPropertyValue('background-color'),
|
|
@ -1,60 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=595457
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 595457</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=595457">Mozilla Bug 595457</a>
|
||||
<p id="display"></p>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 595457 **/
|
||||
|
||||
function checkDatalistOptions(aDatalist, aOptions)
|
||||
{
|
||||
var datalistOptions = datalist.options;
|
||||
var length = datalistOptions.length;
|
||||
|
||||
is(length, options.length, "datalist should have " + options.length + " options");
|
||||
|
||||
for (var i=0; i<length; ++i) {
|
||||
is(datalistOptions[i], options[i], options[i] +
|
||||
"should be in the datalist options");
|
||||
}
|
||||
}
|
||||
|
||||
var datalist = document.createElement("datalist");
|
||||
var select = document.createElement("select");
|
||||
var options = [ new Option("foo"), new Option("bar") ];
|
||||
|
||||
datalist.appendChild(select);
|
||||
|
||||
for each(option in options) {
|
||||
select.appendChild(option);
|
||||
}
|
||||
|
||||
checkDatalistOptions(datalist, options);
|
||||
|
||||
var label = document.createElement("label");
|
||||
datalist.appendChild(label);
|
||||
|
||||
options[2] = new Option("foobar");
|
||||
label.appendChild(options[2]);
|
||||
|
||||
checkDatalistOptions(datalist, options);
|
||||
|
||||
options[3] = new Option();
|
||||
datalist.appendChild(options[3]);
|
||||
|
||||
checkDatalistOptions(datalist, options);
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -46,6 +46,7 @@
|
|||
#include "gfxPlatform.h"
|
||||
#include "ReadbackLayer.h"
|
||||
#include "gfxUtils.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
using namespace mozilla::layers;
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
|
||||
#include "ReadbackLayer.h"
|
||||
#include "ThebesLayerBuffer.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
|
|
@ -84,6 +84,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsIConsoleService.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsStringGlue.h"
|
||||
|
||||
using mozilla::CheckedInt;
|
||||
|
||||
|
|
|
@ -38,10 +38,6 @@
|
|||
#ifndef GFX_COLOR_H
|
||||
#define GFX_COLOR_H
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
#include "nsPrintfCString.h"
|
||||
#endif
|
||||
|
||||
#include "gfxTypes.h"
|
||||
|
||||
#include "prbit.h" // for PR_ROTATE_(LEFT,RIGHT)32
|
||||
|
@ -173,7 +169,6 @@ struct THEBES_API gfxRGBA {
|
|||
PACKED_ARGB,
|
||||
PACKED_ARGB_PREMULTIPLIED,
|
||||
|
||||
PACKED_XBGR,
|
||||
PACKED_XRGB
|
||||
};
|
||||
|
||||
|
@ -193,7 +188,6 @@ struct THEBES_API gfxRGBA {
|
|||
*/
|
||||
gfxRGBA(PRUint32 c, PackedColorType colorType = PACKED_ABGR) {
|
||||
if (colorType == PACKED_ABGR ||
|
||||
colorType == PACKED_XBGR ||
|
||||
colorType == PACKED_ABGR_PREMULTIPLIED)
|
||||
{
|
||||
r = ((c >> 0) & 0xff) * (1.0 / 255.0);
|
||||
|
@ -218,26 +212,11 @@ struct THEBES_API gfxRGBA {
|
|||
g /= a;
|
||||
b /= a;
|
||||
}
|
||||
} else if (colorType == PACKED_XBGR ||
|
||||
colorType == PACKED_XRGB)
|
||||
{
|
||||
} else if (colorType == PACKED_XRGB) {
|
||||
a = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize this color by parsing the given string.
|
||||
* XXX implement me!
|
||||
*/
|
||||
#if 0
|
||||
gfxRGBA(const char* str) {
|
||||
a = 1.0;
|
||||
// if aString[0] is a #, parse it as hex
|
||||
// if aString[0] is a letter, parse it as a color name
|
||||
// if aString[0] is a number, parse it loosely as hex
|
||||
}
|
||||
#endif
|
||||
|
||||
bool operator==(const gfxRGBA& other) const
|
||||
{
|
||||
return r == other.r && g == other.g && b == other.b && a == other.a;
|
||||
|
@ -261,28 +240,30 @@ struct THEBES_API gfxRGBA {
|
|||
gfxFloat bb = (b * 255.0);
|
||||
gfxFloat ab = (a * 255.0);
|
||||
|
||||
if (colorType == PACKED_ABGR || colorType == PACKED_XBGR) {
|
||||
if (colorType == PACKED_ABGR) {
|
||||
return (PRUint8(ab) << 24) |
|
||||
(PRUint8(bb) << 16) |
|
||||
(PRUint8(gb) << 8) |
|
||||
(PRUint8(rb) << 0);
|
||||
} else if (colorType == PACKED_ARGB || colorType == PACKED_XRGB) {
|
||||
}
|
||||
if (colorType == PACKED_ARGB || colorType == PACKED_XRGB) {
|
||||
return (PRUint8(ab) << 24) |
|
||||
(PRUint8(rb) << 16) |
|
||||
(PRUint8(gb) << 8) |
|
||||
(PRUint8(bb) << 0);
|
||||
}
|
||||
|
||||
rb = (r*a) * 255.0;
|
||||
gb = (g*a) * 255.0;
|
||||
bb = (b*a) * 255.0;
|
||||
rb *= a;
|
||||
gb *= a;
|
||||
bb *= a;
|
||||
|
||||
if (colorType == PACKED_ABGR_PREMULTIPLIED) {
|
||||
return (((PRUint8)(ab) << 24) |
|
||||
((PRUint8)(bb) << 16) |
|
||||
((PRUint8)(gb) << 8) |
|
||||
((PRUint8)(rb) << 0));
|
||||
} else if (colorType == PACKED_ARGB_PREMULTIPLIED) {
|
||||
}
|
||||
if (colorType == PACKED_ARGB_PREMULTIPLIED) {
|
||||
return (((PRUint8)(ab) << 24) |
|
||||
((PRUint8)(rb) << 16) |
|
||||
((PRUint8)(gb) << 8) |
|
||||
|
@ -291,20 +272,6 @@ struct THEBES_API gfxRGBA {
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
/**
|
||||
* Convert this color to a hex value. For example, for rgb(255,0,0),
|
||||
* this will return FF0000.
|
||||
*/
|
||||
// XXX I'd really prefer to just have this return an nsACString
|
||||
// Does this function even make sense, since we're just ignoring the alpha value?
|
||||
void Hex(nsACString& result) const {
|
||||
nsPrintfCString hex(8, "%02x%02x%02x", PRUint8(r*255.0), PRUint8(g*255.0), PRUint8(b*255.0));
|
||||
result.Assign(hex);
|
||||
}
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#endif /* _GFX_COLOR_H */
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include "prtypes.h"
|
||||
#include "prlog.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsIObserver.h"
|
||||
|
||||
#include "gfxTypes.h"
|
||||
|
@ -50,6 +50,10 @@
|
|||
#include "gfxColor.h"
|
||||
|
||||
#include "qcms.h"
|
||||
|
||||
#include "gfx2DGlue.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
|
||||
#ifdef XP_OS2
|
||||
#undef OS2EMX_PLAIN_CHAR
|
||||
#endif
|
||||
|
@ -66,9 +70,6 @@ class gfxTextRun;
|
|||
class nsIURI;
|
||||
class nsIAtom;
|
||||
|
||||
#include "gfx2DGlue.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
|
||||
extern cairo_user_data_key_t kDrawTarget;
|
||||
|
||||
// pref lang id's for font prefs
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#if !defined(XPCONNECT_STANDALONE)
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsScriptLoader.h"
|
||||
|
||||
|
@ -191,5 +189,3 @@ WriteCachedScript(StartupCache* cache, nsACString &uri, JSContext *cx, JSObject
|
|||
rv = cache->PutBuffer(PromiseFlatCString(uri).get(), buf, len);
|
||||
return rv;
|
||||
}
|
||||
|
||||
#endif /* XPCONNECT_STANDALONE */
|
||||
|
|
|
@ -106,6 +106,7 @@
|
|||
#include "nsAutoPtr.h"
|
||||
|
||||
#include "nsBidiUtils.h"
|
||||
#include "nsPrintfCString.h"
|
||||
|
||||
#include "gfxFont.h"
|
||||
#include "gfxContext.h"
|
||||
|
|
|
@ -76,6 +76,7 @@
|
|||
#include "nsIConsoleService.h"
|
||||
|
||||
#include "nsStyleSet.h"
|
||||
#include "nsPrintfCString.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "prenv.h"
|
||||
#include "nsPrintfCString.h"
|
||||
|
||||
#if defined(DEBUG) || defined(ENABLE_TESTS)
|
||||
# define NECKO_ERRORS_ARE_FATAL_DEFAULT true
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
%define WINSTRIPE_AERO
|
||||
%include selectAddons.css
|
||||
%undef WINSTRIPE_AERO
|
|
@ -188,12 +188,21 @@
|
|||
|
||||
#footer {
|
||||
padding: 15px 12px;
|
||||
background-color: #f1f5fb;
|
||||
box-shadow: 0px 1px 2px rgb(204,214,234) inset;
|
||||
}
|
||||
|
||||
.progress-label,
|
||||
#footer-label {
|
||||
%ifdef WINSTRIPE_AERO
|
||||
font-style: italic;
|
||||
%endif
|
||||
color: GrayText;
|
||||
}
|
||||
|
||||
%ifdef WINSTRIPE_AERO
|
||||
@media all and (-moz-windows-default-theme) {
|
||||
#footer {
|
||||
background-color: #f1f5fb;
|
||||
box-shadow: 0px 1px 2px rgb(204,214,234) inset;
|
||||
}
|
||||
}
|
||||
%endif
|
||||
|
|
|
@ -86,7 +86,7 @@ toolkit.jar:
|
|||
skin/classic/aero/mozapps/extensions/about.css (extensions/about.css)
|
||||
skin/classic/aero/mozapps/extensions/blocklist.css (extensions/blocklist.css)
|
||||
* skin/classic/aero/mozapps/extensions/extensions.css (extensions/extensions-aero.css)
|
||||
* skin/classic/aero/mozapps/extensions/selectAddons.css (extensions/selectAddons.css)
|
||||
* skin/classic/aero/mozapps/extensions/selectAddons.css (extensions/selectAddons-aero.css)
|
||||
skin/classic/aero/mozapps/extensions/update.css (extensions/update.css)
|
||||
skin/classic/aero/mozapps/extensions/extensions.svg (extensions/extensions.svg)
|
||||
skin/classic/aero/mozapps/extensions/themeGeneric.png (extensions/themeGeneric-aero.png)
|
||||
|
|
|
@ -539,7 +539,7 @@ AndroidBridge::SetClipboardText(const nsAString& aText)
|
|||
AutoLocalJNIFrame jniFrame;
|
||||
jstring jstr = mJNIEnv->NewString(nsPromiseFlatString(aText).get(),
|
||||
aText.Length());
|
||||
mJNIEnv->CallStaticObjectMethod(mGeckoAppShellClass, jSetClipboardText, jstr);
|
||||
mJNIEnv->CallStaticVoidMethod(mGeckoAppShellClass, jSetClipboardText, jstr);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -560,7 +560,7 @@ void
|
|||
AndroidBridge::EmptyClipboard()
|
||||
{
|
||||
ALOG_BRIDGE("AndroidBridge::EmptyClipboard");
|
||||
mJNIEnv->CallStaticObjectMethod(mGeckoAppShellClass, jSetClipboardText, nsnull);
|
||||
mJNIEnv->CallStaticVoidMethod(mGeckoAppShellClass, jSetClipboardText, nsnull);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#include "nsBidiUtils.h"
|
||||
#include "nsToolkit.h"
|
||||
#include "nsCocoaUtils.h"
|
||||
#include "nsPrintfCString.h"
|
||||
|
||||
#ifdef __LP64__
|
||||
#include "ComplexTextInputPanel.h"
|
||||
|
|
|
@ -973,11 +973,9 @@ nsresult GlobalPrinters::InitializeGlobalPrinters ()
|
|||
}
|
||||
|
||||
mGlobalPrinterList = new nsTArray<nsString>();
|
||||
if (!mGlobalPrinterList)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
nsPSPrinterList psMgr;
|
||||
if (NS_SUCCEEDED(psMgr.Init()) && psMgr.Enabled()) {
|
||||
if (psMgr.Enabled()) {
|
||||
/* Get the list of PostScript-module printers */
|
||||
// XXX: this function is the only user of GetPrinterList
|
||||
// So it may be interesting to convert the nsCStrings
|
||||
|
|
|
@ -58,17 +58,13 @@ using namespace mozilla;
|
|||
|
||||
nsCUPSShim gCupsShim;
|
||||
|
||||
/* Initialize the printer manager object */
|
||||
nsresult
|
||||
nsPSPrinterList::Init()
|
||||
nsPSPrinterList::nsPSPrinterList()
|
||||
{
|
||||
// Should we try cups?
|
||||
PRBool useCups =
|
||||
Preferences::GetBool("print.postscript.cups.enabled", PR_TRUE);
|
||||
if (useCups && !gCupsShim.IsInitialized()) {
|
||||
if (Preferences::GetBool("print.postscript.cups.enabled", PR_TRUE) &&
|
||||
!gCupsShim.IsInitialized()) {
|
||||
gCupsShim.Init();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -47,12 +47,7 @@ class nsCUPSShim;
|
|||
|
||||
class nsPSPrinterList {
|
||||
public:
|
||||
/**
|
||||
* Initialize a printer manager object.
|
||||
* @return NS_ERROR_NOT_INITIALIZED if unable to access prefs
|
||||
* NS_OK for successful initialization.
|
||||
*/
|
||||
nsresult Init();
|
||||
nsPSPrinterList();
|
||||
|
||||
/**
|
||||
* Is the PostScript module enabled or disabled?
|
||||
|
|
|
@ -156,6 +156,7 @@
|
|||
#include "nsWindowGfx.h"
|
||||
#include "gfxWindowsPlatform.h"
|
||||
#include "Layers.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
#ifdef MOZ_ENABLE_D3D9_LAYER
|
||||
|
|
Загрузка…
Ссылка в новой задаче