mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merging mozilla-inbound into mozilla-central.
This commit is contained in:
commit
775fa90a3b
@ -976,10 +976,12 @@ refRelationSetCB(AtkObject *aAtkObj)
|
||||
while ((tempAcc = rel.Next()))
|
||||
targets.AppendElement(nsAccessibleWrap::GetAtkObject(tempAcc));
|
||||
|
||||
if (targets.Length()) {
|
||||
atkRelation = atk_relation_new(targets.Elements(), targets.Length(), atkType);
|
||||
atk_relation_set_add(relation_set, atkRelation);
|
||||
g_object_unref(atkRelation);
|
||||
}
|
||||
}
|
||||
|
||||
return relation_set;
|
||||
}
|
||||
|
@ -156,10 +156,9 @@ Sanitizer.prototype = {
|
||||
}
|
||||
|
||||
// Clear plugin data.
|
||||
let ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
|
||||
const phInterface = Ci.nsIPluginHost;
|
||||
const FLAG_CLEAR_ALL = phInterface.FLAG_CLEAR_ALL;
|
||||
ph.QueryInterface(phInterface);
|
||||
let ph = Cc["@mozilla.org/plugin/host;1"].getService(phInterface);
|
||||
|
||||
// Determine age range in seconds. (-1 means clear all.) We don't know
|
||||
// that this.range[1] is actually now, so we compute age range based
|
||||
|
@ -619,11 +619,9 @@ PrivateBrowsingService.prototype = {
|
||||
}
|
||||
|
||||
// Plugin data
|
||||
let (ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost)) {
|
||||
const phInterface = Ci.nsIPluginHost;
|
||||
const FLAG_CLEAR_ALL = phInterface.FLAG_CLEAR_ALL;
|
||||
ph.QueryInterface(phInterface);
|
||||
|
||||
let (ph = Cc["@mozilla.org/plugin/host;1"].getService(phInterface)) {
|
||||
let tags = ph.getPluginTags();
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
try {
|
||||
|
@ -603,18 +603,37 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
|
||||
|
||||
#forward-button {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=toolbar");
|
||||
-moz-transition: 250ms ease-out;
|
||||
}
|
||||
#forward-button[disabled="true"] {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=toolbar&state=disabled");
|
||||
}
|
||||
|
||||
#forward-button:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar");
|
||||
}
|
||||
#forward-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
|
||||
toolbar:not([mode=icons]) #forward-button[disabled="true"] {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=toolbar&state=disabled");
|
||||
}
|
||||
toolbar:not([mode=icons]) #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar&state=disabled");
|
||||
}
|
||||
|
||||
toolbar[mode=icons] #forward-button[disabled="true"] {
|
||||
-moz-transform: scale(0);
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
toolbar[mode=icons] #forward-button[disabled="true"]:-moz-locale-dir(ltr) {
|
||||
margin-left: -36px;
|
||||
}
|
||||
toolbar[mode=icons] #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
margin-right: -36px;
|
||||
}
|
||||
toolbar[mode=icons][iconsize=small] #forward-button[disabled="true"]:-moz-locale-dir(ltr) {
|
||||
margin-left: -28px;
|
||||
}
|
||||
toolbar[mode=icons][iconsize=small] #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
margin-right: -28px;
|
||||
}
|
||||
|
||||
#reload-button {
|
||||
list-style-image: url("moz-icon://stock/gtk-refresh?size=toolbar");
|
||||
}
|
||||
@ -786,7 +805,7 @@ toolbar[iconsize="small"] #forward-button {
|
||||
.unified-nav-forward[_moz-menuactive] {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu") !important;
|
||||
}
|
||||
toolbar[iconsize="small"] #forward-button[disabled="true"] {
|
||||
toolbar[iconsize="small"]:not([mode=icons]) #forward-button[disabled="true"] {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
@ -796,7 +815,7 @@ toolbar[iconsize="small"] #forward-button:-moz-locale-dir(rtl) {
|
||||
.unified-nav-forward[_moz-menuactive]:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu") !important;
|
||||
}
|
||||
toolbar[iconsize="small"] #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
toolbar[iconsize="small"]:not([mode=icons]) #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,6 @@ USE_AUTOCONF = 1
|
||||
MOZILLA_CLIENT = 1
|
||||
target = @target@
|
||||
ac_configure_args = @ac_configure_args@
|
||||
BUILD_MODULES = @BUILD_MODULES@
|
||||
MOZILLA_VERSION = @MOZILLA_VERSION@
|
||||
FIREFOX_VERSION = @FIREFOX_VERSION@
|
||||
|
||||
|
@ -1153,8 +1153,9 @@ ifdef HAVE_DTRACE
|
||||
ifndef XP_MACOSX
|
||||
ifdef DTRACE_PROBE_OBJ
|
||||
ifndef DTRACE_LIB_DEPENDENT
|
||||
$(DTRACE_PROBE_OBJ):
|
||||
dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ)
|
||||
NON_DTRACE_OBJS := $(filter-out $(DTRACE_PROBE_OBJ),$(OBJS))
|
||||
$(DTRACE_PROBE_OBJ): $(NON_DTRACE_OBJS)
|
||||
dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(NON_DTRACE_OBJS)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@ -1550,9 +1551,6 @@ export:: FORCE
|
||||
@echo; sleep 2; false
|
||||
endif
|
||||
|
||||
$(IDL_DIR)::
|
||||
$(NSINSTALL) -D $@
|
||||
|
||||
# generate .h files from into $(XPIDL_GEN_DIR), then export to $(DIST)/include;
|
||||
# warn against overriding existing .h file.
|
||||
$(XPIDL_GEN_DIR)/.done:
|
||||
@ -1623,14 +1621,8 @@ endif # XPIDLSRCS
|
||||
|
||||
|
||||
|
||||
#
|
||||
# General rules for exporting idl files.
|
||||
#
|
||||
# WORK-AROUND ONLY, for mozilla/tools/module-deps/bootstrap.pl build.
|
||||
# Bug to fix idl dependency problems w/o this extra build pass is
|
||||
# http://bugzilla.mozilla.org/show_bug.cgi?id=145777
|
||||
#
|
||||
$(IDL_DIR)::
|
||||
$(IDL_DIR):
|
||||
$(NSINSTALL) -D $@
|
||||
|
||||
export-idl:: $(SUBMAKEFILES) $(MAKE_DIRS)
|
||||
@ -2097,7 +2089,6 @@ showhost:
|
||||
@echo "HOST_LIBRARY = $(HOST_LIBRARY)"
|
||||
|
||||
showbuildmods::
|
||||
@echo "Build Modules = $(BUILD_MODULES)"
|
||||
@echo "Module dirs = $(BUILD_MODULE_DIRS)"
|
||||
|
||||
documentation:
|
||||
|
@ -32,7 +32,6 @@ function seekStarted(evt) {
|
||||
function seekEnded(evt) {
|
||||
var v = evt.target;
|
||||
v._gotSeekEnded = true;
|
||||
v.play();
|
||||
}
|
||||
|
||||
function loadedData(evt) {
|
||||
|
@ -146,8 +146,14 @@ nsSMILCSSProperty::GetBaseValue() const
|
||||
|
||||
// (4) Populate our nsSMILValue from the computed style
|
||||
if (didGetComputedVal) {
|
||||
// When we parse animation values we check if they are context-sensitive or
|
||||
// not so that we don't cache animation values whose meaning may change.
|
||||
// For base values however this is unnecessary since on each sample the
|
||||
// compositor will fetch the (computed) base value and compare it against
|
||||
// the cached (computed) value and detect changes for us.
|
||||
nsSMILCSSValueType::ValueFromString(mPropID, mElement,
|
||||
computedStyleVal, baseValue);
|
||||
computedStyleVal, baseValue,
|
||||
nsnull);
|
||||
}
|
||||
return baseValue;
|
||||
}
|
||||
@ -160,22 +166,17 @@ nsSMILCSSProperty::ValueFromString(const nsAString& aStr,
|
||||
{
|
||||
NS_ENSURE_TRUE(IsPropertyAnimatable(mPropID), NS_ERROR_FAILURE);
|
||||
|
||||
nsSMILCSSValueType::ValueFromString(mPropID, mElement, aStr, aValue);
|
||||
if (aValue.IsNull()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
nsSMILCSSValueType::ValueFromString(mPropID, mElement, aStr, aValue,
|
||||
&aPreventCachingOfSandwich);
|
||||
|
||||
// XXX Due to bug 536660 (or at least that seems to be the most likely
|
||||
// culprit), when we have animation setting display:none on a <use> element,
|
||||
// if we DON'T set the property every sample, chaos ensues.
|
||||
if (!aPreventCachingOfSandwich && mPropID == eCSSProperty_display) {
|
||||
aPreventCachingOfSandwich = PR_TRUE;
|
||||
}
|
||||
|
||||
// XXXdholbert: For simplicity, just assume that all CSS values have to
|
||||
// reparsed every sample. This prevents us from doing the "nothing's changed
|
||||
// so don't recompose" optimization (bug 533291) for CSS properties & mapped
|
||||
// attributes. If it ends up being expensive to always recompose those, we
|
||||
// can be a little smarter here. We really only need to set
|
||||
// aPreventCachingOfSandwich to true for "inherit" & "currentColor" (whose
|
||||
// values could change at any time), for length-valued types (particularly
|
||||
// those with em/ex/percent units, since their conversion ratios can change
|
||||
// at any time), and for any value for 'font-family'.
|
||||
aPreventCachingOfSandwich = PR_TRUE;
|
||||
return NS_OK;
|
||||
return aValue.IsNull() ? NS_ERROR_FAILURE : NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -371,7 +371,8 @@ ValueFromStringHelper(nsCSSProperty aPropID,
|
||||
Element* aTargetElement,
|
||||
nsPresContext* aPresContext,
|
||||
const nsAString& aString,
|
||||
nsStyleAnimation::Value& aStyleAnimValue)
|
||||
nsStyleAnimation::Value& aStyleAnimValue,
|
||||
PRBool* aIsContextSensitive)
|
||||
{
|
||||
// If value is negative, we'll strip off the "-" so the CSS parser won't
|
||||
// barf, and then manually make the parsed value negative.
|
||||
@ -386,7 +387,8 @@ ValueFromStringHelper(nsCSSProperty aPropID,
|
||||
}
|
||||
nsDependentSubstring subString(aString, subStringBegin);
|
||||
if (!nsStyleAnimation::ComputeValue(aPropID, aTargetElement, subString,
|
||||
PR_TRUE, aStyleAnimValue)) {
|
||||
PR_TRUE, aStyleAnimValue,
|
||||
aIsContextSensitive)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
if (isNegative) {
|
||||
@ -409,7 +411,8 @@ void
|
||||
nsSMILCSSValueType::ValueFromString(nsCSSProperty aPropID,
|
||||
Element* aTargetElement,
|
||||
const nsAString& aString,
|
||||
nsSMILValue& aValue)
|
||||
nsSMILValue& aValue,
|
||||
PRBool* aIsContextSensitive)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(aValue.IsNull(), "Outparam should be null-typed");
|
||||
nsPresContext* presContext = GetPresContextForElement(aTargetElement);
|
||||
@ -420,7 +423,7 @@ nsSMILCSSValueType::ValueFromString(nsCSSProperty aPropID,
|
||||
|
||||
nsStyleAnimation::Value parsedValue;
|
||||
if (ValueFromStringHelper(aPropID, aTargetElement, presContext,
|
||||
aString, parsedValue)) {
|
||||
aString, parsedValue, aIsContextSensitive)) {
|
||||
sSingleton.Init(aValue);
|
||||
aValue.mU.mPtr = new ValueWrapper(aPropID, parsedValue, presContext);
|
||||
}
|
||||
|
@ -100,13 +100,20 @@ public:
|
||||
* @param aString The string to be parsed as a CSS value.
|
||||
* @param [out] aValue The nsSMILValue to be populated. Should
|
||||
* initially be null-typed.
|
||||
* @param [out] aIsContextSensitive Set to PR_TRUE if |aString| may produce
|
||||
* a different |aValue| depending on other
|
||||
* CSS properties on |aTargetElement|
|
||||
* or its ancestors (e.g. 'inherit).
|
||||
* PR_FALSE otherwise. May be nsnull.
|
||||
* Not set if the method fails.
|
||||
* @pre aValue.IsNull()
|
||||
* @post aValue.IsNull() || aValue.mType == nsSMILCSSValueType::sSingleton
|
||||
*/
|
||||
static void ValueFromString(nsCSSProperty aPropID,
|
||||
Element* aTargetElement,
|
||||
const nsAString& aString,
|
||||
nsSMILValue& aValue);
|
||||
nsSMILValue& aValue,
|
||||
PRBool* aIsContextSensitive);
|
||||
|
||||
/**
|
||||
* Creates a string representation of the given nsSMILValue.
|
||||
|
@ -67,15 +67,9 @@ nsSMILMappedAttribute::ValueFromString(const nsAString& aStr,
|
||||
{
|
||||
NS_ENSURE_TRUE(IsPropertyAnimatable(mPropID), NS_ERROR_FAILURE);
|
||||
|
||||
nsSMILCSSValueType::ValueFromString(mPropID, mElement, aStr, aValue);
|
||||
if (aValue.IsNull()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// XXXdholbert: For simplicity, just assume that all CSS values have to
|
||||
// reparsed every sample. See note in nsSMILCSSProperty::ValueFromString.
|
||||
aPreventCachingOfSandwich = PR_TRUE;
|
||||
return NS_OK;
|
||||
nsSMILCSSValueType::ValueFromString(mPropID, mElement, aStr, aValue,
|
||||
&aPreventCachingOfSandwich);
|
||||
return aValue.IsNull() ? NS_ERROR_FAILURE : NS_OK;
|
||||
}
|
||||
|
||||
nsSMILValue
|
||||
@ -87,8 +81,12 @@ nsSMILMappedAttribute::GetBaseValue() const
|
||||
baseStringValue);
|
||||
nsSMILValue baseValue;
|
||||
if (success) {
|
||||
// For base values, we don't need to worry whether the value returned is
|
||||
// context-sensitive or not since the compositor will take care of comparing
|
||||
// the returned (computed) base value and its cached value and determining
|
||||
// if an update is required or not.
|
||||
nsSMILCSSValueType::ValueFromString(mPropID, mElement,
|
||||
baseStringValue, baseValue);
|
||||
baseStringValue, baseValue, nsnull);
|
||||
} else {
|
||||
// Attribute is unset -- use computed value.
|
||||
// FIRST: Temporarily clear animated value, to make sure it doesn't pollute
|
||||
|
@ -8,7 +8,10 @@
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=533291">Mozilla Bug 533291</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<!-- Bug 628848: The following should be display: none but we currently don't
|
||||
handle percentage lengths properly when the whole fragment is display: none
|
||||
-->
|
||||
<div id="content" style="visibility: hidden">
|
||||
<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="120px" height="120px"
|
||||
onload="this.pauseAnimations()">
|
||||
<g id="circleParent">
|
||||
@ -19,58 +22,110 @@
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
<![CDATA[
|
||||
/** Test for SMIL fill modes **/
|
||||
/** Test for SMIL values that are context-sensitive **/
|
||||
|
||||
/* See bugs 533291 and 562815.
|
||||
|
||||
The format of each test is basically:
|
||||
1) create some animated and frozen state
|
||||
2) test the animated values
|
||||
3) change the context
|
||||
4) test that context-sensitive animation values have changed
|
||||
|
||||
Ideally, after changing the context (3), the animated state would instantly
|
||||
update. However, this is not currently the case for many situations.
|
||||
|
||||
For CSS properties we have bug 545282 - In animations involving 'inherit'
|
||||
/ 'currentColor', changes to inherited value / 'color' don't show up in
|
||||
animated value immediately
|
||||
|
||||
For SVG lengths we have bug 508206 - Relative units used in
|
||||
animation don't update immediately
|
||||
|
||||
(There are a few of todo_is's in the following tests so that if those bugs
|
||||
are ever resolved we'll know to update this test case accordingly.)
|
||||
|
||||
So in between (3) and (4) we force a sample. This is currently done by
|
||||
calling SVGSVGElement.setCurrentTime with the same current time which has the
|
||||
side effect of forcing a sample.
|
||||
|
||||
What we *are* testing is that we're not too zealous with caching animation
|
||||
values whilst in the frozen state. Normally we'd say, "Hey, we're frozen,
|
||||
let's just use the same animation result as last time" but for some
|
||||
context-sensitive animation values that doesn't work.
|
||||
*/
|
||||
|
||||
/* Global Variables */
|
||||
const SVGNS = "http://www.w3.org/2000/svg";
|
||||
|
||||
// Animation parameters -- not used for <set> animation
|
||||
const ANIM_DUR = "4s";
|
||||
const TIME_ANIM_END = "4";
|
||||
const TIME_AFTER_ANIM_END = "5";
|
||||
|
||||
// SETTIMEOUT_INTERVAL: This value just needs to be at least as large as
|
||||
// nsSMILAnimationController::kTimerInterval, so we can queue up a callback
|
||||
// for this far in the future and be assured that an animation sample will
|
||||
// have happened before the callback fires (because we presumably already
|
||||
// have an animation sample in the setTimeout queue, with a lower timeout
|
||||
// value than this).
|
||||
// NOTE: We only need to use timeouts here because of Bug 545282.
|
||||
const SETTIMEOUT_INTERVAL = 60;
|
||||
|
||||
const gTestArray =
|
||||
[ testBaseValueChange,
|
||||
testCurrentColorChange,
|
||||
testCurrentColorChangeUsingStyle,
|
||||
testInheritChange,
|
||||
testInheritChangeUsingStyle
|
||||
];
|
||||
|
||||
// Index of current test in gTestArray
|
||||
var gNextTestIndex = 0;
|
||||
|
||||
const gSvg = document.getElementById("svg");
|
||||
const gCircle = document.getElementById("circle");
|
||||
const gCircleParent = document.getElementById("circleParent");
|
||||
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
// MAIN FUNCTION
|
||||
// -------------
|
||||
|
||||
function main() {
|
||||
function main()
|
||||
{
|
||||
ok(gSvg.animationsPaused(), "should be paused by <svg> load handler");
|
||||
is(gSvg.getCurrentTime(), 0, "should be paused at 0 in <svg> load handler");
|
||||
|
||||
if (gNextTestIndex != 0) {
|
||||
ok(false, "expecting to start at first test in array.");
|
||||
const tests =
|
||||
[ testBaseValueChange,
|
||||
testCurrentColorChange,
|
||||
testCurrentColorChangeUsingStyle,
|
||||
testCurrentColorChangeOnFallback,
|
||||
testInheritChange,
|
||||
testInheritChangeUsingStyle,
|
||||
testEmUnitChangeOnProp,
|
||||
testEmUnitChangeOnPropBase,
|
||||
testEmUnitChangeOnLength,
|
||||
testPercentUnitChangeOnProp,
|
||||
testPercentUnitChangeOnLength,
|
||||
testRelativeFontSize,
|
||||
testRelativeFontWeight,
|
||||
testRelativeFont,
|
||||
testCalcFontSize,
|
||||
testDashArray,
|
||||
testClip
|
||||
];
|
||||
|
||||
while (tests.length) {
|
||||
tests.shift()();
|
||||
}
|
||||
// Kick off first test. (It will kick off the one after it, and so on.)
|
||||
runNextTest();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
// HELPER FUNCTIONS
|
||||
// ----------------
|
||||
function createAnimFromTo(attrName, fromVal, toVal) {
|
||||
function createAnimSetTo(attrName, toVal)
|
||||
{
|
||||
var anim = document.createElementNS(SVGNS,"set");
|
||||
anim.setAttribute("attributeName", attrName);
|
||||
anim.setAttribute("to", toVal);
|
||||
return gCircle.appendChild(anim);
|
||||
}
|
||||
|
||||
function createAnimBy(attrName, byVal)
|
||||
{
|
||||
var anim = document.createElementNS(SVGNS,"animate");
|
||||
anim.setAttribute("attributeName", attrName);
|
||||
anim.setAttribute("dur", ANIM_DUR);
|
||||
anim.setAttribute("begin","0s");
|
||||
anim.setAttribute("by", byVal);
|
||||
anim.setAttribute("fill", "freeze");
|
||||
return gCircle.appendChild(anim);
|
||||
}
|
||||
|
||||
function createAnimFromTo(attrName, fromVal, toVal)
|
||||
{
|
||||
var anim = document.createElementNS(SVGNS,"animate");
|
||||
anim.setAttribute("attributeName", attrName);
|
||||
anim.setAttribute("dur", ANIM_DUR);
|
||||
@ -80,15 +135,6 @@ function createAnimFromTo(attrName, fromVal, toVal) {
|
||||
anim.setAttribute("fill", "freeze");
|
||||
return gCircle.appendChild(anim);
|
||||
}
|
||||
function createAnimBy(attrName, byVal) {
|
||||
var anim = document.createElementNS(SVGNS,"animate");
|
||||
anim.setAttribute("attributeName", attrName);
|
||||
anim.setAttribute("dur", ANIM_DUR);
|
||||
anim.setAttribute("begin","0s");
|
||||
anim.setAttribute("by", byVal);
|
||||
anim.setAttribute("fill", "freeze");
|
||||
return gCircle.appendChild(anim);
|
||||
}
|
||||
|
||||
// Common setup code for each test function: seek to 0, and make sure
|
||||
// the previous test cleaned up its animations.
|
||||
@ -99,17 +145,6 @@ function setupTest() {
|
||||
}
|
||||
}
|
||||
|
||||
function runNextTest() {
|
||||
if (gNextTestIndex == gTestArray.length) {
|
||||
// No tests left! we're done.
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
|
||||
// Call next test (and increment next-test index)
|
||||
gTestArray[gNextTestIndex++]();
|
||||
}
|
||||
|
||||
// THE TESTS
|
||||
// ---------
|
||||
|
||||
@ -130,106 +165,400 @@ function testBaseValueChange()
|
||||
"Checking animated cx after anim ends & after changing base val");
|
||||
|
||||
anim.parentNode.removeChild(anim); // clean up
|
||||
runNextTest();
|
||||
}
|
||||
|
||||
function testCurrentColorChange()
|
||||
{
|
||||
gCircle.setAttribute("color", "red"); // At first: currentColor=red
|
||||
var anim = createAnimFromTo("fill", "yellow", "currentColor");
|
||||
var anim = createAnimSetTo("fill", "currentColor");
|
||||
|
||||
gSvg.setCurrentTime(TIME_AFTER_ANIM_END);
|
||||
gSvg.setCurrentTime(0); // trigger synchronous sample
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "fill"), "rgb(255, 0, 0)",
|
||||
"Checking animated fill=currentColor after anim ends");
|
||||
"Checking animated fill=currentColor after animating");
|
||||
|
||||
gCircle.setAttribute("color", "lime"); // Change: currentColor=lime
|
||||
setTimeout(testCurrentColorChange_final, SETTIMEOUT_INTERVAL);
|
||||
}
|
||||
|
||||
function testCurrentColorChange_final()
|
||||
{
|
||||
// Bug 545282: We should really detect this change and update immediately but
|
||||
// currently we don't until we get sampled again
|
||||
todo_is(SMILUtil.getComputedStyleSimple(gCircle, "fill"), "rgb(0, 255, 0)",
|
||||
"Checking animated fill=currentColor after updating context but before " +
|
||||
"sampling");
|
||||
gSvg.setCurrentTime(0);
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "fill"), "rgb(0, 255, 0)",
|
||||
"Checking animated fill=currentColor after anim ends and 'color' changes");
|
||||
"Checking animated fill=currentColor after updating context");
|
||||
|
||||
// Clean up
|
||||
gCircle.removeAttribute("color");
|
||||
gCircle.firstChild.parentNode.removeChild(gCircle.firstChild);
|
||||
|
||||
// Kick off next test
|
||||
runNextTest();
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function testCurrentColorChangeUsingStyle()
|
||||
{
|
||||
setupTest();
|
||||
gCircle.setAttribute("style", "color: red"); // At first: currentColor=red
|
||||
var anim = createAnimFromTo("fill", "yellow", "currentColor");
|
||||
var anim = createAnimSetTo("fill", "currentColor");
|
||||
|
||||
gSvg.setCurrentTime(TIME_AFTER_ANIM_END);
|
||||
gSvg.setCurrentTime(0);
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "fill"), "rgb(255, 0, 0)",
|
||||
"Checking animated fill=currentColor after anim ends (using style attr)");
|
||||
"Checking animated fill=currentColor after animating (using style attr)");
|
||||
|
||||
gCircle.setAttribute("style", "color: lime"); // Change: currentColor=lime
|
||||
setTimeout(testCurrentColorChangeUsingStyle_final, SETTIMEOUT_INTERVAL);
|
||||
}
|
||||
|
||||
function testCurrentColorChangeUsingStyle_final()
|
||||
{
|
||||
gSvg.setCurrentTime(0);
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "fill"), "rgb(0, 255, 0)",
|
||||
"Checking animated fill=currentColor after anim ends and 'color' changes "
|
||||
"Checking animated fill=currentColor after updating context "
|
||||
+ "(using style attr)");
|
||||
|
||||
// Clean up
|
||||
gCircle.removeAttribute("style");
|
||||
gCircle.firstChild.parentNode.removeChild(gCircle.firstChild);
|
||||
runNextTest();
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function getFallbackColor(pServerStr)
|
||||
{
|
||||
return pServerStr.substr(pServerStr.indexOf(" ")+1);
|
||||
}
|
||||
|
||||
function testCurrentColorChangeOnFallback()
|
||||
{
|
||||
setupTest();
|
||||
gCircle.setAttribute("color", "red"); // At first: currentColor=red
|
||||
var anim = createAnimSetTo("fill", "url(#missingGrad) currentColor");
|
||||
|
||||
gSvg.setCurrentTime(0);
|
||||
var fallback =
|
||||
getFallbackColor(SMILUtil.getComputedStyleSimple(gCircle, "fill"));
|
||||
is(fallback, "rgb(255, 0, 0)",
|
||||
"Checking animated fallback fill=currentColor after animating");
|
||||
|
||||
gCircle.setAttribute("color", "lime"); // Change: currentColor=lime
|
||||
gSvg.setCurrentTime(0);
|
||||
fallback = getFallbackColor(SMILUtil.getComputedStyleSimple(gCircle, "fill"));
|
||||
is(fallback, "rgb(0, 255, 0)",
|
||||
"Checking animated fallback fill=currentColor after updating context");
|
||||
|
||||
gCircle.removeAttribute("style");
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function testInheritChange()
|
||||
{
|
||||
setupTest();
|
||||
gCircleParent.setAttribute("fill", "red"); // At first: inherit=red
|
||||
var anim = createAnimFromTo("fill", "yellow", "inherit");
|
||||
var anim = createAnimSetTo("fill", "inherit");
|
||||
|
||||
gSvg.setCurrentTime(TIME_AFTER_ANIM_END);
|
||||
gSvg.setCurrentTime(0);
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "fill"), "rgb(255, 0, 0)",
|
||||
"Checking animated fill=inherit after anim ends");
|
||||
"Checking animated fill=inherit after animating");
|
||||
|
||||
gCircleParent.setAttribute("fill", "lime"); // Change: inherit=lime
|
||||
setTimeout(testInheritChange_final, SETTIMEOUT_INTERVAL);
|
||||
}
|
||||
|
||||
function testInheritChange_final() {
|
||||
gSvg.setCurrentTime(0);
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "fill"), "rgb(0, 255, 0)",
|
||||
"Checking animated fill=inherit after anim ends and parent val changes");
|
||||
"Checking animated fill=inherit after updating context");
|
||||
|
||||
gCircleParent.removeAttribute("fill");
|
||||
gCircle.firstChild.parentNode.removeChild(gCircle.firstChild);
|
||||
runNextTest();
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function testInheritChangeUsingStyle()
|
||||
{
|
||||
setupTest();
|
||||
gCircleParent.setAttribute("style", "fill: red"); // At first: inherit=red
|
||||
var anim = createAnimFromTo("fill", "yellow", "inherit");
|
||||
var anim = createAnimSetTo("fill", "inherit");
|
||||
|
||||
gSvg.setCurrentTime(TIME_AFTER_ANIM_END);
|
||||
gSvg.setCurrentTime(0);
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "fill"), "rgb(255, 0, 0)",
|
||||
"Checking animated fill=inherit after anim ends (using style attr)");
|
||||
"Checking animated fill=inherit after animating (using style attr)");
|
||||
|
||||
gCircleParent.setAttribute("style", "fill: lime"); // Change: inherit=lime
|
||||
setTimeout(testInheritChangeUsingStyle_final, SETTIMEOUT_INTERVAL);
|
||||
}
|
||||
|
||||
function testInheritChangeUsingStyle_final() {
|
||||
gSvg.setCurrentTime(0);
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "fill"), "rgb(0, 255, 0)",
|
||||
"Checking animated fill=inherit after anim ends and parent val changes "
|
||||
"Checking animated fill=inherit after updating context "
|
||||
+ "(using style attr)");
|
||||
|
||||
gCircleParent.removeAttribute("style");
|
||||
gCircle.firstChild.parentNode.removeChild(gCircle.firstChild);
|
||||
runNextTest();
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function testEmUnitChangeOnProp()
|
||||
{
|
||||
setupTest();
|
||||
gCircleParent.setAttribute("font-size", "10px"); // At first: font-size: 10px
|
||||
var anim = createAnimSetTo("font-size", "2em");
|
||||
|
||||
gSvg.setCurrentTime(0);
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "font-size"), "20px",
|
||||
"Checking animated font-size=2em after animating ends");
|
||||
|
||||
gCircleParent.setAttribute("font-size", "20px"); // Change: font-size: 20px
|
||||
gSvg.setCurrentTime(0);
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "font-size"), "40px",
|
||||
"Checking animated font-size=2em after updating context");
|
||||
|
||||
gCircleParent.removeAttribute("font-size");
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function testEmUnitChangeOnPropBase()
|
||||
{
|
||||
// Test the case where the base value for our animation sandwich is
|
||||
// context-sensitive.
|
||||
// Currently, this is taken care of by the compositor which keeps a cached
|
||||
// base value and compares it with the current base value. This test then just
|
||||
// serves as a regression test in case the compositor's behaviour changes.
|
||||
setupTest();
|
||||
gSvg.setAttribute("font-size", "10px"); // At first: font-size: 10px
|
||||
gCircleParent.setAttribute("font-size", "1em"); // Base: 10px
|
||||
var anim = createAnimBy("font-size", "10px");
|
||||
|
||||
gSvg.setCurrentTime(TIME_AFTER_ANIM_END);
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "font-size"), "20px",
|
||||
"Checking animated font-size=20px after anim ends");
|
||||
|
||||
gSvg.setAttribute("font-size", "20px"); // Change: font-size: 20px
|
||||
gSvg.setCurrentTime(TIME_AFTER_ANIM_END);
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "font-size"), "30px",
|
||||
"Checking animated font-size=30px after updating context");
|
||||
|
||||
gCircleParent.removeAttribute("font-size");
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function testEmUnitChangeOnLength()
|
||||
{
|
||||
setupTest();
|
||||
gCircleParent.setAttribute("font-size", "10px"); // At first: font-size: 10px
|
||||
var anim = createAnimSetTo("cx", "2em");
|
||||
|
||||
gSvg.setCurrentTime(0);
|
||||
is(gCircle.cx.animVal.value, 20,
|
||||
"Checking animated length=2em after animating");
|
||||
|
||||
gCircleParent.setAttribute("font-size", "20px"); // Change: font-size: 20px
|
||||
// Bug 508206: We should really detect this change and update immediately but
|
||||
// currently we don't until we get sampled again
|
||||
todo_is(gCircle.cx.animVal.value, 40,
|
||||
"Checking animated length=2em after updating context but before sampling");
|
||||
|
||||
gSvg.setCurrentTime(0);
|
||||
is(gCircle.cx.animVal.value, 40,
|
||||
"Checking animated length=2em after updating context and after " +
|
||||
"resampling");
|
||||
|
||||
gCircleParent.removeAttribute("font-size");
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function testPercentUnitChangeOnProp()
|
||||
{
|
||||
setupTest();
|
||||
gCircleParent.setAttribute("font-size", "10px"); // At first: font-size: 10px
|
||||
var anim = createAnimSetTo("font-size", "150%");
|
||||
|
||||
gSvg.setCurrentTime(0);
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "font-size"), "15px",
|
||||
"Checking animated font-size=150% after animating");
|
||||
|
||||
gCircleParent.setAttribute("font-size", "20px"); // Change: font-size: 20px
|
||||
gSvg.setCurrentTime(0);
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "font-size"), "30px",
|
||||
"Checking animated font-size=150% after updating context");
|
||||
|
||||
gCircleParent.removeAttribute("font-size");
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function testPercentUnitChangeOnLength()
|
||||
{
|
||||
setupTest();
|
||||
var oldHeight = gSvg.getAttribute("height");
|
||||
gSvg.setAttribute("height", "100px"); // At first: viewport height: 100px
|
||||
var anim = createAnimSetTo("cy", "100%");
|
||||
|
||||
gSvg.setCurrentTime(0); // Force synchronous sample so animation takes effect
|
||||
// Due to bug 627594 (SVGLength.value for percent value lengths doesn't
|
||||
// reflect updated viewport until reflow) the following will fail.
|
||||
// Check that it does indeed fail so that when that bug is fixed this test
|
||||
// can be updated.
|
||||
todo_is(gCircle.cy.animVal.value, 100,
|
||||
"Checking animated length=100% after animating but before reflow");
|
||||
gSvg.forceRedraw();
|
||||
// Even after doing a reflow though we'll still fail due to bug 508206
|
||||
// (Relative units used in animation don't update immediately)
|
||||
todo_is(gCircle.cy.animVal.value, 100,
|
||||
"Checking animated length=100% after animating but before resampling");
|
||||
gSvg.setCurrentTime(0);
|
||||
// Now we should be up to date
|
||||
is(gCircle.cy.animVal.value, 100,
|
||||
"Checking animated length=100% after animating");
|
||||
|
||||
gSvg.setAttribute("height", "50px"); // Change: height: 50px
|
||||
gSvg.forceRedraw(); // Bug 627594
|
||||
gSvg.setCurrentTime(0); // Bug 508206
|
||||
is(gCircle.cy.animVal.value, 50,
|
||||
"Checking animated length=100% after updating context");
|
||||
|
||||
gSvg.setAttribute("height", oldHeight);
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function testRelativeFontSize()
|
||||
{
|
||||
setupTest();
|
||||
gCircleParent.setAttribute("font-size", "10px"); // At first: font-size: 10px
|
||||
var anim = createAnimSetTo("font-size", "larger");
|
||||
|
||||
gSvg.setCurrentTime(0);
|
||||
var fsize = parseInt(SMILUtil.getComputedStyleSimple(gCircle, "font-size"));
|
||||
// CSS 2 suggests a scaling factor of 1.2 so we should be looking at something
|
||||
// around about 12 or so
|
||||
ok(fsize > 10 && fsize < 20,
|
||||
"Checking animated font-size > 10px after animating");
|
||||
|
||||
gCircleParent.setAttribute("font-size", "20px"); // Change: font-size: 20px
|
||||
gSvg.setCurrentTime(0);
|
||||
fsize = parseInt(SMILUtil.getComputedStyleSimple(gCircle, "font-size"));
|
||||
ok(fsize > 20, "Checking animated font-size > 20px after updating context");
|
||||
|
||||
gCircleParent.removeAttribute("font-size");
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function testRelativeFontWeight()
|
||||
{
|
||||
setupTest();
|
||||
gCircleParent.setAttribute("font-weight", "100"); // At first: font-weight 100
|
||||
var anim = createAnimSetTo("font-weight", "bolder");
|
||||
// CSS 2: 'bolder': Specifies the next weight that is assigned to a font
|
||||
// that is darker than the inherited one. If there is no such weight, it
|
||||
// simply results in the next darker numerical value (and the font remains
|
||||
// unchanged), unless the inherited value was '900', in which case the
|
||||
// resulting weight is also '900'.
|
||||
|
||||
gSvg.setCurrentTime(0);
|
||||
var weight =
|
||||
parseInt(SMILUtil.getComputedStyleSimple(gCircle, "font-weight"));
|
||||
ok(weight > 100, "Checking animated font-weight > 100 after animating");
|
||||
|
||||
gCircleParent.setAttribute("font-weight", "800"); // Change: font-weight 800
|
||||
gSvg.setCurrentTime(0);
|
||||
weight = parseInt(SMILUtil.getComputedStyleSimple(gCircle, "font-weight"));
|
||||
is(weight, 900,
|
||||
"Checking animated font-weight = 900 after updating context");
|
||||
|
||||
gCircleParent.removeAttribute("font-weight");
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function testRelativeFont()
|
||||
{
|
||||
// Test a relative font-size as part of a 'font' spec since the code path
|
||||
// is different in this case
|
||||
// It turns out that, due to the way we store shorthand font properties, we
|
||||
// don't need to worry about marking such values as context-sensitive since we
|
||||
// seem to store them in their relative form. If, however, we change the way
|
||||
// we store shorthand font properties in the future, this will serve as
|
||||
// a useful regression test.
|
||||
setupTest();
|
||||
gCircleParent.setAttribute("font-size", "10px"); // At first: font-size: 10px
|
||||
// We must be sure to set every part of the shorthand property to some
|
||||
// non-context sensitive value because we want to test that even if only the
|
||||
// font-size is relative we will update it appropriately.
|
||||
var anim =
|
||||
createAnimSetTo("font", "normal normal bold larger/normal sans-serif");
|
||||
|
||||
gSvg.setCurrentTime(0);
|
||||
var fsize = parseInt(SMILUtil.getComputedStyleSimple(gCircle, "font-size"));
|
||||
ok(fsize > 10 && fsize < 20,
|
||||
"Checking size of shorthand 'font' > 10px after animating");
|
||||
|
||||
gCircleParent.setAttribute("font-size", "20px"); // Change: font-size: 20px
|
||||
gSvg.setCurrentTime(0);
|
||||
fsize = parseInt(SMILUtil.getComputedStyleSimple(gCircle, "font-size"));
|
||||
ok(fsize > 20,
|
||||
"Checking size of shorthand 'font' > 20px after updating context");
|
||||
|
||||
gCircleParent.removeAttribute("font-size");
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function testCalcFontSize()
|
||||
{
|
||||
setupTest();
|
||||
gCircleParent.setAttribute("font-size", "10px"); // At first: font-size: 10px
|
||||
var anim = createAnimSetTo("font-size", "-moz-calc(110% + 0.1em)");
|
||||
|
||||
gSvg.setCurrentTime(0);
|
||||
var fsize = parseInt(SMILUtil.getComputedStyleSimple(gCircle, "font-size"));
|
||||
// Font size should be 1.1 * 10px + 0.1 * 10px = 12
|
||||
is(fsize, 12, "Checking animated calc font-size == 12px after animating");
|
||||
|
||||
gCircleParent.setAttribute("font-size", "20px"); // Change: font-size: 20px
|
||||
gSvg.setCurrentTime(0);
|
||||
fsize = parseInt(SMILUtil.getComputedStyleSimple(gCircle, "font-size"));
|
||||
is(fsize, 24, "Checking animated calc font-size == 24px after updating " +
|
||||
"context");
|
||||
|
||||
gCircleParent.removeAttribute("font-size");
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function testDashArray()
|
||||
{
|
||||
// stroke dasharrays don't currently convert units--but if someone ever fixes
|
||||
// that, hopefully this test will fail and remind us not to cache percentage
|
||||
// values in that case
|
||||
setupTest();
|
||||
var oldHeight = gSvg.getAttribute("height");
|
||||
var oldWidth = gSvg.getAttribute("width");
|
||||
gSvg.setAttribute("height", "100px"); // At first: viewport: 100x100px
|
||||
gSvg.setAttribute("width", "100px");
|
||||
var anim = createAnimFromTo("stroke-dasharray", "0 5", "0 50%");
|
||||
|
||||
gSvg.setCurrentTime(TIME_AFTER_ANIM_END);
|
||||
|
||||
// Now we should be up to date
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "stroke-dasharray"), "0, 50%",
|
||||
"Checking animated stroke-dasharray after animating");
|
||||
|
||||
gSvg.setAttribute("height", "50px"); // Change viewport: 50x50px
|
||||
gSvg.setAttribute("width", "50px");
|
||||
gSvg.setCurrentTime(TIME_AFTER_ANIM_END);
|
||||
is(SMILUtil.getComputedStyleSimple(gCircle, "stroke-dasharray"), "0, 50%",
|
||||
"Checking animated stroke-dasharray after updating context");
|
||||
|
||||
gSvg.setAttribute("height", oldHeight);
|
||||
gSvg.setAttribute("width", oldWidth);
|
||||
gCircle.removeChild(gCircle.firstChild);
|
||||
}
|
||||
|
||||
function testClip()
|
||||
{
|
||||
setupTest();
|
||||
gCircleParent.setAttribute("font-size", "20px"); // At first: font-size: 20px
|
||||
|
||||
// The clip property only applies to elements that establish a new
|
||||
// viewport so we need to create a nested svg and add animation to that
|
||||
var nestedSVG = document.createElementNS(SVGNS, "svg");
|
||||
nestedSVG.setAttribute("clip", "rect(0px 0px 0px 0px)");
|
||||
gCircleParent.appendChild(nestedSVG);
|
||||
|
||||
var anim = createAnimSetTo("clip", "rect(1em 1em 1em 1em)");
|
||||
// createAnimSetTo will make the animation a child of gCircle so we need to
|
||||
// move it so it targets nestedSVG instead
|
||||
nestedSVG.appendChild(anim);
|
||||
|
||||
gSvg.setCurrentTime(TIME_AFTER_ANIM_END);
|
||||
is(SMILUtil.getComputedStyleSimple(nestedSVG, "clip"),
|
||||
"rect(20px, 20px, 20px, 20px)",
|
||||
"Checking animated clip rect after animating");
|
||||
|
||||
gCircleParent.setAttribute("font-size", "10px"); // Change: font-size: 10px
|
||||
gSvg.setCurrentTime(TIME_AFTER_ANIM_END);
|
||||
is(SMILUtil.getComputedStyleSimple(nestedSVG, "clip"),
|
||||
"rect(10px, 10px, 10px, 10px)",
|
||||
"Checking animated clip rect after updating context");
|
||||
|
||||
gCircleParent.removeAttribute("font-size");
|
||||
gCircleParent.removeChild(nestedSVG);
|
||||
}
|
||||
|
||||
window.addEventListener("load", main, false);
|
||||
|
@ -57,7 +57,6 @@ _TEST_FILES = \
|
||||
a_href_helper_04.svg \
|
||||
test_animLengthObjectIdentity.xhtml \
|
||||
test_animLengthReadonly.xhtml \
|
||||
test_animLengthRelativeUnits.xhtml \
|
||||
test_animLengthUnits.xhtml \
|
||||
test_bbox.xhtml \
|
||||
test_bbox-with-invalid-viewBox.xhtml \
|
||||
|
@ -1,80 +0,0 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=508206
|
||||
-->
|
||||
<head>
|
||||
<title>Test for liveness of relative units in animation</title>
|
||||
<script type="text/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=508206">Mozilla Bug 508206</a>
|
||||
<p id="display"></p>
|
||||
<!-- XXX The following should be display: none but that's broken by bug 413975
|
||||
where we don't handle percentage lengths when the whole fragment is
|
||||
display: none properly. -->
|
||||
<div id="content" style="visibility: hidden">
|
||||
<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="100px" height="100px"
|
||||
onload="this.pauseAnimations()">
|
||||
<g font-size="10px">
|
||||
<circle cx="0" cy="0" r="15" fill="blue" id="circle">
|
||||
<animate attributeName="cx" from="0" to="10em" dur="10s" begin="0s"
|
||||
fill="freeze" id="animate"/>
|
||||
<animate attributeName="cy" from="0" to="100%" dur="10s" begin="0s"
|
||||
fill="freeze"/>
|
||||
</circle>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
<![CDATA[
|
||||
/** Test liveness of relative units of animated lengths **/
|
||||
|
||||
/* Global Variables */
|
||||
const svgns="http://www.w3.org/2000/svg";
|
||||
var svg = document.getElementById("svg");
|
||||
var circle = document.getElementById('circle');
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function main() {
|
||||
ok(svg.animationsPaused(), "should be paused by <svg> load handler");
|
||||
is(svg.getCurrentTime(), 0, "should be paused at 0 in <svg> load handler");
|
||||
|
||||
// Sample mid-way through the animation
|
||||
svg.setCurrentTime(5);
|
||||
|
||||
// (1) Check values mid-way
|
||||
is(circle.cx.animVal.value, 50,
|
||||
"(1) Unexpected animVal for cx before changing base length");
|
||||
is(circle.cy.animVal.value, 50,
|
||||
"(1) Unexpected animVal for cy before changing base length");
|
||||
|
||||
// (2) Change the frame of reference and check values are updated immediately
|
||||
|
||||
// Change font-size
|
||||
circle.parentNode.setAttribute('font-size', '5px');
|
||||
todo_is(circle.cx.animVal.value, 25,
|
||||
"(2) Unexpected animVal for cx after changing parent font-size");
|
||||
|
||||
// Change the viewport size
|
||||
svg.setAttribute('height', '50px');
|
||||
todo_is(circle.cy.animVal.value, 25,
|
||||
"(2) Unexpected animVal for cy after changing containing viewport size");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
var animate = document.getElementById('animate');
|
||||
if (animate && animate.targetElement) {
|
||||
window.addEventListener("load", main, false);
|
||||
} else {
|
||||
ok(true); // Skip tests but don't report 'todo' either
|
||||
SimpleTest.finish();
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -429,7 +429,7 @@ static PRBool IsChromeURI(nsIURI* aURI)
|
||||
|
||||
/* Implementation file */
|
||||
|
||||
static PRIntn
|
||||
static PRBool
|
||||
TraverseProtos(nsHashKey *aKey, void *aData, void* aClosure)
|
||||
{
|
||||
nsCycleCollectionTraversalCallback *cb =
|
||||
@ -439,7 +439,7 @@ TraverseProtos(nsHashKey *aKey, void *aData, void* aClosure)
|
||||
return kHashEnumerateNext;
|
||||
}
|
||||
|
||||
static PRIntn
|
||||
static PRBool
|
||||
UnlinkProtoJSObjects(nsHashKey *aKey, void *aData, void* aClosure)
|
||||
{
|
||||
nsXBLPrototypeBinding *proto = static_cast<nsXBLPrototypeBinding*>(aData);
|
||||
@ -453,7 +453,7 @@ struct ProtoTracer
|
||||
void *mClosure;
|
||||
};
|
||||
|
||||
static PRIntn
|
||||
static PRBool
|
||||
TraceProtos(nsHashKey *aKey, void *aData, void* aClosure)
|
||||
{
|
||||
ProtoTracer* closure = static_cast<ProtoTracer*>(aClosure);
|
||||
|
@ -328,7 +328,7 @@ PRBool nsXBLPrototypeBinding::CompareBindingURI(nsIURI* aURI) const
|
||||
return equal;
|
||||
}
|
||||
|
||||
static PRIntn
|
||||
static PRBool
|
||||
TraverseInsertionPoint(nsHashKey* aKey, void* aData, void* aClosure)
|
||||
{
|
||||
nsCycleCollectionTraversalCallback &cb =
|
||||
|
@ -8452,13 +8452,13 @@ nsDocShell::InternalLoad(nsIURI * aURI,
|
||||
GetCurScrollPos(ScrollOrientation_X, &cx);
|
||||
GetCurScrollPos(ScrollOrientation_Y, &cy);
|
||||
|
||||
// We scroll whenever we're not doing a history load. Note that
|
||||
// sometimes we might scroll even if we don't fire a hashchange
|
||||
// event! See bug 653741.
|
||||
if (!aSHEntry) {
|
||||
// ScrollToAnchor doesn't necessarily cause us to scroll the window;
|
||||
// the function decides whether a scroll is appropriate based on the
|
||||
// arguments it receives. But even if we don't end up scrolling,
|
||||
// ScrollToAnchor performs other important tasks, such as informing
|
||||
// the presShell that we have a new hash. See bug 680257.
|
||||
rv = ScrollToAnchor(curHash, newHash, aLoadType);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
mLoadType = aLoadType;
|
||||
mURIResultedInDocument = PR_TRUE;
|
||||
|
@ -120,6 +120,8 @@ _TEST_FILES = \
|
||||
file_bug669671.sjs \
|
||||
test_bug675587.html \
|
||||
test_bfcache_plus_hash.html \
|
||||
test_bug680257.html \
|
||||
file_bug680257.html \
|
||||
$(NULL)
|
||||
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
|
||||
|
16
docshell/test/file_bug680257.html
Normal file
16
docshell/test/file_bug680257.html
Normal file
@ -0,0 +1,16 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<style type='text/css'>
|
||||
a { color: black; }
|
||||
a:target { color: red; }
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload='(opener || parent).popupLoaded()'>
|
||||
|
||||
<a id='a' href='#a'>link</a>
|
||||
<a id='b' href='#b'>link2</a>
|
||||
|
||||
</body>
|
||||
</html>
|
59
docshell/test/test_bug680257.html
Normal file
59
docshell/test/test_bug680257.html
Normal file
@ -0,0 +1,59 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=680257
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 680257</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=680257">Mozilla Bug 680257</a>
|
||||
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var popup = window.open('file_bug680257.html');
|
||||
|
||||
// The popup will call into popupLoaded() once it loads.
|
||||
function popupLoaded() {
|
||||
// runTests() needs to be called from outside popupLoaded's onload handler.
|
||||
// Otherwise, the navigations we do in runTests won't create new SHEntries.
|
||||
SimpleTest.executeSoon(runTests);
|
||||
}
|
||||
|
||||
function runTests() {
|
||||
checkPopupLinkStyle(false, 'Initial');
|
||||
|
||||
popup.location.hash = 'a';
|
||||
checkPopupLinkStyle(true, 'After setting hash');
|
||||
|
||||
popup.history.back();
|
||||
checkPopupLinkStyle(false, 'After going back');
|
||||
|
||||
popup.history.forward();
|
||||
checkPopupLinkStyle(true, 'After going forward');
|
||||
|
||||
popup.close();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function checkPopupLinkStyle(isTarget, desc) {
|
||||
var link = popup.document.getElementById('a');
|
||||
var style = popup.getComputedStyle(link);
|
||||
var color = style.getPropertyValue('color');
|
||||
|
||||
// Color is red if isTarget, black otherwise.
|
||||
if (isTarget) {
|
||||
is(color, 'rgb(255, 0, 0)', desc);
|
||||
}
|
||||
else {
|
||||
is(color, 'rgb(0, 0, 0)', desc);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -8220,6 +8220,7 @@ NS_IMETHODIMP
|
||||
nsGlobalWindow::GetMozIndexedDB(nsIIDBFactory** _retval)
|
||||
{
|
||||
if (!mIndexedDB) {
|
||||
if (!IsChromeWindow()) {
|
||||
nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
|
||||
do_GetService(THIRDPARTYUTIL_CONTRACTID);
|
||||
NS_ENSURE_TRUE(thirdPartyUtil, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
@ -8234,6 +8235,7 @@ nsGlobalWindow::GetMozIndexedDB(nsIIDBFactory** _retval)
|
||||
*_retval = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
mIndexedDB = indexedDB::IDBFactory::Create(this);
|
||||
NS_ENSURE_TRUE(mIndexedDB, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
|
@ -51,7 +51,7 @@
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[builtinclass, scriptable, uuid(10f43750-b379-11e0-aff2-0800200c9a66)]
|
||||
[builtinclass, scriptable, uuid(286466f1-4246-4574-afdb-2f8a03ad7cc8)]
|
||||
interface nsIDOMCSS2Properties : nsISupports
|
||||
{
|
||||
attribute DOMString background;
|
||||
@ -657,6 +657,9 @@ interface nsIDOMCSS2Properties : nsISupports
|
||||
attribute DOMString MozBorderImage;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
attribute DOMString MozColumns;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
attribute DOMString MozColumnRule;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
* For more information on this interface, please see
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/#messageevent
|
||||
*/
|
||||
[scriptable, uuid(dc8ec5c6-ebf2-4f95-be99-cd13e3c0d0c6)]
|
||||
[scriptable, uuid(9ac4fa26-4d19-4f4e-807e-b30cd0dbe56a)]
|
||||
interface nsIDOMMessageEvent : nsIDOMEvent
|
||||
{
|
||||
/**
|
||||
|
@ -169,8 +169,30 @@ class GeckoSurfaceView
|
||||
}
|
||||
|
||||
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
||||
|
||||
// Force exactly one frame to render
|
||||
// because the surface change is only seen after we
|
||||
// have swapped the back buffer.
|
||||
// The buffer size only changes after the next swap buffer.
|
||||
// We need to make sure the Gecko's view resize when Android's
|
||||
// buffer resizes.
|
||||
if (mDrawMode == DRAW_GLES_2) {
|
||||
// When we get a surfaceChange event, we have 0 to n paint events
|
||||
// waiting in the Gecko event queue. We will make the first
|
||||
// succeed and the abort the others.
|
||||
mDrawSingleFrame = true;
|
||||
if (!mInDrawing) {
|
||||
// Queue at least one paint event in case none are queued.
|
||||
GeckoAppShell.scheduleRedraw();
|
||||
}
|
||||
GeckoAppShell.geckoEventSync();
|
||||
mDrawSingleFrame = false;
|
||||
mAbortDraw = false;
|
||||
}
|
||||
|
||||
if (mShowingSplashScreen)
|
||||
drawSplashScreen(holder, width, height);
|
||||
|
||||
mSurfaceLock.lock();
|
||||
|
||||
try {
|
||||
@ -221,6 +243,12 @@ class GeckoSurfaceView
|
||||
}
|
||||
} finally {
|
||||
mSurfaceLock.unlock();
|
||||
if (mDrawMode == DRAW_GLES_2) {
|
||||
// Force a frame to be drawn before the surfaceChange returns,
|
||||
// otherwise we get artifacts.
|
||||
GeckoAppShell.scheduleRedraw();
|
||||
GeckoAppShell.geckoEventSync();
|
||||
}
|
||||
}
|
||||
|
||||
Object syncDrawObject = null;
|
||||
@ -293,6 +321,10 @@ class GeckoSurfaceView
|
||||
public static final int DRAW_ERROR = 0;
|
||||
public static final int DRAW_GLES_2 = 1;
|
||||
public static final int DRAW_2D = 2;
|
||||
// Drawing is disable when the surface buffer
|
||||
// has changed size but we haven't yet processed the
|
||||
// resize event.
|
||||
public static final int DRAW_DISABLED = 3;
|
||||
|
||||
public int beginDrawing() {
|
||||
if (mInDrawing) {
|
||||
@ -300,6 +332,12 @@ class GeckoSurfaceView
|
||||
return DRAW_ERROR;
|
||||
}
|
||||
|
||||
// Once we drawn our first frame after resize we can ignore
|
||||
// the other draw events until we handle the resize events.
|
||||
if (mAbortDraw) {
|
||||
return DRAW_DISABLED;
|
||||
}
|
||||
|
||||
/* Grab the lock, which we'll hold while we're drawing.
|
||||
* It gets released in endDrawing(), and is also used in surfaceChanged
|
||||
* to make sure that we don't change our surface details while
|
||||
@ -330,6 +368,9 @@ class GeckoSurfaceView
|
||||
return;
|
||||
}
|
||||
|
||||
if (mDrawSingleFrame)
|
||||
mAbortDraw = true;
|
||||
|
||||
try {
|
||||
if (!mSurfaceValid) {
|
||||
Log.e(LOG_FILE_NAME, "endDrawing with false mSurfaceValid");
|
||||
@ -657,6 +698,10 @@ class GeckoSurfaceView
|
||||
// Are we actively between beginDrawing/endDrawing?
|
||||
boolean mInDrawing;
|
||||
|
||||
// Used to finish the current buffer before changing the surface size
|
||||
boolean mDrawSingleFrame = false;
|
||||
boolean mAbortDraw = false;
|
||||
|
||||
// Are we waiting for a buffer to draw in surfaceChanged?
|
||||
boolean mSyncDraw;
|
||||
|
||||
|
@ -285,7 +285,7 @@ NS_IMETHODIMP nsSystemPrefService::GetBoolPref(const char *aPrefName, PRBool *_r
|
||||
}
|
||||
|
||||
/* void setBoolPref (in string aPrefName, in long aValue); */
|
||||
NS_IMETHODIMP nsSystemPrefService::SetBoolPref(const char *aPrefName, PRInt32 aValue)
|
||||
NS_IMETHODIMP nsSystemPrefService::SetBoolPref(const char *aPrefName, PRBool aValue)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -41,10 +41,6 @@
|
||||
#include "nsICategoryManager.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
|
||||
// The number 130 more or less comes out of thin air.
|
||||
// See https://bugzilla.mozilla.org/show_bug.cgi?id=355178#c78 for a pseudo-rationale.
|
||||
#define UNREASONABLE_WORD_LENGTH 130
|
||||
|
||||
#define DEFAULT_SPELL_CHECKER "@mozilla.org/spellchecker/engine;1"
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(mozSpellChecker)
|
||||
@ -149,12 +145,6 @@ mozSpellChecker::CheckWord(const nsAString &aWord, PRBool *aIsMisspelled, nsTArr
|
||||
if(!mSpellCheckingEngine)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
// don't bother to check crazy words
|
||||
if (aWord.Length() > UNREASONABLE_WORD_LENGTH) {
|
||||
*aIsMisspelled = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
*aIsMisspelled = PR_FALSE;
|
||||
result = mSpellCheckingEngine->Check(PromiseFlatString(aWord).get(), &correct);
|
||||
NS_ENSURE_SUCCESS(result, result);
|
||||
|
@ -43,7 +43,6 @@ USE_AUTOCONF = 1
|
||||
MOZILLA_CLIENT = 1
|
||||
target = @target@
|
||||
ac_configure_args = @ac_configure_args@
|
||||
BUILD_MODULES = @BUILD_MODULES@
|
||||
MOZILLA_VERSION = @MOZILLA_VERSION@
|
||||
|
||||
MOZ_BUILD_APP = @MOZ_BUILD_APP@
|
||||
|
@ -1153,8 +1153,9 @@ ifdef HAVE_DTRACE
|
||||
ifndef XP_MACOSX
|
||||
ifdef DTRACE_PROBE_OBJ
|
||||
ifndef DTRACE_LIB_DEPENDENT
|
||||
$(DTRACE_PROBE_OBJ):
|
||||
dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ)
|
||||
NON_DTRACE_OBJS := $(filter-out $(DTRACE_PROBE_OBJ),$(OBJS))
|
||||
$(DTRACE_PROBE_OBJ): $(NON_DTRACE_OBJS)
|
||||
dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(NON_DTRACE_OBJS)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@ -1550,9 +1551,6 @@ export:: FORCE
|
||||
@echo; sleep 2; false
|
||||
endif
|
||||
|
||||
$(IDL_DIR)::
|
||||
$(NSINSTALL) -D $@
|
||||
|
||||
# generate .h files from into $(XPIDL_GEN_DIR), then export to $(DIST)/include;
|
||||
# warn against overriding existing .h file.
|
||||
$(XPIDL_GEN_DIR)/.done:
|
||||
@ -1623,14 +1621,8 @@ endif # XPIDLSRCS
|
||||
|
||||
|
||||
|
||||
#
|
||||
# General rules for exporting idl files.
|
||||
#
|
||||
# WORK-AROUND ONLY, for mozilla/tools/module-deps/bootstrap.pl build.
|
||||
# Bug to fix idl dependency problems w/o this extra build pass is
|
||||
# http://bugzilla.mozilla.org/show_bug.cgi?id=145777
|
||||
#
|
||||
$(IDL_DIR)::
|
||||
$(IDL_DIR):
|
||||
$(NSINSTALL) -D $@
|
||||
|
||||
export-idl:: $(SUBMAKEFILES) $(MAKE_DIRS)
|
||||
@ -2097,7 +2089,6 @@ showhost:
|
||||
@echo "HOST_LIBRARY = $(HOST_LIBRARY)"
|
||||
|
||||
showbuildmods::
|
||||
@echo "Build Modules = $(BUILD_MODULES)"
|
||||
@echo "Module dirs = $(BUILD_MODULE_DIRS)"
|
||||
|
||||
documentation:
|
||||
|
@ -2482,6 +2482,7 @@ js_CloneFunctionObject(JSContext *cx, JSFunction *fun, JSObject *parent,
|
||||
JS_ASSERT(script->compartment != cx->compartment);
|
||||
JS_OPT_ASSERT(script->ownerObject == fun);
|
||||
|
||||
cfun->u.i.script = NULL;
|
||||
JSScript *cscript = js_CloneScript(cx, script);
|
||||
if (!cscript)
|
||||
return NULL;
|
||||
|
@ -46,17 +46,8 @@ include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = xpconnect
|
||||
|
||||
ifeq (xpconnect, $(findstring xpconnect, $(BUILD_MODULES)))
|
||||
LIBRARY_NAME = xpconnect
|
||||
EXPORT_LIBRARY = 1
|
||||
SHORT_LIBNAME = xpconect
|
||||
IS_COMPONENT = 1
|
||||
MODULE_NAME = xpconnect
|
||||
GRE_MODULE = 1
|
||||
else
|
||||
LIBRARY_NAME = xpconnect_s
|
||||
FORCE_STATIC_LIB = 1
|
||||
endif
|
||||
LIBXUL_LIBRARY = 1
|
||||
EXPORTS = xpcpublic.h
|
||||
|
||||
|
@ -279,6 +279,28 @@ nsProgressFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
return autoSize;
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsProgressFrame::GetMinWidth(nsRenderingContext *aRenderingContext)
|
||||
{
|
||||
nsRefPtr<nsFontMetrics> fontMet;
|
||||
NS_ENSURE_SUCCESS(
|
||||
nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fontMet)), 0);
|
||||
|
||||
nscoord minWidth = fontMet->Font().size; // 1em
|
||||
|
||||
if (GetStyleDisplay()->mOrient == NS_STYLE_ORIENT_HORIZONTAL) {
|
||||
minWidth *= 10; // 10em
|
||||
}
|
||||
|
||||
return minWidth;
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsProgressFrame::GetPrefWidth(nsRenderingContext *aRenderingContext)
|
||||
{
|
||||
return GetMinWidth(aRenderingContext);
|
||||
}
|
||||
|
||||
bool
|
||||
nsProgressFrame::ShouldUseNativeStyle() const
|
||||
{
|
||||
|
@ -84,6 +84,9 @@ public:
|
||||
nsSize aMargin, nsSize aBorder,
|
||||
nsSize aPadding, PRBool aShrinkWrap);
|
||||
|
||||
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext);
|
||||
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext);
|
||||
|
||||
virtual PRBool IsFrameOfType(PRUint32 aFlags) const
|
||||
{
|
||||
return nsHTMLContainerFrame::IsFrameOfType(aFlags &
|
||||
|
22
layout/reftests/forms/progress/in-cells-ref.html
Normal file
22
layout/reftests/forms/progress/in-cells-ref.html
Normal file
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<link rel='stylesheet' type='text/css' href='style.css'>
|
||||
<style>
|
||||
progress { width: 10em; height: 1em; }
|
||||
progress.vertical { -moz-orient: vertical; width: 1em; height: 10em; }
|
||||
</style>
|
||||
<body>
|
||||
<table>
|
||||
<tr>
|
||||
<td>foo</td>
|
||||
<td><progress value='0.5'></td>
|
||||
<td>bar</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>foo</td>
|
||||
<td><progress class='vertical' value='0.5'></td>
|
||||
<td>bar</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
21
layout/reftests/forms/progress/in-cells.html
Normal file
21
layout/reftests/forms/progress/in-cells.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<link rel='stylesheet' type='text/css' href='style.css'>
|
||||
<style>
|
||||
progress.vertical { -moz-orient: vertical; }
|
||||
</style>
|
||||
<body>
|
||||
<table>
|
||||
<tr>
|
||||
<td>foo</td>
|
||||
<td><progress value='0.5'></td>
|
||||
<td>bar</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>foo</td>
|
||||
<td><progress class='vertical' value='0.5'></td>
|
||||
<td>bar</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -22,3 +22,4 @@
|
||||
|
||||
# Tests for bugs:
|
||||
== block-invalidate.html block-invalidate-ref.html
|
||||
== in-cells.html in-cells-ref.html
|
||||
|
@ -769,6 +769,15 @@ Declaration::GetValue(nsCSSProperty aProperty, nsAString& aValue) const
|
||||
AppendValueToString(eCSSProperty_marker_end, aValue);
|
||||
break;
|
||||
}
|
||||
case eCSSProperty__moz_columns: {
|
||||
// Two values, column-count and column-width, separated by a space.
|
||||
const nsCSSProperty* subprops =
|
||||
nsCSSProps::SubpropertyEntryFor(aProperty);
|
||||
AppendValueToString(subprops[0], aValue);
|
||||
aValue.Append(PRUnichar(' '));
|
||||
AppendValueToString(subprops[1], aValue);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
NS_ABORT_IF_FALSE(false, "no other shorthands");
|
||||
break;
|
||||
|
@ -492,6 +492,7 @@ protected:
|
||||
|
||||
// for 'clip' and '-moz-image-region'
|
||||
PRBool ParseRect(nsCSSProperty aPropID);
|
||||
PRBool ParseColumns();
|
||||
PRBool ParseContent();
|
||||
PRBool ParseCounterData(nsCSSProperty aPropID);
|
||||
PRBool ParseCursor();
|
||||
@ -5492,6 +5493,8 @@ CSSParserImpl::ParsePropertyByFunction(nsCSSProperty aPropID)
|
||||
|
||||
case eCSSProperty_clip:
|
||||
return ParseRect(eCSSProperty_clip);
|
||||
case eCSSProperty__moz_columns:
|
||||
return ParseColumns();
|
||||
case eCSSProperty__moz_column_rule:
|
||||
return ParseBorderSide(kColumnRuleIDs, PR_FALSE);
|
||||
case eCSSProperty_content:
|
||||
@ -5587,6 +5590,10 @@ CSSParserImpl::ParseSingleValueProperty(nsCSSValue& aValue,
|
||||
return ParseVariant(aValue, VARIANT_NONE | VARIANT_INHERIT, nsnull);
|
||||
}
|
||||
|
||||
if (aPropID == eCSSPropertyExtra_x_auto_value) {
|
||||
return ParseVariant(aValue, VARIANT_AUTO | VARIANT_INHERIT, nsnull);
|
||||
}
|
||||
|
||||
if (aPropID < 0 || aPropID >= eCSSProperty_COUNT_no_shorthands) {
|
||||
NS_ABORT_IF_FALSE(PR_FALSE, "not a single value property");
|
||||
return PR_FALSE;
|
||||
@ -6846,6 +6853,48 @@ CSSParserImpl::ParseRect(nsCSSProperty aPropID)
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
CSSParserImpl::ParseColumns()
|
||||
{
|
||||
// We use a similar "fake value" hack to ParseListStyle, because
|
||||
// "auto" is acceptable for both column-count and column-width.
|
||||
// If the fake "auto" value is found, and one of the real values isn't,
|
||||
// that means the fake auto value is meant for the real value we didn't
|
||||
// find.
|
||||
static const nsCSSProperty columnIDs[] = {
|
||||
eCSSPropertyExtra_x_auto_value,
|
||||
eCSSProperty__moz_column_count,
|
||||
eCSSProperty__moz_column_width
|
||||
};
|
||||
const PRInt32 numProps = NS_ARRAY_LENGTH(columnIDs);
|
||||
|
||||
nsCSSValue values[numProps];
|
||||
PRInt32 found = ParseChoice(values, columnIDs, numProps);
|
||||
if (found < 1 || !ExpectEndProperty()) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
if ((found & (1|2|4)) == (1|2|4) &&
|
||||
values[0].GetUnit() == eCSSUnit_Auto) {
|
||||
// We filled all 3 values, which is invalid
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
if ((found & 2) == 0) {
|
||||
// Provide auto column-count
|
||||
values[1].SetAutoValue();
|
||||
}
|
||||
if ((found & 4) == 0) {
|
||||
// Provide auto column-width
|
||||
values[2].SetAutoValue();
|
||||
}
|
||||
|
||||
// Start at index 1 to skip the fake auto value.
|
||||
for (PRInt32 index = 1; index < numProps; index++) {
|
||||
AppendValue(columnIDs[index], values[index]);
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
#define VARIANT_CONTENT (VARIANT_STRING | VARIANT_URL | VARIANT_COUNTER | VARIANT_ATTR | \
|
||||
VARIANT_KEYWORD)
|
||||
PRBool
|
||||
|
@ -1239,6 +1239,11 @@ CSS_PROP_COLOR(
|
||||
nsnull,
|
||||
offsetof(nsStyleColor, mColor),
|
||||
eStyleAnimType_Color)
|
||||
CSS_PROP_SHORTHAND(
|
||||
-moz-columns,
|
||||
_moz_columns,
|
||||
CSS_PROP_DOMPROP_PREFIXED(Columns),
|
||||
CSS_PROPERTY_PARSE_FUNCTION)
|
||||
CSS_PROP_COLUMN(
|
||||
-moz-column-count,
|
||||
_moz_column_count,
|
||||
|
@ -76,7 +76,8 @@ enum nsCSSProperty {
|
||||
eCSSPropertyExtra_all_properties,
|
||||
|
||||
// Extra dummy values for nsCSSParser internal use.
|
||||
eCSSPropertyExtra_x_none_value
|
||||
eCSSPropertyExtra_x_none_value,
|
||||
eCSSPropertyExtra_x_auto_value
|
||||
};
|
||||
|
||||
// The "descriptors" that can appear in a @font-face rule.
|
||||
|
@ -1968,6 +1968,12 @@ static const nsCSSProperty gOutlineSubpropTable[] = {
|
||||
eCSSProperty_UNKNOWN
|
||||
};
|
||||
|
||||
static const nsCSSProperty gColumnsSubpropTable[] = {
|
||||
eCSSProperty__moz_column_count,
|
||||
eCSSProperty__moz_column_width,
|
||||
eCSSProperty_UNKNOWN
|
||||
};
|
||||
|
||||
static const nsCSSProperty gColumnRuleSubpropTable[] = {
|
||||
// nsCSSDeclaration.cpp outputs the subproperties in this order.
|
||||
// It also depends on the color being third.
|
||||
|
@ -744,6 +744,10 @@ public:
|
||||
NS_ASSERTION(IsRoot(), "should only be called on root of rule tree");
|
||||
return HaveChildren() || mStyleData.mInheritedData || mStyleData.mResetData;
|
||||
}
|
||||
|
||||
PRBool NodeHasCachedData(const nsStyleStructID aSID) {
|
||||
return !!mStyleData.GetStyleData(aSID);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1926,65 +1926,13 @@ LookupStyleContext(dom::Element* aElement)
|
||||
return nsComputedDOMStyle::GetStyleContextForElement(aElement, nsnull, shell);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper function: StyleWithDeclarationAdded
|
||||
* Creates a nsStyleRule with the specified property set to the specified
|
||||
* value, and returns a nsStyleContext for this rule, as a sibling of the
|
||||
* given element's nsStyleContext.
|
||||
*
|
||||
* If we fail to parse |aSpecifiedValue| for |aProperty|, this method will
|
||||
* return nsnull.
|
||||
*
|
||||
* @param aProperty The property whose value we're customizing in the
|
||||
* custom style context.
|
||||
* @param aTargetElement The element whose style context we'll use as a
|
||||
* sibling for our custom style context.
|
||||
* @param aSpecifiedValue The value for |aProperty| in our custom style
|
||||
* context.
|
||||
* @param aUseSVGMode A flag to indicate whether we should parse
|
||||
* |aSpecifiedValue| in SVG mode.
|
||||
* @return The generated custom nsStyleContext, or nsnull on failure.
|
||||
*/
|
||||
already_AddRefed<nsStyleContext>
|
||||
StyleWithDeclarationAdded(nsCSSProperty aProperty,
|
||||
dom::Element* aTargetElement,
|
||||
const nsAString& aSpecifiedValue,
|
||||
PRBool aUseSVGMode)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(aTargetElement, "null target element");
|
||||
NS_ABORT_IF_FALSE(aTargetElement->GetCurrentDoc(),
|
||||
"element needs to be in a document "
|
||||
"if we're going to look up its style context");
|
||||
|
||||
// Look up style context for our target element
|
||||
nsRefPtr<nsStyleContext> styleContext = LookupStyleContext(aTargetElement);
|
||||
if (!styleContext) {
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
// Parse specified value into a temporary StyleRule
|
||||
nsRefPtr<css::StyleRule> styleRule =
|
||||
BuildStyleRule(aProperty, aTargetElement, aSpecifiedValue, aUseSVGMode);
|
||||
if (!styleRule) {
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
styleRule->RuleMatched();
|
||||
|
||||
// Create a temporary nsStyleContext for the style rule
|
||||
nsCOMArray<nsIStyleRule> ruleArray;
|
||||
ruleArray.AppendObject(styleRule);
|
||||
nsStyleSet* styleSet = styleContext->PresContext()->StyleSet();
|
||||
return styleSet->ResolveStyleByAddingRules(styleContext, ruleArray);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsStyleAnimation::ComputeValue(nsCSSProperty aProperty,
|
||||
dom::Element* aTargetElement,
|
||||
const nsAString& aSpecifiedValue,
|
||||
PRBool aUseSVGMode,
|
||||
Value& aComputedValue)
|
||||
Value& aComputedValue,
|
||||
PRBool* aIsContextSensitive)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(aTargetElement, "null target element");
|
||||
NS_ABORT_IF_FALSE(aTargetElement->GetCurrentDoc(),
|
||||
@ -1995,10 +1943,10 @@ nsStyleAnimation::ComputeValue(nsCSSProperty aProperty,
|
||||
nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_REPORT_OTHER_NAME)
|
||||
? nsCSSProps::OtherNameFor(aProperty) : aProperty;
|
||||
|
||||
nsRefPtr<nsStyleContext> tmpStyleContext =
|
||||
StyleWithDeclarationAdded(propToParse, aTargetElement,
|
||||
aSpecifiedValue, aUseSVGMode);
|
||||
if (!tmpStyleContext) {
|
||||
// Parse specified value into a temporary css::StyleRule
|
||||
nsRefPtr<css::StyleRule> styleRule =
|
||||
BuildStyleRule(propToParse, aTargetElement, aSpecifiedValue, aUseSVGMode);
|
||||
if (!styleRule) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
@ -2006,8 +1954,61 @@ nsStyleAnimation::ComputeValue(nsCSSProperty aProperty,
|
||||
nsCSSProps::kAnimTypeTable[aProperty] == eStyleAnimType_None) {
|
||||
// Just capture the specified value
|
||||
aComputedValue.SetUnparsedStringValue(nsString(aSpecifiedValue));
|
||||
if (aIsContextSensitive) {
|
||||
// Since we're just returning the string as-is, aComputedValue isn't going
|
||||
// to change depending on the context
|
||||
*aIsContextSensitive = PR_FALSE;
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
// Look up style context for our target element
|
||||
nsRefPtr<nsStyleContext> styleContext = LookupStyleContext(aTargetElement);
|
||||
if (!styleContext) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
nsStyleSet* styleSet = styleContext->PresContext()->StyleSet();
|
||||
|
||||
nsRefPtr<nsStyleContext> tmpStyleContext;
|
||||
if (aIsContextSensitive) {
|
||||
nsCOMArray<nsIStyleRule> ruleArray;
|
||||
ruleArray.AppendObject(styleSet->InitialStyleRule());
|
||||
ruleArray.AppendObject(styleRule);
|
||||
styleRule->RuleMatched();
|
||||
tmpStyleContext =
|
||||
styleSet->ResolveStyleByAddingRules(styleContext, ruleArray);
|
||||
if (!tmpStyleContext) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
// Force walk of rule tree
|
||||
nsStyleStructID sid = nsCSSProps::kSIDTable[aProperty];
|
||||
tmpStyleContext->GetStyleData(sid);
|
||||
|
||||
// If the rule node will have cached style data if the value is not
|
||||
// context-sensitive. So if there's nothing cached, it's not context
|
||||
// sensitive.
|
||||
*aIsContextSensitive =
|
||||
!tmpStyleContext->GetRuleNode()->NodeHasCachedData(sid);
|
||||
}
|
||||
|
||||
// If we're not concerned whether the property is context sensitive then just
|
||||
// add the rule to a new temporary style context alongside the target
|
||||
// element's style context.
|
||||
// Also, if we previously discovered that this property IS context-sensitive
|
||||
// then we need to throw the temporary style context out since the property's
|
||||
// value may have been biased by the 'initial' values supplied.
|
||||
if (!aIsContextSensitive || *aIsContextSensitive) {
|
||||
nsCOMArray<nsIStyleRule> ruleArray;
|
||||
ruleArray.AppendObject(styleRule);
|
||||
styleRule->RuleMatched();
|
||||
tmpStyleContext =
|
||||
styleSet->ResolveStyleByAddingRules(styleContext, ruleArray);
|
||||
if (!tmpStyleContext) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// Extract computed value of our property from the temporary style rule
|
||||
return ExtractComputedValue(aProperty, tmpStyleContext, aComputedValue);
|
||||
}
|
||||
|
@ -175,13 +175,22 @@ public:
|
||||
* @param aUseSVGMode A flag to indicate whether we should parse
|
||||
* |aSpecifiedValue| in SVG mode.
|
||||
* @param [out] aComputedValue The resulting computed value.
|
||||
* @param [out] aIsContextSensitive
|
||||
* Set to PR_TRUE if |aSpecifiedValue| may produce
|
||||
* a different |aComputedValue| depending on other CSS
|
||||
* properties on |aTargetElement| or its ancestors.
|
||||
* PR_FALSE otherwise.
|
||||
* Note that the operation of this method is
|
||||
* significantly faster when |aIsContextSensitive| is
|
||||
* nsnull.
|
||||
* @return PR_TRUE on success, PR_FALSE on failure.
|
||||
*/
|
||||
static PRBool ComputeValue(nsCSSProperty aProperty,
|
||||
mozilla::dom::Element* aElement,
|
||||
mozilla::dom::Element* aTargetElement,
|
||||
const nsAString& aSpecifiedValue,
|
||||
PRBool aUseSVGMode,
|
||||
Value& aComputedValue);
|
||||
Value& aComputedValue,
|
||||
PRBool* aIsContextSensitive = nsnull);
|
||||
|
||||
/**
|
||||
* Creates a specified value for the given computed value.
|
||||
|
@ -57,6 +57,7 @@
|
||||
#include "nsIContent.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsRuleData.h"
|
||||
#include "nsRuleProcessorData.h"
|
||||
#include "nsTransitionManager.h"
|
||||
#include "nsAnimationManager.h"
|
||||
@ -80,6 +81,50 @@ nsEmptyStyleRule::List(FILE* out, PRInt32 aIndent) const
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsInitialStyleRule, nsIStyleRule)
|
||||
|
||||
/* virtual */ void
|
||||
nsInitialStyleRule::MapRuleInfoInto(nsRuleData* aRuleData)
|
||||
{
|
||||
// Iterate over the property groups
|
||||
for (nsStyleStructID sid = nsStyleStructID(0);
|
||||
sid < nsStyleStructID_Length; sid = nsStyleStructID(sid + 1)) {
|
||||
if (aRuleData->mSIDs & (1 << sid)) {
|
||||
// Iterate over nsCSSValues within the property group
|
||||
nsCSSValue * const value_start =
|
||||
aRuleData->mValueStorage + aRuleData->mValueOffsets[sid];
|
||||
for (nsCSSValue *value = value_start,
|
||||
*value_end = value + nsCSSProps::PropertyCountInStruct(sid);
|
||||
value != value_end; ++value) {
|
||||
// If MathML is disabled take care not to set MathML properties (or we
|
||||
// will trigger assertions in nsRuleNode)
|
||||
if (sid == eStyleStruct_Font &&
|
||||
!aRuleData->mPresContext->Document()->GetMathMLEnabled()) {
|
||||
size_t index = value - value_start;
|
||||
if (index == nsCSSProps::PropertyIndexInStruct(
|
||||
eCSSProperty_script_level) ||
|
||||
index == nsCSSProps::PropertyIndexInStruct(
|
||||
eCSSProperty_script_size_multiplier) ||
|
||||
index == nsCSSProps::PropertyIndexInStruct(
|
||||
eCSSProperty_script_min_size)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (value->GetUnit() == eCSSUnit_Null) {
|
||||
value->SetInitialValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/* virtual */ void
|
||||
nsInitialStyleRule::List(FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
static const nsStyleSet::sheetType gCSSSheetTypes[] = {
|
||||
nsStyleSet::eAgentSheet,
|
||||
nsStyleSet::eUserSheet,
|
||||
@ -1565,3 +1610,12 @@ nsStyleSet::EnsureUniqueInnerOnCSSSheets()
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
nsIStyleRule*
|
||||
nsStyleSet::InitialStyleRule()
|
||||
{
|
||||
if (!mInitialStyleRule) {
|
||||
mInitialStyleRule = new nsInitialStyleRule;
|
||||
}
|
||||
return mInitialStyleRule;
|
||||
}
|
||||
|
@ -74,6 +74,15 @@ class nsEmptyStyleRule : public nsIStyleRule
|
||||
#endif
|
||||
};
|
||||
|
||||
class nsInitialStyleRule : public nsIStyleRule
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
virtual void MapRuleInfoInto(nsRuleData* aRuleData);
|
||||
#ifdef DEBUG
|
||||
virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
};
|
||||
|
||||
// The style set object is created by the document viewer and ownership is
|
||||
// then handed off to the PresShell. Only the PresShell should delete a
|
||||
// style set.
|
||||
@ -309,6 +318,8 @@ class nsStyleSet
|
||||
|
||||
nsCSSStyleSheet::EnsureUniqueInnerResult EnsureUniqueInnerOnCSSSheets();
|
||||
|
||||
nsIStyleRule* InitialStyleRule();
|
||||
|
||||
private:
|
||||
// Not to be implemented
|
||||
nsStyleSet(const nsStyleSet& aCopy);
|
||||
@ -400,6 +411,10 @@ class nsStyleSet
|
||||
// apply into different branches of the rule tree.
|
||||
nsRefPtr<nsEmptyStyleRule> mFirstLineRule, mFirstLetterRule;
|
||||
|
||||
// Style rule which sets all properties to their initial values for
|
||||
// determining when context-sensitive values are in use.
|
||||
nsRefPtr<nsInitialStyleRule> mInitialStyleRule;
|
||||
|
||||
PRUint16 mBatching;
|
||||
|
||||
// Old rule trees, which should only be non-empty between
|
||||
|
@ -472,6 +472,16 @@ var gCSSProperties = {
|
||||
other_values: [ "border-box", "padding-box" ],
|
||||
invalid_values: [ "margin-box", "content", "padding", "border", "margin" ]
|
||||
},
|
||||
"-moz-columns": {
|
||||
domProp: "MozColumns",
|
||||
inherited: false,
|
||||
type: CSS_TYPE_TRUE_SHORTHAND,
|
||||
subproperties: [ "-moz-column-count", "-moz-column-width" ],
|
||||
initial_values: [ "auto", "auto auto" ],
|
||||
other_values: [ "3", "20px", "2 10px", "10px 2", "2 auto", "auto 2", "auto 50px", "50px auto" ],
|
||||
invalid_values: [ "5%", "-1px", "-1", "3 5", "10px 4px", "10 2px 5in", "30px -1",
|
||||
"auto 3 5px", "5 auto 20px", "auto auto auto" ]
|
||||
},
|
||||
"-moz-column-count": {
|
||||
domProp: "MozColumnCount",
|
||||
inherited: false,
|
||||
|
@ -1490,7 +1490,16 @@ var BadgeHandlers = {
|
||||
aPopup.registerBadgeHandler(handlers[i].url, handlers[i]);
|
||||
},
|
||||
|
||||
get _pk11DB() {
|
||||
delete this._pk11DB;
|
||||
return this._pk11DB = Cc["@mozilla.org/security/pk11tokendb;1"].getService(Ci.nsIPK11TokenDB);
|
||||
},
|
||||
|
||||
getLogin: function(aURL) {
|
||||
let token = this._pk11DB.getInternalKeyToken();
|
||||
if (!token.isLoggedIn())
|
||||
return {username: "", password: ""};
|
||||
|
||||
let lm = Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
|
||||
let logins = lm.findLogins({}, aURL, aURL, null);
|
||||
let username = logins.length > 0 ? logins[0].username : "";
|
||||
|
@ -382,8 +382,6 @@ let WeaveGlue = {
|
||||
},
|
||||
|
||||
observe: function observe(aSubject, aTopic, aData) {
|
||||
let loggedIn = Weave.Service.isLoggedIn;
|
||||
|
||||
// Make sure we're online when connecting/syncing
|
||||
Util.forceOnline();
|
||||
|
||||
@ -400,7 +398,13 @@ let WeaveGlue = {
|
||||
let disconnect = this._elements.disconnect;
|
||||
let sync = this._elements.sync;
|
||||
|
||||
let syncEnabled = this._elements.autosync.value;
|
||||
let syncEnabled = autosync.value;
|
||||
let loggedIn = Weave.Service.isLoggedIn;
|
||||
|
||||
// Sync may successfully log in after it was temporarily disabled by a
|
||||
// canceled master password entry. If so, then re-enable it.
|
||||
if (loggedIn && !syncEnabled)
|
||||
syncEnabled = autosync.value = true;
|
||||
|
||||
// If Sync is not enabled, hide the connection row visibility
|
||||
if (syncEnabled) {
|
||||
@ -451,10 +455,18 @@ let WeaveGlue = {
|
||||
}
|
||||
|
||||
// Show what went wrong with login if necessary
|
||||
if (aTopic == "weave:service:login:error")
|
||||
if (aTopic == "weave:service:login:error") {
|
||||
if (Weave.Status.login == "service.master_password_locked") {
|
||||
// Disable sync temporarily. Sync will try again after a set interval,
|
||||
// or if the user presses the button to enable it again.
|
||||
autosync.value = false;
|
||||
this.toggleSyncEnabled();
|
||||
} else {
|
||||
connect.setAttribute("desc", Weave.Utils.getErrorString(Weave.Status.login));
|
||||
else
|
||||
}
|
||||
} else {
|
||||
connect.removeAttribute("desc");
|
||||
}
|
||||
|
||||
// Init the setup data if we just logged in
|
||||
if (!this.setupData && aTopic == "weave:service:login:finish")
|
||||
|
@ -584,19 +584,6 @@ nsJARURI::SetFilePath(const nsACString& filePath)
|
||||
return mJAREntry->SetFilePath(filePath);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsJARURI::GetParam(nsACString& param)
|
||||
{
|
||||
param.Truncate();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsJARURI::SetParam(const nsACString& param)
|
||||
{
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsJARURI::GetQuery(nsACString& query)
|
||||
{
|
||||
|
@ -55,7 +55,7 @@
|
||||
* @see nsIPrefService
|
||||
*/
|
||||
|
||||
[scriptable, uuid(e0b6e170-691b-11e0-ae3e-0800200c9a66)]
|
||||
[scriptable, uuid(e162bfa0-01bd-4e9f-9843-8fb2efcd6d1f)]
|
||||
interface nsIPrefBranch : nsISupports
|
||||
{
|
||||
|
||||
@ -107,7 +107,7 @@ interface nsIPrefBranch : nsISupports
|
||||
*
|
||||
* @see getBoolPref
|
||||
*/
|
||||
void setBoolPref(in string aPrefName, in long aValue);
|
||||
void setBoolPref(in string aPrefName, in boolean aValue);
|
||||
|
||||
/**
|
||||
* Called to get the state of an individual string preference.
|
||||
|
@ -47,7 +47,7 @@ interface nsIObserver;
|
||||
*
|
||||
* @see nsIPrefBranch
|
||||
*/
|
||||
[scriptable, uuid(784de8e2-e72f-441a-ae74-9d5fdfe13be3)]
|
||||
[scriptable, uuid(d9bb54df-daac-4ce6-a70c-95d87b770cd8)]
|
||||
interface nsIPrefBranch2 : nsIPrefBranch
|
||||
{
|
||||
/**
|
||||
|
@ -44,7 +44,7 @@
|
||||
* @status NON-FROZEN interface WHICH WILL PROBABLY GO AWAY.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(d1d412d9-15d6-4a6a-9533-b949dc175ff5)]
|
||||
[scriptable, uuid(355bd1e9-248a-438b-809d-e0db1b287882)]
|
||||
interface nsIPrefBranchInternal : nsIPrefBranch2
|
||||
{
|
||||
};
|
||||
|
@ -164,7 +164,7 @@ NS_IMETHODIMP nsPrefBranch::GetBoolPref(const char *aPrefName, PRBool *_retval)
|
||||
return PREF_GetBoolPref(pref, _retval, mIsDefault);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPrefBranch::SetBoolPref(const char *aPrefName, PRInt32 aValue)
|
||||
NS_IMETHODIMP nsPrefBranch::SetBoolPref(const char *aPrefName, PRBool aValue)
|
||||
{
|
||||
if (GetContentChild()) {
|
||||
NS_ERROR("cannot set pref from content process");
|
||||
|
@ -68,9 +68,6 @@
|
||||
#include <os2.h>
|
||||
#endif
|
||||
|
||||
#define BOGUS_DEFAULT_INT_PREF_VALUE (-5632)
|
||||
#define BOGUS_DEFAULT_BOOL_PREF_VALUE (-2)
|
||||
|
||||
static void
|
||||
clearPrefEntry(PLDHashTable *table, PLDHashEntryHdr *entry)
|
||||
{
|
||||
@ -298,7 +295,7 @@ nsresult
|
||||
PREF_SetBoolPref(const char *pref_name, PRBool value, PRBool set_default)
|
||||
{
|
||||
PrefValue pref;
|
||||
pref.boolVal = value ? PR_TRUE : PR_FALSE;
|
||||
pref.boolVal = value;
|
||||
|
||||
return pref_HashPref(pref_name, pref, PREF_BOOL, set_default);
|
||||
}
|
||||
@ -339,9 +336,10 @@ pref_savePref(PLDHashTable *table, PLDHashEntryHdr *heh, PRUint32 i, void *arg)
|
||||
PrefValue* sourcePref;
|
||||
|
||||
if (PREF_HAS_USER_VALUE(pref) &&
|
||||
pref_ValueChanged(pref->defaultPref,
|
||||
(pref_ValueChanged(pref->defaultPref,
|
||||
pref->userPref,
|
||||
(PrefType) PREF_TYPE(pref))) {
|
||||
(PrefType) PREF_TYPE(pref)) ||
|
||||
!(pref->flags & PREF_HAS_DEFAULT))) {
|
||||
sourcePref = &pref->userPref;
|
||||
} else {
|
||||
if (argData->saveTypes == SAVE_ALL_AND_DEFAULTS) {
|
||||
@ -523,7 +521,7 @@ nsresult PREF_GetIntPref(const char *pref_name,PRInt32 * return_int, PRBool get_
|
||||
{
|
||||
PRInt32 tempInt = pref->defaultPref.intVal;
|
||||
/* check to see if we even had a default */
|
||||
if (tempInt == ((PRInt32) BOGUS_DEFAULT_INT_PREF_VALUE))
|
||||
if (!(pref->flags & PREF_HAS_DEFAULT))
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
*return_int = tempInt;
|
||||
}
|
||||
@ -548,7 +546,7 @@ nsresult PREF_GetBoolPref(const char *pref_name, PRBool * return_value, PRBool g
|
||||
{
|
||||
PRBool tempBool = pref->defaultPref.boolVal;
|
||||
/* check to see if we even had a default */
|
||||
if (tempBool != ((PRBool) BOGUS_DEFAULT_BOOL_PREF_VALUE)) {
|
||||
if (pref->flags & PREF_HAS_DEFAULT) {
|
||||
*return_value = tempBool;
|
||||
rv = NS_OK;
|
||||
}
|
||||
@ -614,11 +612,7 @@ PREF_ClearUserPref(const char *pref_name)
|
||||
{
|
||||
pref->flags &= ~PREF_USERSET;
|
||||
|
||||
if ((pref->flags & PREF_INT &&
|
||||
pref->defaultPref.intVal == ((PRInt32) BOGUS_DEFAULT_INT_PREF_VALUE)) ||
|
||||
(pref->flags & PREF_BOOL &&
|
||||
pref->defaultPref.boolVal == ((PRBool) BOGUS_DEFAULT_BOOL_PREF_VALUE)) ||
|
||||
(pref->flags & PREF_STRING && !pref->defaultPref.stringVal)) {
|
||||
if (!(pref->flags & PREF_HAS_DEFAULT)) {
|
||||
PL_DHashTableOperate(&gHashTable, pref_name, PL_DHASH_REMOVE);
|
||||
}
|
||||
|
||||
@ -640,11 +634,7 @@ pref_ClearUserPref(PLDHashTable *table, PLDHashEntryHdr *he, PRUint32,
|
||||
{
|
||||
pref->flags &= ~PREF_USERSET;
|
||||
|
||||
if ((pref->flags & PREF_INT &&
|
||||
pref->defaultPref.intVal == ((PRInt32) BOGUS_DEFAULT_INT_PREF_VALUE)) ||
|
||||
(pref->flags & PREF_BOOL &&
|
||||
pref->defaultPref.boolVal == ((PRBool) BOGUS_DEFAULT_BOOL_PREF_VALUE)) ||
|
||||
(pref->flags & PREF_STRING && !pref->defaultPref.stringVal)) {
|
||||
if (!(pref->flags & PREF_HAS_DEFAULT)) {
|
||||
nextOp = PL_DHASH_REMOVE;
|
||||
}
|
||||
|
||||
@ -757,15 +747,6 @@ nsresult pref_HashPref(const char *key, PrefValue value, PrefType type, PRBool s
|
||||
pref->key = ArenaStrDup(key, &gPrefNameArena);
|
||||
memset(&pref->defaultPref, 0, sizeof(pref->defaultPref));
|
||||
memset(&pref->userPref, 0, sizeof(pref->userPref));
|
||||
|
||||
/* ugly hack -- define it to a default that no pref will ever
|
||||
default to this should really get fixed right by some out
|
||||
of band data
|
||||
*/
|
||||
if (pref->flags & PREF_BOOL)
|
||||
pref->defaultPref.boolVal = (PRBool) BOGUS_DEFAULT_BOOL_PREF_VALUE;
|
||||
if (pref->flags & PREF_INT)
|
||||
pref->defaultPref.intVal = (PRInt32) BOGUS_DEFAULT_INT_PREF_VALUE;
|
||||
}
|
||||
else if ((((PrefType)(pref->flags)) & PREF_VALUETYPE_MASK) !=
|
||||
(type & PREF_VALUETYPE_MASK))
|
||||
@ -779,9 +760,11 @@ nsresult pref_HashPref(const char *key, PrefValue value, PrefType type, PRBool s
|
||||
{
|
||||
if (!PREF_IS_LOCKED(pref))
|
||||
{ /* ?? change of semantics? */
|
||||
if (pref_ValueChanged(pref->defaultPref, value, type))
|
||||
if (pref_ValueChanged(pref->defaultPref, value, type) ||
|
||||
!(pref->flags & PREF_HAS_DEFAULT))
|
||||
{
|
||||
pref_SetValue(&pref->defaultPref, value, type);
|
||||
pref->flags |= PREF_HAS_DEFAULT;
|
||||
if (!PREF_HAS_USER_VALUE(pref))
|
||||
valueChanged = PR_TRUE;
|
||||
}
|
||||
@ -791,7 +774,8 @@ nsresult pref_HashPref(const char *key, PrefValue value, PrefType type, PRBool s
|
||||
{
|
||||
/* If new value is same as the default value, then un-set the user value.
|
||||
Otherwise, set the user value only if it has changed */
|
||||
if ( !pref_ValueChanged(pref->defaultPref, value, type) )
|
||||
if (!pref_ValueChanged(pref->defaultPref, value, type) &&
|
||||
pref->flags & PREF_HAS_DEFAULT)
|
||||
{
|
||||
if (PREF_HAS_USER_VALUE(pref))
|
||||
{
|
||||
|
@ -58,7 +58,7 @@ struct PrefHashEntry : PLDHashEntryHdr
|
||||
const char *key;
|
||||
PrefValue defaultPref;
|
||||
PrefValue userPref;
|
||||
PRUint8 flags;
|
||||
PRUint16 flags;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -85,6 +85,7 @@ void PREF_CleanupPrefs();
|
||||
typedef enum { PREF_INVALID = 0,
|
||||
PREF_LOCKED = 1, PREF_USERSET = 2, PREF_CONFIG = 4, PREF_REMOTE = 8,
|
||||
PREF_LILOCAL = 16, PREF_STRING = 32, PREF_INT = 64, PREF_BOOL = 128,
|
||||
PREF_HAS_DEFAULT = 256,
|
||||
PREF_VALUETYPE_MASK = (PREF_STRING | PREF_INT | PREF_BOOL)
|
||||
} PrefType;
|
||||
|
||||
|
@ -45,7 +45,6 @@
|
||||
*
|
||||
* http://host/directory/fileBaseName.fileExtension?query
|
||||
* http://host/directory/fileBaseName.fileExtension#ref
|
||||
* http://host/directory/fileBaseName.fileExtension;param
|
||||
* \ \ /
|
||||
* \ -----------------------
|
||||
* \ | /
|
||||
@ -70,13 +69,6 @@ interface nsIURL : nsIURI
|
||||
*/
|
||||
attribute AUTF8String filePath;
|
||||
|
||||
/**
|
||||
* Returns the parameters specified after the ; in the URL.
|
||||
*
|
||||
* Some characters may be escaped.
|
||||
*/
|
||||
attribute AUTF8String param;
|
||||
|
||||
/**
|
||||
* Returns the query portion (the part after the "?") of the URL.
|
||||
* If there isn't one, an empty string is returned.
|
||||
|
@ -95,14 +95,13 @@ interface nsIURLParser : nsISupports
|
||||
out long port);
|
||||
|
||||
/**
|
||||
* ParsePath breaks the path string up into its 4 major components: a file path,
|
||||
* a param string, a query string, and a reference string.
|
||||
* ParsePath breaks the path string up into its 3 major components: a file path,
|
||||
* a query string, and a reference string.
|
||||
*
|
||||
* path = <filepath>;<param>?<query>#<ref>
|
||||
* path = <filepath>?<query>#<ref>
|
||||
*/
|
||||
void parsePath (in string path, in long pathLen,
|
||||
out unsigned long filepathPos, out long filepathLen,
|
||||
out unsigned long paramPos, out long paramLen,
|
||||
out unsigned long queryPos, out long queryLen,
|
||||
out unsigned long refPos, out long refLen);
|
||||
|
||||
|
@ -400,7 +400,6 @@ nsStandardURL::Clear()
|
||||
mBasename.Reset();
|
||||
|
||||
mExtension.Reset();
|
||||
mParam.Reset();
|
||||
mQuery.Reset();
|
||||
mRef.Reset();
|
||||
|
||||
@ -511,16 +510,16 @@ nsStandardURL::BuildNormalizedSpec(const char *spec)
|
||||
// buffers for holding escaped url segments (these will remain empty unless
|
||||
// escaping is required).
|
||||
nsCAutoString encUsername, encPassword, encHost, encDirectory,
|
||||
encBasename, encExtension, encParam, encQuery, encRef;
|
||||
encBasename, encExtension, encQuery, encRef;
|
||||
PRBool useEncUsername, useEncPassword, useEncHost, useEncDirectory,
|
||||
useEncBasename, useEncExtension, useEncParam, useEncQuery, useEncRef;
|
||||
useEncBasename, useEncExtension, useEncQuery, useEncRef;
|
||||
nsCAutoString portbuf;
|
||||
|
||||
//
|
||||
// escape each URL segment, if necessary, and calculate approximate normalized
|
||||
// spec length.
|
||||
//
|
||||
// [scheme://][username[:password]@]host[:port]/path[;param][?query_string][#ref]
|
||||
// [scheme://][username[:password]@]host[:port]/path[?query_string][#ref]
|
||||
|
||||
PRUint32 approxLen = 0;
|
||||
|
||||
@ -556,9 +555,6 @@ nsStandardURL::BuildNormalizedSpec(const char *spec)
|
||||
|
||||
// These next ones *always* add their leading character even if length is 0
|
||||
// Handles items like "http://#"
|
||||
// ;param
|
||||
if (mParam.mLen >= 0)
|
||||
approxLen += 1 + encoder.EncodeSegmentCount(spec, mParam, esc_Param, encParam, useEncParam);
|
||||
// ?query
|
||||
if (mQuery.mLen >= 0)
|
||||
approxLen += 1 + queryEncoder.EncodeSegmentCount(spec, mQuery, esc_Query, encQuery, useEncQuery);
|
||||
@ -678,10 +674,6 @@ nsStandardURL::BuildNormalizedSpec(const char *spec)
|
||||
// calculate corrected filepath length
|
||||
mFilepath.mLen = i - mFilepath.mPos;
|
||||
|
||||
if (mParam.mLen >= 0) {
|
||||
buf[i++] = ';';
|
||||
i = AppendSegmentToBuf(buf, i, spec, mParam, &encParam, useEncParam);
|
||||
}
|
||||
if (mQuery.mLen >= 0) {
|
||||
buf[i++] = '?';
|
||||
i = AppendSegmentToBuf(buf, i, spec, mQuery, &encQuery, useEncQuery);
|
||||
@ -838,13 +830,11 @@ nsStandardURL::ParsePath(const char *spec, PRUint32 pathPos, PRInt32 pathLen)
|
||||
|
||||
nsresult rv = mParser->ParsePath(spec + pathPos, pathLen,
|
||||
&mFilepath.mPos, &mFilepath.mLen,
|
||||
&mParam.mPos, &mParam.mLen,
|
||||
&mQuery.mPos, &mQuery.mLen,
|
||||
&mRef.mPos, &mRef.mLen);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
mFilepath.mPos += pathPos;
|
||||
mParam.mPos += pathPos;
|
||||
mQuery.mPos += pathPos;
|
||||
mRef.mPos += pathPos;
|
||||
|
||||
@ -1208,7 +1198,6 @@ nsStandardURL::SetSpec(const nsACString &input)
|
||||
LOG((" directory = (%u,%d)\n", mDirectory.mPos, mDirectory.mLen));
|
||||
LOG((" basename = (%u,%d)\n", mBasename.mPos, mBasename.mLen));
|
||||
LOG((" extension = (%u,%d)\n", mExtension.mPos, mExtension.mLen));
|
||||
LOG((" param = (%u,%d)\n", mParam.mPos, mParam.mLen));
|
||||
LOG((" query = (%u,%d)\n", mQuery.mPos, mQuery.mLen));
|
||||
LOG((" ref = (%u,%d)\n", mRef.mPos, mRef.mLen));
|
||||
}
|
||||
@ -1633,7 +1622,6 @@ nsStandardURL::SetPath(const nsACString &input)
|
||||
// these are no longer defined
|
||||
mBasename.mLen = -1;
|
||||
mExtension.mLen = -1;
|
||||
mParam.mLen = -1;
|
||||
mQuery.mLen = -1;
|
||||
mRef.mLen = -1;
|
||||
}
|
||||
@ -1684,8 +1672,7 @@ nsStandardURL::EqualsInternal(nsIURI *unknownOther,
|
||||
!SegmentIs(mQuery, other->mSpec.get(), other->mQuery) ||
|
||||
!SegmentIs(mUsername, other->mSpec.get(), other->mUsername) ||
|
||||
!SegmentIs(mPassword, other->mSpec.get(), other->mPassword) ||
|
||||
Port() != other->Port() ||
|
||||
!SegmentIs(mParam, other->mSpec.get(), other->mParam)) {
|
||||
Port() != other->Port()) {
|
||||
// No need to compare files or other URI parts -- these are different
|
||||
// beasties
|
||||
*result = PR_FALSE;
|
||||
@ -1795,7 +1782,6 @@ nsStandardURL::CloneInternal(nsStandardURL::RefHandlingEnum refHandlingMode,
|
||||
clone->mDirectory = mDirectory;
|
||||
clone->mBasename = mBasename;
|
||||
clone->mExtension = mExtension;
|
||||
clone->mParam = mParam;
|
||||
clone->mQuery = mQuery;
|
||||
clone->mRef = mRef;
|
||||
clone->mOriginCharset = mOriginCharset;
|
||||
@ -2020,7 +2006,7 @@ nsStandardURL::GetCommonBaseSpec(nsIURI *uri2, nsACString &aResult)
|
||||
|
||||
// backup to just after previous slash so we grab an appropriate path
|
||||
// segment such as a directory (not partial segments)
|
||||
// todo: also check for file matches which include '?', '#', and ';'
|
||||
// todo: also check for file matches which include '?' and '#'
|
||||
while ((thisIndex != startCharPos) && (*(thisIndex-1) != '/'))
|
||||
thisIndex--;
|
||||
|
||||
@ -2101,7 +2087,7 @@ nsStandardURL::GetRelativeSpec(nsIURI *uri2, nsACString &aResult)
|
||||
|
||||
// backup to just after previous slash so we grab an appropriate path
|
||||
// segment such as a directory (not partial segments)
|
||||
// todo: also check for file matches with '#', '?' and ';'
|
||||
// todo: also check for file matches with '#' and '?'
|
||||
while ((*(thatIndex-1) != '/') && (thatIndex != startCharPos))
|
||||
thatIndex--;
|
||||
|
||||
@ -2135,14 +2121,6 @@ nsStandardURL::GetFilePath(nsACString &result)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// result may contain unescaped UTF-8 characters
|
||||
NS_IMETHODIMP
|
||||
nsStandardURL::GetParam(nsACString &result)
|
||||
{
|
||||
result = Param();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// result may contain unescaped UTF-8 characters
|
||||
NS_IMETHODIMP
|
||||
nsStandardURL::GetQuery(nsACString &result)
|
||||
@ -2263,8 +2241,8 @@ nsStandardURL::SetFilePath(const nsACString &input)
|
||||
}
|
||||
else if (mPath.mLen > 1) {
|
||||
mSpec.Cut(mPath.mPos + 1, mFilepath.mLen - 1);
|
||||
// left shift param, query, and ref
|
||||
ShiftFromParam(1 - mFilepath.mLen);
|
||||
// left shift query, and ref
|
||||
ShiftFromQuery(1 - mFilepath.mLen);
|
||||
// these contain only a '/'
|
||||
mPath.mLen = 1;
|
||||
mDirectory.mLen = 1;
|
||||
@ -2276,13 +2254,6 @@ nsStandardURL::SetFilePath(const nsACString &input)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStandardURL::SetParam(const nsACString &input)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStandardURL::SetQuery(const nsACString &input)
|
||||
{
|
||||
@ -2503,7 +2474,7 @@ nsStandardURL::SetFileName(const nsACString &input)
|
||||
}
|
||||
}
|
||||
if (shift) {
|
||||
ShiftFromParam(shift);
|
||||
ShiftFromQuery(shift);
|
||||
mFilepath.mLen += shift;
|
||||
mPath.mLen += shift;
|
||||
}
|
||||
@ -2800,9 +2771,6 @@ nsStandardURL::Read(nsIObjectInputStream *stream)
|
||||
rv = ReadSegment(stream, mExtension);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = ReadSegment(stream, mParam);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = ReadSegment(stream, mQuery);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
@ -2889,9 +2857,6 @@ nsStandardURL::Write(nsIObjectOutputStream *stream)
|
||||
rv = WriteSegment(stream, mExtension);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = WriteSegment(stream, mParam);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = WriteSegment(stream, mQuery);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
@ -2964,7 +2929,6 @@ nsStandardURL::Read(const IPC::Message *aMsg, void **aIter)
|
||||
!ReadSegment(aMsg, aIter, mDirectory) ||
|
||||
!ReadSegment(aMsg, aIter, mBasename) ||
|
||||
!ReadSegment(aMsg, aIter, mExtension) ||
|
||||
!ReadSegment(aMsg, aIter, mParam) ||
|
||||
!ReadSegment(aMsg, aIter, mQuery) ||
|
||||
!ReadSegment(aMsg, aIter, mRef) ||
|
||||
!ReadParam(aMsg, aIter, &mOriginCharset) ||
|
||||
@ -3005,7 +2969,6 @@ nsStandardURL::Write(IPC::Message *aMsg)
|
||||
WriteSegment(aMsg, mDirectory);
|
||||
WriteSegment(aMsg, mBasename);
|
||||
WriteSegment(aMsg, mExtension);
|
||||
WriteSegment(aMsg, mParam);
|
||||
WriteSegment(aMsg, mQuery);
|
||||
WriteSegment(aMsg, mRef);
|
||||
WriteParam(aMsg, mOriginCharset);
|
||||
|
@ -223,7 +223,6 @@ private:
|
||||
const nsDependentCSubstring Filename(); // see below
|
||||
const nsDependentCSubstring Basename() { return Segment(mBasename); }
|
||||
const nsDependentCSubstring Extension() { return Segment(mExtension); }
|
||||
const nsDependentCSubstring Param() { return Segment(mParam); }
|
||||
const nsDependentCSubstring Query() { return Segment(mQuery); }
|
||||
const nsDependentCSubstring Ref() { return Segment(mRef); }
|
||||
|
||||
@ -236,8 +235,7 @@ private:
|
||||
void ShiftFromFilepath(PRInt32 diff) { mFilepath.mPos += diff; ShiftFromDirectory(diff); }
|
||||
void ShiftFromDirectory(PRInt32 diff) { mDirectory.mPos += diff; ShiftFromBasename(diff); }
|
||||
void ShiftFromBasename(PRInt32 diff) { mBasename.mPos += diff; ShiftFromExtension(diff); }
|
||||
void ShiftFromExtension(PRInt32 diff) { mExtension.mPos += diff; ShiftFromParam(diff); }
|
||||
void ShiftFromParam(PRInt32 diff) { mParam.mPos += diff; ShiftFromQuery(diff); }
|
||||
void ShiftFromExtension(PRInt32 diff) { mExtension.mPos += diff; ShiftFromQuery(diff); }
|
||||
void ShiftFromQuery(PRInt32 diff) { mQuery.mPos += diff; ShiftFromRef(diff); }
|
||||
void ShiftFromRef(PRInt32 diff) { mRef.mPos += diff; }
|
||||
|
||||
@ -267,7 +265,6 @@ private:
|
||||
URLSegment mDirectory;
|
||||
URLSegment mBasename;
|
||||
URLSegment mExtension;
|
||||
URLSegment mParam;
|
||||
URLSegment mQuery;
|
||||
URLSegment mRef;
|
||||
|
||||
|
@ -221,7 +221,6 @@ net_ParseFileURL(const nsACString &inURL,
|
||||
// invoke the parser to extract filepath from the path
|
||||
rv = parser->ParsePath(url + pathPos, pathLen,
|
||||
&filepathPos, &filepathLen,
|
||||
nsnull, nsnull, // don't care about param
|
||||
nsnull, nsnull, // don't care about query
|
||||
nsnull, nsnull); // don't care about ref
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -451,7 +450,6 @@ net_ResolveRelativePath(const nsACString &relativePath,
|
||||
switch (c) {
|
||||
case '\0':
|
||||
case '#':
|
||||
case ';':
|
||||
case '?':
|
||||
stop = PR_TRUE;
|
||||
// fall through...
|
||||
|
@ -117,7 +117,6 @@ nsBaseURLParser::ParseURL(const char *spec, PRInt32 specLen,
|
||||
case '/': // start of filepath
|
||||
case '?': // start of query
|
||||
case '#': // start of ref
|
||||
case ';': // start of param
|
||||
if (!slash)
|
||||
slash = p;
|
||||
break;
|
||||
@ -240,7 +239,6 @@ nsBaseURLParser::ParseServerInfo(const char *serverinfo, PRInt32 serverinfoLen,
|
||||
NS_IMETHODIMP
|
||||
nsBaseURLParser::ParsePath(const char *path, PRInt32 pathLen,
|
||||
PRUint32 *filepathPos, PRInt32 *filepathLen,
|
||||
PRUint32 *paramPos, PRInt32 *paramLen,
|
||||
PRUint32 *queryPos, PRInt32 *queryLen,
|
||||
PRUint32 *refPos, PRInt32 *refLen)
|
||||
{
|
||||
@ -249,7 +247,7 @@ nsBaseURLParser::ParsePath(const char *path, PRInt32 pathLen,
|
||||
if (pathLen < 0)
|
||||
pathLen = strlen(path);
|
||||
|
||||
// path = [/]<segment1>/<segment2>/<...>/<segmentN>;<param>?<query>#<ref>
|
||||
// path = [/]<segment1>/<segment2>/<...>/<segmentN>?<query>#<ref>
|
||||
|
||||
// XXX PL_strnpbrk would be nice, but it's buggy
|
||||
|
||||
@ -283,8 +281,6 @@ nsBaseURLParser::ParsePath(const char *path, PRInt32 pathLen,
|
||||
else
|
||||
SET_RESULT(ref, 0, -1);
|
||||
|
||||
// search backwards for param
|
||||
const char *param_beg = 0;
|
||||
const char *end;
|
||||
if (query_beg)
|
||||
end = query_beg - 1;
|
||||
@ -292,20 +288,6 @@ nsBaseURLParser::ParsePath(const char *path, PRInt32 pathLen,
|
||||
end = ref_beg - 1;
|
||||
else
|
||||
end = path + pathLen;
|
||||
for (p = end - 1; p >= path && *p != '/'; --p) {
|
||||
if (*p == ';') {
|
||||
// found param
|
||||
param_beg = p + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (param_beg) {
|
||||
// found <filepath>;<param>
|
||||
SET_RESULT(param, param_beg - path, end - param_beg);
|
||||
end = param_beg - 1;
|
||||
}
|
||||
else
|
||||
SET_RESULT(param, 0, -1);
|
||||
|
||||
// an empty file path is no file path
|
||||
if (end != path)
|
||||
@ -437,7 +419,7 @@ nsNoAuthURLParser::ParseAfterScheme(const char *spec, PRInt32 specLen,
|
||||
#endif
|
||||
// Ignore apparent authority; path is everything after it
|
||||
for (p = spec + 2; p < spec + specLen; ++p) {
|
||||
if (*p == '/' || *p == '?' || *p == '#' || *p == ';')
|
||||
if (*p == '/' || *p == '?' || *p == '#')
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -667,7 +649,7 @@ nsAuthURLParser::ParseAfterScheme(const char *spec, PRInt32 specLen,
|
||||
const char *end = spec + specLen;
|
||||
const char *p;
|
||||
for (p = spec + nslash; p < end; ++p) {
|
||||
if (*p == '/' || *p == '?' || *p == '#' || *p == ';')
|
||||
if (*p == '/' || *p == '?' || *p == '#')
|
||||
break;
|
||||
}
|
||||
if (p < end) {
|
||||
|
@ -144,6 +144,48 @@ HttpChannelChild::ReleaseIPDLReference()
|
||||
Release();
|
||||
}
|
||||
|
||||
class AssociateApplicationCacheEvent : public ChannelEvent
|
||||
{
|
||||
public:
|
||||
AssociateApplicationCacheEvent(HttpChannelChild* child,
|
||||
const nsCString &groupID,
|
||||
const nsCString &clientID)
|
||||
: mChild(child)
|
||||
, groupID(groupID)
|
||||
, clientID(clientID) {}
|
||||
|
||||
void Run() { mChild->AssociateApplicationCache(groupID, clientID); }
|
||||
private:
|
||||
HttpChannelChild* mChild;
|
||||
nsCString groupID;
|
||||
nsCString clientID;
|
||||
};
|
||||
|
||||
bool
|
||||
HttpChannelChild::RecvAssociateApplicationCache(const nsCString &groupID,
|
||||
const nsCString &clientID)
|
||||
{
|
||||
if (mEventQ.ShouldEnqueue()) {
|
||||
mEventQ.Enqueue(new AssociateApplicationCacheEvent(this, groupID, clientID));
|
||||
} else {
|
||||
AssociateApplicationCache(groupID, clientID);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
HttpChannelChild::AssociateApplicationCache(const nsCString &groupID,
|
||||
const nsCString &clientID)
|
||||
{
|
||||
nsresult rv;
|
||||
mApplicationCache = do_CreateInstance(NS_APPLICATIONCACHE_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv))
|
||||
return;
|
||||
|
||||
mLoadedFromApplicationCache = PR_TRUE;
|
||||
mApplicationCache->InitAsHandle(groupID, clientID);
|
||||
}
|
||||
|
||||
class StartRequestEvent : public ChannelEvent
|
||||
{
|
||||
public:
|
||||
@ -192,21 +234,6 @@ class StartRequestEvent : public ChannelEvent
|
||||
PRNetAddr mPeerAddr;
|
||||
};
|
||||
|
||||
bool
|
||||
HttpChannelChild::RecvAssociateApplicationCache(const nsCString &groupID,
|
||||
const nsCString &clientID)
|
||||
{
|
||||
nsresult rv;
|
||||
mApplicationCache = do_CreateInstance(
|
||||
NS_APPLICATIONCACHE_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv))
|
||||
return true;
|
||||
|
||||
mLoadedFromApplicationCache = PR_TRUE;
|
||||
mApplicationCache->InitAsHandle(groupID, clientID);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
HttpChannelChild::RecvOnStartRequest(const nsHttpResponseHead& responseHead,
|
||||
const PRBool& useResponseHead,
|
||||
|
@ -173,6 +173,8 @@ private:
|
||||
bool mKeptAlive;
|
||||
ChannelEventQueue mEventQ;
|
||||
|
||||
void AssociateApplicationCache(const nsCString &groupID,
|
||||
const nsCString &clientID);
|
||||
void OnStartRequest(const nsHttpResponseHead& responseHead,
|
||||
const PRBool& useResponseHead,
|
||||
const RequestHeaderTuples& requestHeaders,
|
||||
@ -204,6 +206,7 @@ private:
|
||||
// Called asynchronously from Resume: continues any pending calls into client.
|
||||
void CompleteResume();
|
||||
|
||||
friend class AssociateApplicationCacheEvent;
|
||||
friend class StartRequestEvent;
|
||||
friend class StopRequestEvent;
|
||||
friend class TransportAndDataEvent;
|
||||
|
@ -70,18 +70,16 @@ parse_path(nsIURLParser *urlParser, char *path, PRInt32 pathLen)
|
||||
{
|
||||
PRINT_FIELD(path);
|
||||
|
||||
PRUint32 filePos, paramPos, queryPos, refPos;
|
||||
PRInt32 fileLen, paramLen, queryLen, refLen;
|
||||
PRUint32 filePos, queryPos, refPos;
|
||||
PRInt32 fileLen, queryLen, refLen;
|
||||
|
||||
urlParser->ParsePath(path, pathLen,
|
||||
&filePos, &fileLen,
|
||||
¶mPos, ¶mLen,
|
||||
&queryPos, &queryLen,
|
||||
&refPos, &refLen);
|
||||
|
||||
if (fileLen != -1)
|
||||
parse_file_path(urlParser, path + filePos, fileLen);
|
||||
PRINT_SUBFIELD(path, param);
|
||||
PRINT_SUBFIELD(path, query);
|
||||
PRINT_SUBFIELD(path, ref);
|
||||
}
|
||||
|
@ -14,9 +14,12 @@ function run_test() {
|
||||
uri2.spec = "http://example.com/?bar";
|
||||
do_check_true(uri1.equals(uri2));
|
||||
|
||||
// see https://bugzilla.mozilla.org/show_bug.cgi?id=665706
|
||||
// ";" is not parsed as special anymore and thus ends up
|
||||
// in the authority component (see RFC 3986)
|
||||
uri1.spec = "http://example.com;bar";
|
||||
uri2.spec = "http://example.com/;bar";
|
||||
do_check_true(uri1.equals(uri2));
|
||||
do_check_false(uri1.equals(uri2));
|
||||
|
||||
uri1.spec = "http://example.com#";
|
||||
uri2.spec = "http://example.com/#";
|
||||
@ -26,9 +29,12 @@ function run_test() {
|
||||
uri2.spec = "http://example.com/?";
|
||||
do_check_true(uri1.equals(uri2));
|
||||
|
||||
// see https://bugzilla.mozilla.org/show_bug.cgi?id=665706
|
||||
// ";" is not parsed as special anymore and thus ends up
|
||||
// in the authority component (see RFC 3986)
|
||||
uri1.spec = "http://example.com;";
|
||||
uri2.spec = "http://example.com/;";
|
||||
do_check_true(uri1.equals(uri2));
|
||||
do_check_false(uri1.equals(uri2));
|
||||
|
||||
uri1.spec = "http://example.com";
|
||||
uri2.spec = "http://example.com/";
|
||||
|
@ -137,8 +137,9 @@ nsresult writeoutto(const char* i_pURL, char** o_Result, PRInt32 urlFactory = UR
|
||||
rv = tURL->GetFileExtension(temp);
|
||||
output += RESULT();
|
||||
output += ',';
|
||||
rv = tURL->GetParam(temp);
|
||||
output += RESULT();
|
||||
// removed with https://bugzilla.mozilla.org/show_bug.cgi?id=665706
|
||||
// rv = tURL->GetParam(temp);
|
||||
// output += RESULT();
|
||||
output += ',';
|
||||
rv = tURL->GetQuery(temp);
|
||||
output += RESULT();
|
||||
|
@ -140,7 +140,7 @@ nsHtml5TreeOperation::~nsHtml5TreeOperation()
|
||||
|
||||
nsresult
|
||||
nsHtml5TreeOperation::AppendTextToTextNode(const PRUnichar* aBuffer,
|
||||
PRInt32 aLength,
|
||||
PRUint32 aLength,
|
||||
nsIContent* aTextNode,
|
||||
nsHtml5TreeOpExecutor* aBuilder)
|
||||
{
|
||||
@ -172,7 +172,7 @@ nsHtml5TreeOperation::AppendTextToTextNode(const PRUnichar* aBuffer,
|
||||
|
||||
nsresult
|
||||
nsHtml5TreeOperation::AppendText(const PRUnichar* aBuffer,
|
||||
PRInt32 aLength,
|
||||
PRUint32 aLength,
|
||||
nsIContent* aParent,
|
||||
nsHtml5TreeOpExecutor* aBuilder)
|
||||
{
|
||||
@ -496,7 +496,7 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
|
||||
case eTreeOpAppendText: {
|
||||
nsIContent* parent = *mOne.node;
|
||||
PRUnichar* buffer = mTwo.unicharPtr;
|
||||
PRInt32 length = mInt;
|
||||
PRUint32 length = mInt;
|
||||
return AppendText(buffer, length, parent, aBuilder);
|
||||
}
|
||||
case eTreeOpAppendIsindexPrompt: {
|
||||
@ -518,7 +518,7 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
|
||||
case eTreeOpFosterParentText: {
|
||||
nsIContent* stackParent = *mOne.node;
|
||||
PRUnichar* buffer = mTwo.unicharPtr;
|
||||
PRInt32 length = mInt;
|
||||
PRUint32 length = mInt;
|
||||
nsIContent* table = *mThree.node;
|
||||
|
||||
nsIContent* foster = table->GetParent();
|
||||
|
@ -317,12 +317,12 @@ class nsHtml5TreeOperation {
|
||||
private:
|
||||
|
||||
nsresult AppendTextToTextNode(const PRUnichar* aBuffer,
|
||||
PRInt32 aLength,
|
||||
PRUint32 aLength,
|
||||
nsIContent* aTextNode,
|
||||
nsHtml5TreeOpExecutor* aBuilder);
|
||||
|
||||
nsresult AppendText(const PRUnichar* aBuffer,
|
||||
PRInt32 aLength,
|
||||
PRUint32 aLength,
|
||||
nsIContent* aParent,
|
||||
nsHtml5TreeOpExecutor* aBuilder);
|
||||
|
||||
|
@ -162,6 +162,7 @@ HistoryStore.prototype = {
|
||||
|
||||
get _visitStm() {
|
||||
return this._getStmt(
|
||||
"/* do not warn (bug 599936) */ " +
|
||||
"SELECT visit_type type, visit_date date " +
|
||||
"FROM moz_historyvisits " +
|
||||
"WHERE place_id = (SELECT id FROM moz_places WHERE url = :url) " +
|
||||
|
@ -259,7 +259,7 @@ WrapAndReturnHistogram(Histogram *h, JSContext *cx, jsval *ret)
|
||||
}
|
||||
|
||||
TelemetryImpl::TelemetryImpl():
|
||||
mCanRecord(true)
|
||||
mCanRecord(XRE_GetProcessType() == GeckoProcessType_Default)
|
||||
{
|
||||
mHistogramMap.Init(Telemetry::HistogramCount);
|
||||
}
|
||||
|
@ -42,6 +42,9 @@
|
||||
* HISTOGRAM(id, minimum, maximum, bucket count, histogram kind,
|
||||
* human-readable description for about:telemetry)
|
||||
*
|
||||
* This file is the master list of telemetry histograms reported to Mozilla servers.
|
||||
* The other data reported by telemetry is listed on https://wiki.mozilla.org/Privacy/Reviews/Telemetry/Measurements
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -163,7 +163,9 @@ public:
|
||||
|
||||
enum {
|
||||
DRAW_ERROR = 0,
|
||||
DRAW_GLES_2 = 1
|
||||
DRAW_GLES_2 = 1,
|
||||
DRAW_2D = 2,
|
||||
DRAW_DISABLED = 3
|
||||
};
|
||||
|
||||
int BeginDrawing();
|
||||
|
@ -45,7 +45,10 @@ NS_IMPL_ISUPPORTS1(nsFilePicker, nsIFilePicker)
|
||||
NS_IMETHODIMP nsFilePicker::Init(nsIDOMWindow *parent, const nsAString& title,
|
||||
PRInt16 mode)
|
||||
{
|
||||
return nsIFilePicker::modeOpen == mode ? NS_OK : NS_ERROR_NOT_IMPLEMENTED;
|
||||
return (mode == nsIFilePicker::modeOpen ||
|
||||
mode == nsIFilePicker::modeOpenMultiple)
|
||||
? NS_OK
|
||||
: NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsFilePicker::AppendFilter(const nsAString& /*title*/,
|
||||
|
@ -1050,6 +1050,10 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae)
|
||||
} else {
|
||||
int drawType = sview.BeginDrawing();
|
||||
|
||||
if (drawType == AndroidGeckoSurfaceView::DRAW_DISABLED) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (drawType == AndroidGeckoSurfaceView::DRAW_ERROR) {
|
||||
ALOG("##### BeginDrawing failed!");
|
||||
return;
|
||||
|
@ -127,12 +127,8 @@ hashEnumerate(PLDHashTable* table, PLDHashEntryHdr* hdr, PRUint32 i, void *arg)
|
||||
_HashEnumerateArgs* thunk = (_HashEnumerateArgs*)arg;
|
||||
HTEntry* entry = static_cast<HTEntry*>(hdr);
|
||||
|
||||
switch (thunk->fn(entry->key, entry->value, thunk->arg)) {
|
||||
case kHashEnumerateNext:
|
||||
if (thunk->fn(entry->key, entry->value, thunk->arg))
|
||||
return PL_DHASH_NEXT;
|
||||
case kHashEnumerateRemove:
|
||||
return PL_DHASH_REMOVE;
|
||||
}
|
||||
return PL_DHASH_STOP;
|
||||
}
|
||||
|
||||
|
@ -109,11 +109,10 @@ class nsHashKey {
|
||||
// Return values for nsHashtableEnumFunc
|
||||
enum {
|
||||
kHashEnumerateStop = PR_FALSE,
|
||||
kHashEnumerateNext = PR_TRUE,
|
||||
kHashEnumerateRemove = 2
|
||||
kHashEnumerateNext = PR_TRUE
|
||||
};
|
||||
|
||||
typedef PRIntn
|
||||
typedef PRBool
|
||||
(* nsHashtableEnumFunc)(nsHashKey *aKey, void *aData, void* aClosure);
|
||||
|
||||
typedef nsresult
|
||||
@ -196,8 +195,6 @@ class nsSupportsHashtable
|
||||
: private nsHashtable
|
||||
{
|
||||
public:
|
||||
typedef PRBool (* EnumFunc) (nsHashKey *aKey, void *aData, void* aClosure);
|
||||
|
||||
nsSupportsHashtable(PRUint32 aSize = 16, PRBool threadSafe = PR_FALSE)
|
||||
: nsHashtable(aSize, threadSafe) {}
|
||||
~nsSupportsHashtable();
|
||||
@ -214,7 +211,7 @@ class nsSupportsHashtable
|
||||
nsISupports* Get(nsHashKey *aKey);
|
||||
PRBool Remove(nsHashKey *aKey, nsISupports **value = nsnull);
|
||||
nsHashtable *Clone();
|
||||
void Enumerate(EnumFunc aEnumFunc, void* aClosure = NULL) {
|
||||
void Enumerate(nsHashtableEnumFunc aEnumFunc, void* aClosure = NULL) {
|
||||
nsHashtable::Enumerate(aEnumFunc, aClosure);
|
||||
}
|
||||
void Reset();
|
||||
|
@ -353,7 +353,7 @@ const int EscapeChars[256] =
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 1x */
|
||||
0,1023, 0, 512,1023, 0,1023, 0,1023,1023,1023,1023,1023,1023, 953, 784, /* 2x !"#$%&'()*+,-./ */
|
||||
1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1008, 912, 0,1008, 0, 768, /* 3x 0123456789:;<=>? */
|
||||
1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1008,1008, 0,1008, 0, 768, /* 3x 0123456789:;<=>? */
|
||||
1008,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023, /* 4x @ABCDEFGHIJKLMNO */
|
||||
1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023, 896, 896, 896, 896,1023, /* 5x PQRSTUVWXYZ[\]^_ */
|
||||
0,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023, /* 6x `abcdefghijklmno */
|
||||
|
Loading…
Reference in New Issue
Block a user