From 25779d371c571e4f51792af3e3c5588b3186e934 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 30 Mar 2019 19:10:17 +0100 Subject: Issue #187: Remove solaris conditional code. --- layout/style/nsRuleNode.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'layout') diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 6bcef02a0..08400635b 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -67,9 +67,6 @@ #define alloca _alloca #endif #endif -#ifdef SOLARIS -#include -#endif using std::max; using std::min; -- cgit v1.2.3 From 1bf6a5c7da242bef3e68f95c47173a1db12da7c4 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 31 Mar 2019 15:27:49 +0200 Subject: Remove 18 yo OS/2 and AIX bustage workaround. Tag #186 --- layout/generic/nsLineBox.h | 92 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 73 insertions(+), 19 deletions(-) (limited to 'layout') diff --git a/layout/generic/nsLineBox.h b/layout/generic/nsLineBox.h index 8f42b9e93..962279df6 100644 --- a/layout/generic/nsLineBox.h +++ b/layout/generic/nsLineBox.h @@ -857,29 +857,47 @@ class nsLineList_iterator { return --copy; } - // Passing by value rather than by reference and reference to const - // to keep AIX happy. - bool operator==(const iterator_self_type aOther) const + bool operator==(const iterator_self_type& aOther) const { MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists"); return mCurrent == aOther.mCurrent; } - bool operator!=(const iterator_self_type aOther) const + bool operator!=(const iterator_self_type& aOther) const { MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists"); return mCurrent != aOther.mCurrent; } - bool operator==(const iterator_self_type aOther) + bool operator==(const iterator_self_type& aOther) { MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists"); return mCurrent == aOther.mCurrent; } - bool operator!=(const iterator_self_type aOther) + bool operator!=(const iterator_self_type& aOther) { MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists"); return mCurrent != aOther.mCurrent; } - + bool operator==(iterator_self_type& aOther) const + { + MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists"); + return mCurrent == aOther.mCurrent; + } + bool operator!=(iterator_self_type& aOther) const + { + MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists"); + return mCurrent != aOther.mCurrent; + } + bool operator==(iterator_self_type& aOther) + { + MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists"); + return mCurrent == aOther.mCurrent; + } + bool operator!=(iterator_self_type& aOther) + { + MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists"); + return mCurrent != aOther.mCurrent; + } + private: link_type *mCurrent; #ifdef DEBUG @@ -992,24 +1010,42 @@ class nsLineList_reverse_iterator { } #endif /* !__MWERKS__ */ - // Passing by value rather than by reference and reference to const - // to keep AIX happy. - bool operator==(const iterator_self_type aOther) const + bool operator==(const iterator_self_type& aOther) const { NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); return mCurrent == aOther.mCurrent; } - bool operator!=(const iterator_self_type aOther) const + bool operator!=(const iterator_self_type& aOther) const { NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); return mCurrent != aOther.mCurrent; } - bool operator==(const iterator_self_type aOther) + bool operator==(const iterator_self_type& aOther) { NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); return mCurrent == aOther.mCurrent; } - bool operator!=(const iterator_self_type aOther) + bool operator!=(const iterator_self_type& aOther) + { + NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); + return mCurrent != aOther.mCurrent; + } + bool operator==(iterator_self_type& aOther) const + { + NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); + return mCurrent == aOther.mCurrent; + } + bool operator!=(iterator_self_type& aOther) const + { + NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); + return mCurrent != aOther.mCurrent; + } + bool operator==(iterator_self_type& aOther) + { + NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); + return mCurrent == aOther.mCurrent; + } + bool operator!=(iterator_self_type& aOther) { NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); return mCurrent != aOther.mCurrent; @@ -1126,24 +1162,42 @@ class nsLineList_const_iterator { return --copy; } - // Passing by value rather than by reference and reference to const - // to keep AIX happy. - bool operator==(const iterator_self_type aOther) const + bool operator==(const iterator_self_type& aOther) const { NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); return mCurrent == aOther.mCurrent; } - bool operator!=(const iterator_self_type aOther) const + bool operator!=(const iterator_self_type& aOther) const { NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); return mCurrent != aOther.mCurrent; } - bool operator==(const iterator_self_type aOther) + bool operator==(const iterator_self_type& aOther) { NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); return mCurrent == aOther.mCurrent; } - bool operator!=(const iterator_self_type aOther) + bool operator!=(const iterator_self_type& aOther) + { + NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); + return mCurrent != aOther.mCurrent; + } + bool operator==(iterator_self_type& aOther) const + { + NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); + return mCurrent == aOther.mCurrent; + } + bool operator!=(iterator_self_type& aOther) const + { + NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); + return mCurrent != aOther.mCurrent; + } + bool operator==(iterator_self_type& aOther) + { + NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); + return mCurrent == aOther.mCurrent; + } + bool operator!=(iterator_self_type& aOther) { NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists"); return mCurrent != aOther.mCurrent; -- cgit v1.2.3 From 71c0318322ce998ea411f343607de524b2058799 Mon Sep 17 00:00:00 2001 From: cku Date: Fri, 28 Apr 2017 11:48:21 +0800 Subject: Bug 1360343 - ensure maskSurface is not null before dereference, since it can be null because of OOM or gfx device reset. r=dvander MozReview-Commit-ID: HX2qsWLZpMg --HG-- extra : rebase_source : 046befc11151461a682842c31e2ce39247a5e1d8 --- layout/svg/nsSVGMaskFrame.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'layout') diff --git a/layout/svg/nsSVGMaskFrame.cpp b/layout/svg/nsSVGMaskFrame.cpp index b8e4b32ae..a22833d61 100644 --- a/layout/svg/nsSVGMaskFrame.cpp +++ b/layout/svg/nsSVGMaskFrame.cpp @@ -274,7 +274,8 @@ nsSVGMaskFrame::GetMaskForMaskedFrame(gfxContext* aContext, } RefPtr maskSurface = maskSnapshot->GetDataSurface(); DataSourceSurface::MappedSurface map; - if (!maskSurface->Map(DataSourceSurface::MapType::READ, &map)) { + if (!maskSurface || + !maskSurface->Map(DataSourceSurface::MapType::READ, &map)) { return nullptr; } -- cgit v1.2.3 From 00baf283622b47ad7926c6e62364854d3dfbc00a Mon Sep 17 00:00:00 2001 From: yami <34216515+kn-yami@users.noreply.github.com> Date: Wed, 3 Apr 2019 19:10:37 +0200 Subject: add a nullptr check in nsSVGUtils::PaintFrameWithEffects --- layout/svg/nsSVGUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layout') diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp index 0bded21ff..b8794a05d 100644 --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -685,7 +685,7 @@ nsSVGUtils::PaintFrameWithEffects(nsIFrame *aFrame, bool isOK = effectProperties.HasNoFilterOrHasValidFilter(); nsSVGClipPathFrame *clipPathFrame = effectProperties.GetClipPathFrame(&isOK); nsSVGMaskFrame *maskFrame = effectProperties.GetFirstMaskFrame(&isOK); - if (!isOK) { + if (!isOK || !maskFrame) { // Some resource is invalid. We shouldn't paint anything. return DrawResult::SUCCESS; } -- cgit v1.2.3 From 81cdb56fa3e232a232745a76effeda8f407b6f65 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 6 Apr 2019 20:35:14 +0200 Subject: Revert "add a nullptr check in nsSVGUtils::PaintFrameWithEffects" This reverts commit 00baf283622b47ad7926c6e62364854d3dfbc00a. --- layout/svg/nsSVGUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layout') diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp index b8794a05d..0bded21ff 100644 --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -685,7 +685,7 @@ nsSVGUtils::PaintFrameWithEffects(nsIFrame *aFrame, bool isOK = effectProperties.HasNoFilterOrHasValidFilter(); nsSVGClipPathFrame *clipPathFrame = effectProperties.GetClipPathFrame(&isOK); nsSVGMaskFrame *maskFrame = effectProperties.GetFirstMaskFrame(&isOK); - if (!isOK || !maskFrame) { + if (!isOK) { // Some resource is invalid. We shouldn't paint anything. return DrawResult::SUCCESS; } -- cgit v1.2.3 From 964c9830fa956249e5f3f3e30bf5d2d307ca3572 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 6 Apr 2019 22:12:00 +0200 Subject: Add nullcheck in nsSVGUtils::PaintFrameWithEffects Some SVGs define a mask but an invalid mask frame. Check to make sure we have a `maskFrame` that isn't null before trying to use it. This resolves #1034 --- layout/svg/nsSVGUtils.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'layout') diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp index 0bded21ff..98e5f9b5f 100644 --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -734,9 +734,12 @@ nsSVGUtils::PaintFrameWithEffects(nsIFrame *aFrame, RefPtr maskSurface; if (maskUsage.shouldGenerateMaskLayer) { - maskSurface = - maskFrame->GetMaskForMaskedFrame(&aContext, aFrame, aTransform, - maskUsage.opacity, &maskTransform); + // Make sure we have a mask frame. + if (maskFrame) { + maskSurface = + maskFrame->GetMaskForMaskedFrame(&aContext, aFrame, aTransform, + maskUsage.opacity, &maskTransform); + } if (!maskSurface) { // Entire surface is clipped out. -- cgit v1.2.3 From 1d0af8b59102331cba100529e1697f91faf0c86b Mon Sep 17 00:00:00 2001 From: Ascrod <32915892+Ascrod@users.noreply.github.com> Date: Mon, 8 Apr 2019 20:42:10 -0400 Subject: Issue #991 Part 5: DOM and layout --- layout/tools/reftest/reftest.jsm | 94 +++++++--------------------------------- 1 file changed, 15 insertions(+), 79 deletions(-) (limited to 'layout') diff --git a/layout/tools/reftest/reftest.jsm b/layout/tools/reftest/reftest.jsm index bd9976b0f..c885150a4 100644 --- a/layout/tools/reftest/reftest.jsm +++ b/layout/tools/reftest/reftest.jsm @@ -277,29 +277,10 @@ this.OnRefTestLoad = function OnRefTestLoad(win) var prefs = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); - try { - gBrowserIsRemote = prefs.getBoolPref("browser.tabs.remote.autostart"); - } catch (e) { - gBrowserIsRemote = false; - } - - try { - gB2GisMulet = prefs.getBoolPref("b2g.is_mulet"); - } catch (e) { - gB2GisMulet = false; - } - - try { - gBrowserIsIframe = prefs.getBoolPref("reftest.browser.iframe.enabled"); - } catch (e) { - gBrowserIsIframe = false; - } - - try { - gLogLevel = prefs.getCharPref("reftest.logLevel"); - } catch (e) { - gLogLevel ='info'; - } + gBrowserIsRemote = prefs.getBoolPref("browser.tabs.remote.autostart", false); + gB2GisMulet = prefs.getBoolPref("b2g.is_mulet", false); + gBrowserIsIframe = prefs.getBoolPref("reftest.browser.iframe.enabled", false); + gLogLevel = prefs.getCharPref("reftest.logLevel", "info"); if (win === undefined || win == null) { win = window; @@ -366,11 +347,7 @@ function InitAndStartRefTests() } catch (e) {} /* set the gLoadTimeout */ - try { - gLoadTimeout = prefs.getIntPref("reftest.timeout"); - } catch(e) { - gLoadTimeout = 5 * 60 * 1000; //5 minutes as per bug 479518 - } + gLoadTimeout = prefs.getIntPref("reftest.timeout", 5 * 60 * 1000); //5 minutes as per bug 479518 /* Get the logfile for android tests */ try { @@ -381,27 +358,12 @@ function InitAndStartRefTests() } } catch(e) {} - try { - gRemote = prefs.getBoolPref("reftest.remote"); - } catch(e) { - gRemote = false; - } - - try { - gIgnoreWindowSize = prefs.getBoolPref("reftest.ignoreWindowSize"); - } catch(e) { - gIgnoreWindowSize = false; - } + gRemote = prefs.getBoolPref("reftest.remote", false); + gIgnoreWindowSize = prefs.getBoolPref("reftest.ignoreWindowSize", false); /* Support for running a chunk (subset) of tests. In separate try as this is optional */ - try { - gTotalChunks = prefs.getIntPref("reftest.totalChunks"); - gThisChunk = prefs.getIntPref("reftest.thisChunk"); - } - catch(e) { - gTotalChunks = 0; - gThisChunk = 0; - } + gTotalChunks = prefs.getIntPref("reftest.totalChunks", 0); + gThisChunk = prefs.getIntPref("reftest.thisChunk", 0); try { gFocusFilterMode = prefs.getCharPref("reftest.focusFilterMode"); @@ -468,39 +430,17 @@ function StartTests() logger.error("EXCEPTION: " + e); } - try { - gNoCanvasCache = prefs.getIntPref("reftest.nocache"); - } catch(e) { - gNoCanvasCache = false; - } - - try { - gShuffle = prefs.getBoolPref("reftest.shuffle"); - } catch (e) { - gShuffle = false; - } - - try { - gRunUntilFailure = prefs.getBoolPref("reftest.runUntilFailure"); - } catch (e) { - gRunUntilFailure = false; - } + gNoCanvasCache = prefs.getIntPref("reftest.nocache", false); + gShuffle = prefs.getBoolPref("reftest.shuffle", false); + gRunUntilFailure = prefs.getBoolPref("reftest.runUntilFailure", false); // When we repeat this function is called again, so really only want to set // gRepeat once. if (gRepeat == null) { - try { - gRepeat = prefs.getIntPref("reftest.repeat"); - } catch (e) { - gRepeat = 0; - } + gRepeat = prefs.getIntPref("reftest.repeat", 0); } - try { - gRunSlowTests = prefs.getIntPref("reftest.skipslowtests"); - } catch(e) { - gRunSlowTests = false; - } + gRunSlowTests = prefs.getIntPref("reftest.skipslowtests", false); if (gShuffle) { gNoCanvasCache = true; @@ -737,11 +677,7 @@ function BuildConditionSandbox(aURL) { var prefs = CC["@mozilla.org/preferences-service;1"]. getService(CI.nsIPrefBranch); - try { - sandbox.nativeThemePref = !prefs.getBoolPref("mozilla.widget.disable-native-theme"); - } catch (e) { - sandbox.nativeThemePref = true; - } + sandbox.nativeThemePref = !prefs.getBoolPref("mozilla.widget.disable-native-theme", false); sandbox.prefs = CU.cloneInto({ getBoolPref: function(p) { return prefs.getBoolPref(p); }, -- cgit v1.2.3 From d9137b4b7ae446750713c48a48574465301e3699 Mon Sep 17 00:00:00 2001 From: JustOff Date: Sat, 20 Apr 2019 13:53:46 +0300 Subject: Handle URL token in a closer way to the CSS3 spec --- .../css-parsing/invalid-url-handling.xhtml | 22 +++++++++++----------- layout/style/nsCSSScanner.cpp | 22 +++++++++++++++++++++- layout/style/test/test_csslexer.js | 3 +-- 3 files changed, 33 insertions(+), 14 deletions(-) (limited to 'layout') diff --git a/layout/reftests/css-parsing/invalid-url-handling.xhtml b/layout/reftests/css-parsing/invalid-url-handling.xhtml index da1709b01..e6b85a81c 100644 --- a/layout/reftests/css-parsing/invalid-url-handling.xhtml +++ b/layout/reftests/css-parsing/invalid-url-handling.xhtml @@ -22,17 +22,16 @@ #two { background-color: green; } +
abcdefg
+
LMNOPQR
+ \ No newline at end of file diff --git a/layout/reftests/text-svgglyphs/svg-glyph-compressed.html b/layout/reftests/text-svgglyphs/svg-glyph-compressed.html new file mode 100644 index 000000000..e8123bba6 --- /dev/null +++ b/layout/reftests/text-svgglyphs/svg-glyph-compressed.html @@ -0,0 +1,15 @@ + + +Test for compressed SVG glyphs + +
abcdefg
+
LMNOPQR
+ \ No newline at end of file -- cgit v1.2.3 From 622ad88c5d0ed8fc301d37b884857123eb17cc56 Mon Sep 17 00:00:00 2001 From: win7-7 Date: Fri, 24 May 2019 20:00:07 +0300 Subject: Lots of time spent maintaining nsDisplayLayerEventRegions (#1116) * Simplify the dispatch-to-content region Simplify the dispatch-to-content region in nsDisplayLayerEventRegions::AddFrame() and AddInactiveScrollPort() if it starts to get large. * tabs to spaces --- layout/base/nsDisplayList.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'layout') diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index c830891a5..a55ec1e39 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -3808,12 +3808,14 @@ nsDisplayLayerEventRegions::AddFrame(nsDisplayListBuilder* aBuilder, // region on scrollbar frames that won't be placed in their own layer. See // bug 1213324 for details. mDispatchToContentHitRegion.Or(mDispatchToContentHitRegion, borderBox); + mDispatchToContentHitRegion.SimplifyOutward(8); } else if (aFrame->GetType() == nsGkAtoms::objectFrame) { // If the frame is a plugin frame and wants to handle wheel events as // default action, we should add the frame to dispatch-to-content region. nsPluginFrame* pluginFrame = do_QueryFrame(aFrame); if (pluginFrame && pluginFrame->WantsToHandleWheelEventAsDefaultAction()) { mDispatchToContentHitRegion.Or(mDispatchToContentHitRegion, borderBox); + mDispatchToContentHitRegion.SimplifyOutward(8); } } @@ -3850,6 +3852,7 @@ nsDisplayLayerEventRegions::AddFrame(nsDisplayListBuilder* aBuilder, } if (alreadyHadRegions) { mDispatchToContentHitRegion.OrWith(CombinedTouchActionRegion()); + mDispatchToContentHitRegion.SimplifyOutward(8); } } } @@ -3859,6 +3862,7 @@ nsDisplayLayerEventRegions::AddInactiveScrollPort(const nsRect& aRect) { mHitRegion.Or(mHitRegion, aRect); mDispatchToContentHitRegion.Or(mDispatchToContentHitRegion, aRect); + mDispatchToContentHitRegion.SimplifyOutward(8); } bool -- cgit v1.2.3 From fb1b45e5fcb82e76e303665fbb9d04fb2a800b31 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Mon, 27 May 2019 19:19:27 +0200 Subject: Improve origin-clean algorithm --- layout/base/nsLayoutUtils.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'layout') diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 07befdc81..17ece8e61 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -8,6 +8,7 @@ #include "mozilla/ArrayUtils.h" #include "mozilla/BasicEvents.h" +#include "mozilla/dom/CanvasUtils.h" #include "mozilla/ClearOnShutdown.h" #include "mozilla/EffectCompositor.h" #include "mozilla/EffectSet.h" @@ -7285,10 +7286,10 @@ nsLayoutUtils::SurfaceFromElement(nsIImageLoadingContent* aElement, } result.mPrincipal = principal.forget(); - // no images, including SVG images, can load content from another domain. - result.mIsWriteOnly = false; result.mImageRequest = imgRequest.forget(); return result; + result.mIsWriteOnly = + CanvasUtils::CheckWriteOnlySecurity(result.mCORSUsed, result.mPrincipal); } nsLayoutUtils::SurfaceFromElementResult @@ -7400,7 +7401,8 @@ nsLayoutUtils::SurfaceFromElement(HTMLVideoElement* aElement, result.mHasSize = true; result.mSize = result.mLayersImage->GetSize(); result.mPrincipal = principal.forget(); - result.mIsWriteOnly = false; + result.mIsWriteOnly = + CanvasUtils::CheckWriteOnlySecurity(result.mCORSUsed, result.mPrincipal); return result; } -- cgit v1.2.3