diff --git a/application/basilisk/app/basilisk.exe.manifest b/application/basilisk/app/basilisk.exe.manifest index bf5aac4165..5792ecabe8 100644 --- a/application/basilisk/app/basilisk.exe.manifest +++ b/application/basilisk/app/basilisk.exe.manifest @@ -29,6 +29,7 @@ True/PM + PerMonitorV2,PerMonitor diff --git a/application/palemoon/app/palemoon.exe.manifest b/application/palemoon/app/palemoon.exe.manifest index c4f0ef8f01..7523b82167 100644 --- a/application/palemoon/app/palemoon.exe.manifest +++ b/application/palemoon/app/palemoon.exe.manifest @@ -29,6 +29,7 @@ True/PM + PerMonitorV2,PerMonitor diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js index a750aca994..ee57e611d1 100644 --- a/application/palemoon/app/profile/palemoon.js +++ b/application/palemoon/app/profile/palemoon.js @@ -144,8 +144,13 @@ pref("app.update.cert.maxErrors", 5); // |app.update.url.override| user preference has been set for testing updates or // when the |app.update.cert.checkAttributes| preference is set to false. Also, // the |app.update.url.override| preference should ONLY be used for testing. -pref("app.update.certs.1.issuerName", "CN=COMODO RSA Domain Validation Secure Server CA,O=COMODO CA Limited,L=Salford,ST=Greater Manchester,C=GB"); -pref("app.update.certs.1.commonName", "*.palemoon.org"); +// +// Examples: +// pref("app.update.certs.1.issuerName", "CN=COMODO RSA Domain Validation Secure Server CA,O=COMODO CA Limited,L=Salford,ST=Greater Manchester,C=GB"); +// pref("app.update.certs.1.commonName", "*.palemoon.org"); +// +// Note: these preferences are branding-specific and should be listed in +// application branding, depending on publisher. // Whether or not app updates are enabled pref("app.update.enabled", true); diff --git a/application/palemoon/branding/shared/pref/uaoverrides.inc b/application/palemoon/branding/shared/pref/uaoverrides.inc index d6ba789edc..404f7fc3fb 100644 --- a/application/palemoon/branding/shared/pref/uaoverrides.inc +++ b/application/palemoon/branding/shared/pref/uaoverrides.inc @@ -31,7 +31,7 @@ pref("@GUAO_PREF@.msn.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ pref("@GUAO_PREF@.patientaccess.com","Mozilla/5.0 (%OS_SLICE% rv:60.0) @GK_SLICE@ Firefox/60.0 @PM_SLICE@"); pref("@GUAO_PREF@.outlook.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Pale Moon)"); pref("@GUAO_PREF@.web.de","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Pale Moon)"); -pref("@GUAO_PREF@.yahoo.com","Mozilla/5.0 (%OS_SLICE% rv:99.9) @GK_SLICE@ Firefox/99.9 (Pale Moon)"); +pref("@GUAO_PREF@.yahoo.com","Mozilla/5.0 (%OS_SLICE% rv:99.9) @GK_SLICE@ Firefox/99.9"); pref("@GUAO_PREF@.calendar.yahoo.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Pale Moon)"); pref("@GUAO_PREF@.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:60.0) @GK_SLICE@ Firefox/60.0 @PM_SLICE@"); pref("@GUAO_PREF@.gaming.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:42.0) @GK_SLICE@ Firefox/42.0"); diff --git a/devtools/shared/css/generated/properties-db.js b/devtools/shared/css/generated/properties-db.js index 25d9e2d334..316352771a 100644 --- a/devtools/shared/css/generated/properties-db.js +++ b/devtools/shared/css/generated/properties-db.js @@ -7857,6 +7857,7 @@ exports.CSS_PROPERTIES = { ], "supports": [], "values": [ + "anywhere", "break-word", "inherit", "initial", @@ -9317,6 +9318,7 @@ exports.CSS_PROPERTIES = { ], "supports": [], "values": [ + "anywhere", "break-word", "inherit", "initial", diff --git a/gfx/thebes/gfxTextRun.cpp b/gfx/thebes/gfxTextRun.cpp index 8794efe688..1025abbd3e 100644 --- a/gfx/thebes/gfxTextRun.cpp +++ b/gfx/thebes/gfxTextRun.cpp @@ -1071,6 +1071,34 @@ gfxTextRun::GetAdvanceWidth(Range aRange, PropertyProvider *aProvider, return result + GetAdvanceForGlyphs(ligatureRange); } +gfxFloat +gfxTextRun::GetMinAdvanceWidth(Range aRange) +{ + MOZ_ASSERT(aRange.end <= GetLength(), "Substring out of range"); + + Range ligatureRange = aRange; + ShrinkToLigatureBoundaries(&ligatureRange); + + gfxFloat result = std::max( + ComputePartialLigatureWidth(Range(aRange.start, ligatureRange.start), + nullptr), + ComputePartialLigatureWidth(Range(ligatureRange.end, aRange.end), + nullptr)); + + // XXX Do we need to take spacing into account? When each grapheme cluster + // takes its own line, we shouldn't be adding spacings around them. + gfxFloat clusterAdvance = 0; + for (uint32_t i = ligatureRange.start; i < ligatureRange.end; ++i) { + clusterAdvance += GetAdvanceForGlyph(i); + if (i + 1 == ligatureRange.end || IsClusterStart(i + 1)) { + result = std::max(result, clusterAdvance); + clusterAdvance = 0; + } + } + + return result; +} + bool gfxTextRun::SetLineBreaks(Range aRange, bool aLineBreakBefore, bool aLineBreakAfter, diff --git a/gfx/thebes/gfxTextRun.h b/gfx/thebes/gfxTextRun.h index beeaad04b1..7217eca747 100644 --- a/gfx/thebes/gfxTextRun.h +++ b/gfx/thebes/gfxTextRun.h @@ -297,6 +297,12 @@ public: return GetAdvanceWidth(Range(this), nullptr); } + /** + * Computes the minimum advance width for a substring assuming line + * breaking is allowed everywhere. + */ + gfxFloat GetMinAdvanceWidth(Range aRange); + /** * Clear all stored line breaks for the given range (both before and after), * and then set the line-break state before aRange.start to aBreakBefore and diff --git a/ipc/app/plugin-container.exe.manifest b/ipc/app/plugin-container.exe.manifest index d61ddec1a8..68b07371c6 100644 --- a/ipc/app/plugin-container.exe.manifest +++ b/ipc/app/plugin-container.exe.manifest @@ -29,6 +29,7 @@ True/PM + PerMonitorV2,PerMonitor diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index ec1034204c..fcce7f3f65 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -8243,6 +8243,17 @@ nsTextFrame::AddInlineMinISizeForFlow(nsRenderingContext *aRenderingContext, return; } + // If overflow-wrap is 'anywhere', we can wrap everywhere. + if (textStyle->mOverflowWrap == NS_STYLE_OVERFLOWWRAP_ANYWHERE && + textStyle->WordCanWrap(this)) { + aData->OptionallyBreak(); + aData->mCurrentLine += + textRun->GetMinAdvanceWidth(Range(start, flowEndInTextRun)); + aData->mTrailingWhitespace = 0; + aData->OptionallyBreak(); + return; + } + AutoTArray hyphBuffer; bool *hyphBreakBefore = nullptr; if (hyphenating) { diff --git a/layout/style/nsCSSKeywordList.h b/layout/style/nsCSSKeywordList.h index 9045da9ff1..86ba59142f 100644 --- a/layout/style/nsCSSKeywordList.h +++ b/layout/style/nsCSSKeywordList.h @@ -144,6 +144,7 @@ CSS_KEY(alternate, alternate) CSS_KEY(alternate-reverse, alternate_reverse) CSS_KEY(always, always) CSS_KEY(annotation, annotation) +CSS_KEY(anywhere, anywhere) CSS_KEY(appworkspace, appworkspace) CSS_KEY(auto, auto) CSS_KEY(auto-fill, auto_fill) diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index 24c97cf33e..e0cda24884 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -2284,6 +2284,7 @@ const KTableEntry nsCSSProps::kWordBreakKTable[] = { const KTableEntry nsCSSProps::kOverflowWrapKTable[] = { { eCSSKeyword_normal, NS_STYLE_OVERFLOWWRAP_NORMAL }, { eCSSKeyword_break_word, NS_STYLE_OVERFLOWWRAP_BREAK_WORD }, + { eCSSKeyword_anywhere, NS_STYLE_OVERFLOWWRAP_ANYWHERE }, { eCSSKeyword_UNKNOWN, -1 } }; diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h index f54387aa8a..e6a0cc65a3 100644 --- a/layout/style/nsStyleConsts.h +++ b/layout/style/nsStyleConsts.h @@ -997,6 +997,7 @@ enum class StyleDisplay : uint8_t { // See nsStyleText #define NS_STYLE_OVERFLOWWRAP_NORMAL 0 #define NS_STYLE_OVERFLOWWRAP_BREAK_WORD 1 +#define NS_STYLE_OVERFLOWWRAP_ANYWHERE 2 // See nsStyleText #define NS_STYLE_HYPHENS_NONE 0 diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 0fec27d21a..e4d02a24a7 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -2133,8 +2133,11 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleText } bool WordCanWrapStyle() const { - return WhiteSpaceCanWrapStyle() && - mOverflowWrap == NS_STYLE_OVERFLOWWRAP_BREAK_WORD; + if (!WhiteSpaceCanWrapStyle()) { + return false; + } + return (mOverflowWrap == NS_STYLE_OVERFLOWWRAP_BREAK_WORD || + mOverflowWrap == NS_STYLE_OVERFLOWWRAP_ANYWHERE); } bool HasTextEmphasis() const { diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp index a6e8f03618..1ba5f3c699 100644 --- a/widget/windows/WinUtils.cpp +++ b/widget/windows/WinUtils.cpp @@ -482,10 +482,20 @@ WinUtils::Initialize() if (IsWin10OrLater()) { HMODULE user32Dll = ::GetModuleHandleW(L"user32"); if (user32Dll) { - sEnableNonClientDpiScaling = (EnableNonClientDpiScalingProc) - ::GetProcAddress(user32Dll, "EnableNonClientDpiScaling"); - sSetThreadDpiAwarenessContext = (SetThreadDpiAwarenessContextProc) - ::GetProcAddress(user32Dll, "SetThreadDpiAwarenessContext"); + auto getThreadDpiAwarenessContext = (decltype(GetThreadDpiAwarenessContext)*) + ::GetProcAddress(user32Dll, "GetThreadDpiAwarenessContext"); + auto areDpiAwarenessContextsEqual = (decltype(AreDpiAwarenessContextsEqual)*) + ::GetProcAddress(user32Dll, "AreDpiAwarenessContextsEqual"); + if (getThreadDpiAwarenessContext && areDpiAwarenessContextsEqual && + areDpiAwarenessContextsEqual(getThreadDpiAwarenessContext(), + DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE)) { + // Only per-monitor DPI awareness v1 requires these workarounds. + // Since this was introduced in Win 8.1 we'll need to keep this indefinitely. + sEnableNonClientDpiScaling = (EnableNonClientDpiScalingProc) + ::GetProcAddress(user32Dll, "EnableNonClientDpiScaling"); + sSetThreadDpiAwarenessContext = (SetThreadDpiAwarenessContextProc) + ::GetProcAddress(user32Dll, "SetThreadDpiAwarenessContext"); + } } } @@ -501,7 +511,7 @@ LRESULT WINAPI WinUtils::NonClientDpiScalingDefWindowProcW(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { - if (msg == WM_NCCREATE && sEnableNonClientDpiScaling) { + if (msg == WM_NCCREATE) { sEnableNonClientDpiScaling(hWnd); } return ::DefWindowProcW(hWnd, msg, wParam, lParam); diff --git a/widget/windows/WinUtils.h b/widget/windows/WinUtils.h index 37469ce079..23e910db21 100644 --- a/widget/windows/WinUtils.h +++ b/widget/windows/WinUtils.h @@ -96,6 +96,11 @@ typedef enum DPI_AWARENESS { #define DPI_AWARENESS_CONTEXT_DECLARED #endif // (DPI_AWARENESS_CONTEXT_DECLARED) +#if WINVER < 0x0605 +WINUSERAPI DPI_AWARENESS_CONTEXT WINAPI GetThreadDpiAwarenessContext(); +WINUSERAPI BOOL WINAPI +AreDpiAwarenessContextsEqual(DPI_AWARENESS_CONTEXT, DPI_AWARENESS_CONTEXT); +#endif /* WINVER < 0x0605 */ typedef DPI_AWARENESS_CONTEXT(WINAPI * SetThreadDpiAwarenessContextProc)(DPI_AWARENESS_CONTEXT); typedef BOOL(WINAPI * EnableNonClientDpiScalingProc)(HWND); @@ -152,6 +157,12 @@ class WinUtils static SetThreadDpiAwarenessContextProc sSetThreadDpiAwarenessContext; static EnableNonClientDpiScalingProc sEnableNonClientDpiScaling; + // Wrapper for DefWindowProc that will enable non-client dpi scaling on the + // window during creation. + static LRESULT WINAPI + NonClientDpiScalingDefWindowProcW(HWND hWnd, UINT msg, + WPARAM wParam, LPARAM lParam); + public: class AutoSystemDpiAware { @@ -174,11 +185,11 @@ public: DPI_AWARENESS_CONTEXT mPrevContext; }; - // Wrapper for DefWindowProc that will enable non-client dpi scaling on the - // window during creation. - static LRESULT WINAPI - NonClientDpiScalingDefWindowProcW(HWND hWnd, UINT msg, - WPARAM wParam, LPARAM lParam); + static decltype(::DefWindowProcW)* GetDefWindowProc() { + return sEnableNonClientDpiScaling ? + NonClientDpiScalingDefWindowProcW : + ::DefWindowProcW; + } /** * Get the system's default logical-to-physical DPI scaling factor, diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 8c88d885df..0b3c129edc 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -1007,7 +1007,7 @@ nsWindow::RegisterWindowClass(const wchar_t* aClassName, } wc.style = CS_DBLCLKS | aExtraStyle; - wc.lpfnWndProc = WinUtils::NonClientDpiScalingDefWindowProcW; + wc.lpfnWndProc = WinUtils::GetDefWindowProc(); wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = nsToolkit::mDllInstance;