diff --git a/browser/devtools/styleinspector/CssRuleView.jsm b/browser/devtools/styleinspector/CssRuleView.jsm index 9b523ee1d9de..50d28596b689 100644 --- a/browser/devtools/styleinspector/CssRuleView.jsm +++ b/browser/devtools/styleinspector/CssRuleView.jsm @@ -1271,7 +1271,7 @@ InplaceEditor.prototype = { // Replace spaces with non-breaking spaces. Otherwise setting // the span's textContent will collapse spaces and the measurement // will be wrong. - this._measurement.textContent = this.input.value.replace(' ', '\u00a0', 'g'); + this._measurement.textContent = this.input.value.replace(/ /g, '\u00a0'); // We add a bit of padding to the end. Should be enough to fit // any letter that could be typed, otherwise we'll scroll before diff --git a/build/macosx/mozconfig.leopard b/build/macosx/mozconfig.leopard index 64e834e882e1..2a20531945e8 100644 --- a/build/macosx/mozconfig.leopard +++ b/build/macosx/mozconfig.leopard @@ -29,4 +29,4 @@ fi # Note, the version (10) is used by libffi's configure. ac_add_options --target=i386-apple-darwin10 -ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.5.sdk +ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.6.sdk diff --git a/build/macosx/universal/mozconfig.common b/build/macosx/universal/mozconfig.common index c40642798077..7a0e4a473dea 100644 --- a/build/macosx/universal/mozconfig.common +++ b/build/macosx/universal/mozconfig.common @@ -42,8 +42,7 @@ mk_add_options MOZ_POSTFLIGHT_ALL+=build/macosx/universal/flight.mk ac_add_app_options i386 --target=i386-apple-darwin10 ac_add_app_options x86_64 --target=x86_64-apple-darwin10 -ac_add_app_options i386 --with-macos-sdk=/Developer/SDKs/MacOSX10.5.sdk -ac_add_app_options x86_64 --with-macos-sdk=/Developer/SDKs/MacOSX10.6.sdk +ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.6.sdk . $topsrcdir/build/macosx/common diff --git a/configure.in b/configure.in index f3e153cc9617..dfbdc396b015 100644 --- a/configure.in +++ b/configure.in @@ -566,6 +566,11 @@ if test -n "$CROSS_COMPILE" -a "$target" != "$host"; then AC_DEFINE(CROSS_COMPILE) else AC_PROG_CC + case "$target" in + *-mingw*) + # Work around the conftest.exe access problem on Windows + sleep 1 + esac AC_PROG_CXX AC_PROG_RANLIB MOZ_PATH_PROGS(AS, $AS as, $CC) diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index c6dfd5be2781..67123b86e777 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -1551,9 +1551,8 @@ nsGenericHTMLElement::GetPrimaryPresState(nsGenericHTMLElement* aContent, nsresult result = NS_OK; - nsCOMPtr history; nsCAutoString key; - GetLayoutHistoryAndKey(aContent, false, getter_AddRefs(history), key); + nsCOMPtr history = GetLayoutHistoryAndKey(aContent, false, key); if (history) { // Get the pres state for this key, if it doesn't exist, create one @@ -1568,10 +1567,9 @@ nsGenericHTMLElement::GetPrimaryPresState(nsGenericHTMLElement* aContent, } -nsresult +already_AddRefed nsGenericHTMLElement::GetLayoutHistoryAndKey(nsGenericHTMLElement* aContent, bool aRead, - nsILayoutHistoryState** aHistory, nsACString& aKey) { // @@ -1579,20 +1577,19 @@ nsGenericHTMLElement::GetLayoutHistoryAndKey(nsGenericHTMLElement* aContent, // nsCOMPtr doc = aContent->GetDocument(); if (!doc) { - return NS_OK; + return nsnull; } // // Get the history (don't bother with the key if the history is not there) // - *aHistory = doc->GetLayoutHistoryState().get(); - if (!*aHistory) { - return NS_OK; + nsCOMPtr history = doc->GetLayoutHistoryState(); + if (!history) { + return nsnull; } - if (aRead && !(*aHistory)->HasStates()) { - NS_RELEASE(*aHistory); - return NS_OK; + if (aRead && !history->HasStates()) { + return nsnull; } // @@ -1602,31 +1599,27 @@ nsGenericHTMLElement::GetLayoutHistoryAndKey(nsGenericHTMLElement* aContent, nsIStatefulFrame::eNoID, aKey); if (NS_FAILED(rv)) { - NS_RELEASE(*aHistory); - return rv; + return nsnull; } // If the state key is blank, this is anonymous content or for // whatever reason we are not supposed to save/restore state. if (aKey.IsEmpty()) { - NS_RELEASE(*aHistory); - return NS_OK; + return nsnull; } // Add something unique to content so layout doesn't muck us up aKey += "-C"; - return rv; + return history.forget(); } bool nsGenericHTMLElement::RestoreFormControlState(nsGenericHTMLElement* aContent, nsIFormControl* aControl) { - nsCOMPtr history; nsCAutoString key; - GetLayoutHistoryAndKey(aContent, true, - getter_AddRefs(history), key); + nsCOMPtr history = GetLayoutHistoryAndKey(aContent, true, key); if (!history) { return false; } diff --git a/content/html/content/src/nsGenericHTMLElement.h b/content/html/content/src/nsGenericHTMLElement.h index 8a6bdc4155fa..7e8a0c68f612 100644 --- a/content/html/content/src/nsGenericHTMLElement.h +++ b/content/html/content/src/nsGenericHTMLElement.h @@ -471,10 +471,10 @@ public: * @param aState the history state object (out param) * @param aKey the key (out param) */ - static nsresult GetLayoutHistoryAndKey(nsGenericHTMLElement* aContent, - bool aRead, - nsILayoutHistoryState** aState, - nsACString& aKey); + static already_AddRefed + GetLayoutHistoryAndKey(nsGenericHTMLElement* aContent, + bool aRead, + nsACString& aKey); /** * Restore the state for a form control. Ends up calling * nsIFormControl::RestoreState(). @@ -869,7 +869,7 @@ public: { return NS_OK; } - + virtual bool RestoreState(nsPresState* aState) { return false; diff --git a/dom/wifi/nsWifiWorker.js b/dom/wifi/nsWifiWorker.js index 14586abaddd6..32784a7e23b9 100644 --- a/dom/wifi/nsWifiWorker.js +++ b/dom/wifi/nsWifiWorker.js @@ -757,10 +757,10 @@ var WifiManager = (function() { } function ipToString(n) { - return String((n & (0xff << 24)) >> 24) + "." + - ((n & (0xff << 16)) >> 16) + "." + - ((n & (0xff << 8)) >> 8) + "." + - ((n & (0xff << 0)) >> 0); + return String((n >> 0) & 0xFF) + "." + + ((n >> 8) & 0xFF) + "." + + ((n >> 16) & 0xFF) + "." + + ((n >> 24) & 0xFF); } manager.enableNetwork = function(netId, disableOthers, callback) { diff --git a/editor/libeditor/base/crashtests/713427-1.html b/editor/libeditor/base/crashtests/713427-1.html new file mode 100644 index 000000000000..21da24693aad --- /dev/null +++ b/editor/libeditor/base/crashtests/713427-1.html @@ -0,0 +1,9 @@ + + +
+ + + +
+ + diff --git a/editor/libeditor/base/crashtests/713427-2.xhtml b/editor/libeditor/base/crashtests/713427-2.xhtml new file mode 100644 index 000000000000..b04a5d7736a2 --- /dev/null +++ b/editor/libeditor/base/crashtests/713427-2.xhtml @@ -0,0 +1,28 @@ + + + + + + + diff --git a/editor/libeditor/base/crashtests/crashtests.list b/editor/libeditor/base/crashtests/crashtests.list index 054f51183cf2..3bc98101d0aa 100644 --- a/editor/libeditor/base/crashtests/crashtests.list +++ b/editor/libeditor/base/crashtests/crashtests.list @@ -8,3 +8,5 @@ load 459613.html load 475132-1.xhtml asserts-if(!Android,1) load 633709.xhtml # Bug 695364 asserts-if(!Android,6) load 636074-1.html # Bug 439258, charged to the wrong test due to bug 635550 +load 713427-1.html +load 713427-2.xhtml diff --git a/editor/libeditor/base/nsEditor.cpp b/editor/libeditor/base/nsEditor.cpp index a0496f7782fe..ae368b0dee9b 100644 --- a/editor/libeditor/base/nsEditor.cpp +++ b/editor/libeditor/base/nsEditor.cpp @@ -3605,32 +3605,37 @@ IsElementVisible(dom::Element* aElement) nsIContent *cur = aElement; for (; ;) { + // Walk up the tree looking for the nearest ancestor with a frame. + // The state of the child right below it will determine whether + // we might possibly have a frame or not. + bool haveLazyBitOnChild = cur->HasFlag(NODE_NEEDS_FRAME); cur = cur->GetFlattenedTreeParent(); if (!cur) { - // None of our ancestors have lazy bits set, so we shouldn't have a frame - return false; + if (!haveLazyBitOnChild) { + // None of our ancestors have lazy bits set, so we shouldn't + // have a frame + return false; + } + + // The root has a lazy frame construction bit. We need to check + // our style. + break; } if (cur->GetPrimaryFrame()) { - // None of our ancestors up to the nearest ancestor with a frame have - // lazy bits; that means we won't get a frame - return false; - } - - if (cur->HasFlag(NODE_NEEDS_FRAME)) { - // Double-check that the parent doesn't have a leaf frame - nsIContent *parent = cur->GetFlattenedTreeParent(); - if (parent) { - NS_ASSERTION(parent->GetPrimaryFrame(), - "Why does our parent not have a frame?"); - if (parent->GetPrimaryFrame()->IsLeaf()) { - // No frame for us - return false; - } + if (!haveLazyBitOnChild) { + // Our ancestor directly under |cur| doesn't have lazy bits; + // that means we won't get a frame + return false; } - // |cur| will get a frame sometime. What does that mean for us? - // |We have to figure that out! + if (cur->GetPrimaryFrame()->IsLeaf()) { + // Nothing under here will ever get frames + return false; + } + + // Otherwise, we might end up with a frame when that lazy bit is + // processed. Figure out our actual style. break; } } diff --git a/gfx/thebes/gfxDWriteFontList.cpp b/gfx/thebes/gfxDWriteFontList.cpp index 3cab64ec363d..5c3c8dfca375 100644 --- a/gfx/thebes/gfxDWriteFontList.cpp +++ b/gfx/thebes/gfxDWriteFontList.cpp @@ -431,6 +431,36 @@ gfxDWriteFontEntry::CreateFontFace(IDWriteFontFace **aFontFace, HRESULT hr; if (mFont) { hr = mFont->CreateFontFace(aFontFace); + if (SUCCEEDED(hr) && (aSimulations & DWRITE_FONT_SIMULATIONS_BOLD) && + !((*aFontFace)->GetSimulations() & DWRITE_FONT_SIMULATIONS_BOLD)) { + // need to replace aFontFace with a version that has the Bold + // simulation - unfortunately, DWrite doesn't provide a simple API + // for this + nsRefPtr origFace = (*aFontFace); + (*aFontFace)->Release(); + *aFontFace = NULL; + UINT32 numberOfFiles = 0; + hr = origFace->GetFiles(&numberOfFiles, NULL); + if (FAILED(hr)) { + return NS_ERROR_FAILURE; + } + nsAutoTArray files; + files.AppendElements(numberOfFiles); + hr = origFace->GetFiles(&numberOfFiles, files.Elements()); + if (FAILED(hr)) { + return NS_ERROR_FAILURE; + } + hr = gfxWindowsPlatform::GetPlatform()->GetDWriteFactory()-> + CreateFontFace(origFace->GetType(), + numberOfFiles, + files.Elements(), + origFace->GetIndex(), + aSimulations, + aFontFace); + for (UINT32 i = 0; i < numberOfFiles; ++i) { + files[i]->Release(); + } + } } else if (mFontFile) { IDWriteFontFile *fontFile = mFontFile.get(); hr = gfxWindowsPlatform::GetPlatform()->GetDWriteFactory()-> diff --git a/js/src/jsinterp.h b/js/src/jsinterp.h index c26b412ba8f7..c4cf50081e6c 100644 --- a/js/src/jsinterp.h +++ b/js/src/jsinterp.h @@ -215,10 +215,8 @@ Execute(JSContext *cx, JSScript *script, JSObject &scopeChain, Value *rval); enum InterpMode { JSINTERP_NORMAL = 0, /* interpreter is running normally */ - JSINTERP_RECORD = 1, /* interpreter has been started to record/run traces */ - JSINTERP_PROFILE = 2, /* interpreter should profile a loop */ - JSINTERP_REJOIN = 3, /* as normal, but the frame has already started */ - JSINTERP_SKIP_TRAP = 4 /* as REJOIN, but skip trap at first opcode */ + JSINTERP_REJOIN = 1, /* as normal, but the frame has already started */ + JSINTERP_SKIP_TRAP = 2 /* as REJOIN, but skip trap at first opcode */ }; /* diff --git a/layout/reftests/text/reftest.list b/layout/reftests/text/reftest.list index 49e5b803a21f..3efb1cc4f760 100644 --- a/layout/reftests/text/reftest.list +++ b/layout/reftests/text/reftest.list @@ -50,6 +50,7 @@ skip-if(!(d2d||cocoaWidget)) random-if(d2d) != subpixel-glyphs-x-2a.html subpixe == subpixel-lineheight-1a.html subpixel-lineheight-1b.html == swash-1.html swash-1-ref.html HTTP(..) != synthetic-bold-metrics-01.html synthetic-bold-metrics-01-notref.html +== synthetic-bold-papyrus-01.html synthetic-bold-papyrus-01-ref.html # Tests for text-align-last == text-align-last-start.html text-align-last-start-ref.html == text-align-last-end.html text-align-last-end-ref.html diff --git a/layout/reftests/text/synthetic-bold-papyrus-01-ref.html b/layout/reftests/text/synthetic-bold-papyrus-01-ref.html new file mode 100644 index 000000000000..38c7dbc38d01 --- /dev/null +++ b/layout/reftests/text/synthetic-bold-papyrus-01-ref.html @@ -0,0 +1,23 @@ + + + +Test + + + + + + + +

Test for Papyrus font within a bold tag.

+ + + diff --git a/layout/reftests/text/synthetic-bold-papyrus-01.html b/layout/reftests/text/synthetic-bold-papyrus-01.html new file mode 100644 index 000000000000..1784fc7073f4 --- /dev/null +++ b/layout/reftests/text/synthetic-bold-papyrus-01.html @@ -0,0 +1,28 @@ + + + +Test + + + + + + + +

Test for Papyrus font within a bold tag.

+ + + diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 6ed5ec5bb44d..982bf48de060 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -556,7 +556,8 @@ var BrowserApp = { let ms = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService); let mimeInfo = ms.getFromTypeAndExtension("application/pdf", "pdf"); - let webBrowserPrint = content.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebBrowserPrint); + let webBrowserPrint = aBrowser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIWebBrowserPrint); let cancelable = { cancel: function (aReason) { diff --git a/services/sync/tps/extensions/tps/modules/tps.jsm b/services/sync/tps/extensions/tps/modules/tps.jsm index e53184ea31eb..218116017643 100644 --- a/services/sync/tps/extensions/tps/modules/tps.jsm +++ b/services/sync/tps/extensions/tps/modules/tps.jsm @@ -648,7 +648,7 @@ let TPS = .createInstance(CI.nsILocalFile); if (hh.oscpu.toLowerCase().indexOf('windows') > -1) { let re = /\/(\w)\/(.*)/; - this.config.testdir = this.config.testdir.replace(re, "$1://$2").replace("/", "\\", "g"); + this.config.testdir = this.config.testdir.replace(re, "$1://$2").replace(/\//g, "\\"); } mozmillfile.initWithPath(this.config.testdir); mozmillfile.appendRelativePath(testfile); diff --git a/toolkit/content/LightweightThemeConsumer.jsm b/toolkit/content/LightweightThemeConsumer.jsm index 758cc9a0ca45..0e9ce2c7fa4f 100644 --- a/toolkit/content/LightweightThemeConsumer.jsm +++ b/toolkit/content/LightweightThemeConsumer.jsm @@ -108,7 +108,7 @@ LightweightThemeConsumer.prototype = { function _setImage(aElement, aActive, aURL) { aElement.style.backgroundImage = - (aActive && aURL) ? 'url("' + aURL.replace('"', '\\"', "g") + '")' : ""; + (aActive && aURL) ? 'url("' + aURL.replace(/"/g, '\\"') + '")' : ""; } function _parseRGB(aColorString) { diff --git a/toolkit/content/tests/chrome/test_bug253481.xul b/toolkit/content/tests/chrome/test_bug253481.xul index 12662cb74413..8567bce21320 100644 --- a/toolkit/content/tests/chrome/test_bug253481.xul +++ b/toolkit/content/tests/chrome/test_bug253481.xul @@ -56,11 +56,11 @@ var expectedResults = { // "pastetofirst" strips leading newlines "pastetofirst": testString.replace(/^\n/, '').split(/\n/)[0], // "replacewithspaces" strips trailing newlines first - bug 432415 -"replacewithspaces": testString.replace(/\n$/, '').replace('\n',' ','g'), +"replacewithspaces": testString.replace(/\n$/, '').replace(/\n/g,' '), // "strip" is pretty straightforward -"strip": testString.replace('\n','','g'), +"strip": testString.replace(/\n/g,''), // "replacewithcommas" strips leading and trailing newlines first -"replacewithcommas": testString.replace(/^\n/, '').replace(/\n$/, '').replace('\n',',','g'), +"replacewithcommas": testString.replace(/^\n/, '').replace(/\n$/, '').replace(/\n/g,','), // "stripsurroundingwhitespace" strips all newlines and whitespace around them "stripsurroundingwhitespace": testString.replace(/\s*\n\s*/g,'') }; diff --git a/toolkit/crashreporter/CrashSubmit.jsm b/toolkit/crashreporter/CrashSubmit.jsm index 6d60e5398619..558478d2fd16 100644 --- a/toolkit/crashreporter/CrashSubmit.jsm +++ b/toolkit/crashreporter/CrashSubmit.jsm @@ -67,7 +67,7 @@ function parseKeyValuePairs(text) { let [key, value] = [lines[i].substring(0, eq), lines[i].substring(eq + 1)]; if (key && value) - data[key] = value.replace("\\n", "\n", "g").replace("\\\\", "\\", "g"); + data[key] = value.replace(/\\n/g, "\n").replace(/\\\\/g, "\\"); } } return data; diff --git a/toolkit/mozapps/extensions/AddonRepository.jsm b/toolkit/mozapps/extensions/AddonRepository.jsm index 11573851fcfc..9f89575da1f7 100644 --- a/toolkit/mozapps/extensions/AddonRepository.jsm +++ b/toolkit/mozapps/extensions/AddonRepository.jsm @@ -148,14 +148,14 @@ function convertHTMLToPlainText(html) { var input = Cc["@mozilla.org/supports-string;1"]. createInstance(Ci.nsISupportsString); - input.data = html.replace("\n", "
", "g"); + input.data = html.replace(/\n/g, "
"); var output = {}; converter.convert("text/html", input, input.data.length, "text/unicode", output, {}); if (output.value instanceof Ci.nsISupportsString) - return output.value.data.replace("\r\n", "\n", "g"); + return output.value.data.replace(/\r\n/g, "\n"); return html; } diff --git a/toolkit/mozapps/extensions/XPIProvider.jsm b/toolkit/mozapps/extensions/XPIProvider.jsm index 530add649a09..517f8a68855a 100644 --- a/toolkit/mozapps/extensions/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/XPIProvider.jsm @@ -828,8 +828,8 @@ function loadManifestFromRDF(aUri, aStream) { let byte_string = [String.fromCharCode(byte) for each (byte in bytes)] .join(""); // Base64 encode - addon.syncGUID = btoa(byte_string).replace('+', '-', 'g') - .replace('/', '_', 'g'); + addon.syncGUID = btoa(byte_string).replace(/\+/g, '-') + .replace(/\//g, '_'); return addon; } diff --git a/tools/profiler/sps/TableTicker.cpp b/tools/profiler/sps/TableTicker.cpp index c12880d9b5b3..1c701d7b7ee4 100644 --- a/tools/profiler/sps/TableTicker.cpp +++ b/tools/profiler/sps/TableTicker.cpp @@ -592,7 +592,7 @@ char* mozilla_sampler_get_profile() const char** mozilla_sampler_get_features() { static const char* features[] = { -#if defined(MOZ_PROFILING) && defined(USE_BACKTRACE) +#if defined(MOZ_PROFILING) && (defined(USE_BACKTRACE) || defined(USE_NS_STACKWALK)) "stackwalk", #endif NULL diff --git a/widget/gonk/nsWindow.cpp b/widget/gonk/nsWindow.cpp index 5d6c58c5c742..ef2512e6194c 100644 --- a/widget/gonk/nsWindow.cpp +++ b/widget/gonk/nsWindow.cpp @@ -41,6 +41,7 @@ #include "android/log.h" #include "ui/FramebufferNativeWindow.h" +#include "mozilla/Hal.h" #include "Framebuffer.h" #include "gfxContext.h" #include "gfxUtils.h" @@ -101,6 +102,11 @@ nsWindow::~nsWindow() void nsWindow::DoDraw(void) { + if (!hal::GetScreenEnabled()) { + gDrawRequest = true; + return; + } + if (!gWindowToRedraw) { LOG(" no window to draw, bailing"); return; @@ -296,8 +302,7 @@ nsWindow::ConfigureChildren(const nsTArray&) } NS_IMETHODIMP -nsWindow::Invalidate(const nsIntRect &aRect, - bool aIsSynchronous) +nsWindow::Invalidate(const nsIntRect &aRect) { nsWindow *parent = mParent; while (parent && parent != sTopWindows[0]) @@ -307,20 +312,8 @@ nsWindow::Invalidate(const nsIntRect &aRect, mDirtyRegion.Or(mDirtyRegion, aRect); gWindowToRedraw = this; - if (aIsSynchronous) { - gDrawRequest = false; - DoDraw(); - } else { - gDrawRequest = true; - mozilla::NotifyEvent(); - } - return NS_OK; -} - -NS_IMETHODIMP -nsWindow::Update() -{ - Invalidate(gScreenBounds, false); + gDrawRequest = true; + mozilla::NotifyEvent(); return NS_OK; } @@ -442,7 +435,7 @@ nsWindow::BringToTop() nsGUIEvent event(true, NS_ACTIVATE, this); (*mEventCallback)(&event); - Update(); + Invalidate(gScreenBounds); } void diff --git a/widget/gonk/nsWindow.h b/widget/gonk/nsWindow.h index ac899962667d..5bd12a962c0b 100644 --- a/widget/gonk/nsWindow.h +++ b/widget/gonk/nsWindow.h @@ -98,9 +98,7 @@ public: NS_IMETHOD IsEnabled(bool *aState); NS_IMETHOD SetFocus(bool aRaise = false); NS_IMETHOD ConfigureChildren(const nsTArray&); - NS_IMETHOD Invalidate(const nsIntRect &aRect, - bool aIsSynchronous); - NS_IMETHOD Update(); + NS_IMETHOD Invalidate(const nsIntRect &aRect); virtual void* GetNativeData(PRUint32 aDataType); NS_IMETHOD SetTitle(const nsAString& aTitle) {